<commit_before>import ./make-test.nix ({pkgs, lib, ...}:
let
  # A filesystem image with a (presumably) bootable debian
  debianImage = pkgs.vmTools.diskImageFuns.debian9i386 {
    # os-prober cannot detect systems installed on disks without a partition table
    # so we create the disk ourselves
    createRootFS = with pkgs; ''
      ${parted}/bin/parted --script /dev/vda mklabel msdos
      ${parted}/sbin/parted --script /dev/vda -- mkpart primary ext2 1M -1s
      mkdir /mnt
      ${e2fsprogs}/bin/mkfs.ext4 /dev/vda1
      ${utillinux}/bin/mount -t ext4 /dev/vda1 /mnt

      if test -e /mnt/.debug; then
        exec ${bash}/bin/sh
      fi
      touch /mnt/.debug

      mkdir /mnt/proc /mnt/dev /mnt/sys
    '';
    extraPackages = [
      # /etc/os-release
      "base-files"
      # make the disk bootable-looking
      "grub2" "linux-image-686"
    ];
    # install grub
    postInstall = ''
      ln -sf /proc/self/mounts > /etc/mtab
      PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
        grub-install /dev/vda --force
      PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
        update-grub
    '';
  };

  # options to add the disk to the test vm
  QEMU_OPTS = "-drive index=2,file=${debianImage}/disk-image.qcow2,read-only,if=virtio";

  # a part of the configuration of the test vm
  simpleConfig = {
    boot.loader.grub = {
      enable = true;
      useOSProber = true;
      device = "/dev/vda";
      # vda is a filesystem without partition table
      forceInstall = true;
    };
    fileSystems."/mnt" = {
      device = "/dev/vdb1";
      options = [ "ro" ];
    };
    nix.binaryCaches = lib.mkForce [ ];
    nix.extraOptions = ''<commit_msg>os-prober.tests: make the test stricter<commit_after>import ./make-test.nix ({pkgs, lib, ...}:
let
  # A filesystem image with a (presumably) bootable debian
  debianImage = pkgs.vmTools.diskImageFuns.debian9i386 {
    # os-prober cannot detect systems installed on disks without a partition table
    # so we create the disk ourselves
    createRootFS = with pkgs; ''
      ${parted}/bin/parted --script /dev/vda mklabel msdos
      ${parted}/sbin/parted --script /dev/vda -- mkpart primary ext2 1M -1s
      mkdir /mnt
      ${e2fsprogs}/bin/mkfs.ext4 /dev/vda1
      ${utillinux}/bin/mount -t ext4 /dev/vda1 /mnt

      if test -e /mnt/.debug; then
        exec ${bash}/bin/sh
      fi
      touch /mnt/.debug

      mkdir /mnt/proc /mnt/dev /mnt/sys
    '';
    extraPackages = [
      # /etc/os-release
      "base-files"
      # make the disk bootable-looking
      "grub2" "linux-image-686"
    ];
    # install grub
    postInstall = ''
      ln -sf /proc/self/mounts > /etc/mtab
      PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
        grub-install /dev/vda --force
      PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
        update-grub
    '';
  };

  # options to add the disk to the test vm
  QEMU_OPTS = "-drive index=2,file=${debianImage}/disk-image.qcow2,read-only,if=virtio";

  # a part of the configuration of the test vm
  simpleConfig = {
    boot.loader.grub = {
      enable = true;
      useOSProber = true;
      device = "/dev/vda";
      # vda is a filesystem without partition table
      forceInstall = true;
    };
    nix.binaryCaches = lib.mkForce [ ];
    nix.extraOptions = ''
{'fraction_non_alphanumeric': 0.13407990314769977, 'fraction_numerical': 0.011198547215496369, 'mean_word_length': 2.180943214629451, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '631206', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1152, 'n_words': 287}