nixpkgs/nixos/lib
aszlig f148c5c4a1
nixos/tests: Fix QEMU flags for SCSI disks
The ability to specify "-drive if=scsi" has been removed in QEMU version
2.12 (introduced in 3e3b39f173).

Quote from https://wiki.qemu.org/ChangeLog/2.12#Incompatible_changes:

> The deprecated way of configuring SCSI devices with "-drive if=scsi"
> on x86 has been removed. Use an appropriate SCSI controller together
> "-device scsi-hd" or "-device scsi-cd" and a corresponding "-blockdev"
> parameter instead.

So whenever the diskInterface is "scsi" we use the new way to specify
the drive and fall back to the deprecated way for the time being. The
reason why I'm not using the new way for "virtio" and "ide" as well is
because there is no simple generic way anymore to specify these.

This also turns the type of the virtualisation.qemu.diskInterface option
to be an enum, so the user knows which values are allowed but we can
also make sure the right value is provided to prevent typos.

I've tested this against a few non-disk-related NixOS VM tests but also
the installer.grub1 test (because it uses "ide" as its drive interface),
the installer.simple test (just to be sure it still works with
"virtio") and all the tests in nixos/tests/boot.nix.

In order to be able to run the grub1 test I had to go back to
8b1cf100cd (which is a known commit where
that test still works) and apply the QEMU update and this very commit,
because right now the test is broken.

Apart from the tests here in nixpkgs, I also ran another[1] test in
another repository which uses the "scsi" disk interface as well (in
comparison to most of the installer tests, this one actually failed
prior to this commit).

All of them now succeed.

[1]: 9b5a119972/tests/system/kernel/bfq.nix

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @edostra, @grahamc, @dezgeg, @abbradar, @ts468
2018-04-30 03:02:59 +02:00
..
test-driver nixos/tests: Fix QEMU flags for SCSI disks 2018-04-30 03:02:59 +02:00
testing jquery & jquery-ui: Move to nixos/lib/testing/ 2018-02-27 20:07:35 +08:00
build-vms.nix nixos/networking-interfaces: rename IP addresses/routes options 2018-02-17 14:01:24 +01:00
eval-config.nix nixpkgs module: Clean up platform options 2018-04-06 12:41:44 -04:00
from-env.nix Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
make-channel.nix Unify NixOS and Nixpkgs channel structure 2015-08-05 17:37:11 +02:00
make-disk-image.nix Fix installing the Nixpkgs channel on the installation media 2018-02-27 19:58:23 +01:00
make-ext4-fs.nix nixos/make-ext4-fs: Use closureInfo 2018-04-10 00:31:36 +03:00
make-iso9660-image.nix ISO images: Initialize the Nix database with correct NAR hashes/sizes 2018-02-07 16:54:23 +01:00
make-iso9660-image.sh ISO images: Initialize the Nix database with correct NAR hashes/sizes 2018-02-07 16:54:23 +01:00
make-squashfs.nix ISO images: Initialize the Nix database with correct NAR hashes/sizes 2018-02-07 16:54:23 +01:00
make-system-tarball.nix make-system-tarball: allow alternate compression methods 2018-04-03 11:30:43 -03:00
make-system-tarball.sh make-system-tarball: allow alternate compression methods 2018-04-03 11:30:43 -03:00
qemu-flags.nix treewide: isArm -> isAarch32 2018-04-25 15:28:55 -04:00
testing.nix nixos testing: significantly reduce deps needed for OCR tests 2018-03-31 00:24:15 -05:00
utils.nix nixos: generalize copy-paste from stage-1 and zfs to utils 2016-08-23 18:14:06 +00:00