anchor.diff:            ../modules/testing/test-instrumentation.nix
             { key = "serial"; 
               boot.kernelParams = [ "console=tty1" "console=ttyS0" ];
  -            boot.loader.grub.timeout = pkgs.lib.mkOverride 0 {} 0; 
  +            boot.loader.grub.timeout = pkgs.lib.mkOverride 0 {} 0;
  +            # The test cannot access the network, so any sources we
  +            # need must be included in the ISO.
  +            isoImage.storeContents = [ pkgs.hello.src ];
             }
           ];
       }).config.system.build.isoImage;
   
  +  # The test script boots the CD, installs NixOS on an empty hard
  +  # disk, and then reboot from the hard disk.
     testScript =
       ''
         createDisk("harddisk", 4 * 1024);
  
positive.code:       $machine->waitForJob("tty1");
        $machine->waitForJob("rogue");
        $machine->waitForJob("nixos-manual");
  
        # Partition the disk.
        $machine->mustSucceed(
  
negative.code:           "mount LABEL=nixos /mnt",
        );
  
        # Create a NixOS configuration.
        $machine->mustSucceed(
            "mkdir -p /mnt/etc/nixos",
            "nixos-hardware-scan > /mnt/etc/nixos/hardware.nix",
        );
  
        my $cfg = $machine->mustSucceed("cat /mnt/etc/nixos/hardware.nix");
        print STDERR "Result of the hardware scan:$cfg\n";
  
        $machine->shutdown;
  
        # Now see if we can boot the installation.
  