summary refs log tree commit diff
path: root/nixos/tests/udisks2.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-04-30 00:21:36 +0200
committeraszlig <aszlig@nix.build>2018-04-30 03:02:57 +0200
commit1907120f23ada097ccf00ba8ac040097c911e9e6 (patch)
treee0a1f732ef598513c508aefb673ed8e49ce12f76 /nixos/tests/udisks2.nix
parent81c705ad9937b66917835fbde9d2ab99e4cd7ff3 (diff)
downloadnixpkgs-1907120f23ada097ccf00ba8ac040097c911e9e6.tar
nixpkgs-1907120f23ada097ccf00ba8ac040097c911e9e6.tar.gz
nixpkgs-1907120f23ada097ccf00ba8ac040097c911e9e6.tar.bz2
nixpkgs-1907120f23ada097ccf00ba8ac040097c911e9e6.tar.lz
nixpkgs-1907120f23ada097ccf00ba8ac040097c911e9e6.tar.xz
nixpkgs-1907120f23ada097ccf00ba8ac040097c911e9e6.tar.zst
nixpkgs-1907120f23ada097ccf00ba8ac040097c911e9e6.zip
nixos/tests/udisks2: Fix USB device hotplug
The usb_add and usb_del monitor commands have been removed in QEMU
version 2.12 (introduced in 3e3b39f173f9abc99da84084a1f4657c9de885bd).

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

> The deprecated HMP commands "usb_add" and "usb_del" have been removed.
> Use "device_add" and "device_del" as replacement instead.

So we're doing exactly that and the udisks2 test now works again.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @edolstra
Diffstat (limited to 'nixos/tests/udisks2.nix')
-rw-r--r--nixos/tests/udisks2.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/tests/udisks2.nix b/nixos/tests/udisks2.nix
index 72d51c0051c..70a999267a5 100644
--- a/nixos/tests/udisks2.nix
+++ b/nixos/tests/udisks2.nix
@@ -37,7 +37,8 @@ in
       $machine->fail("udisksctl info -b /dev/sda1");
 
       # Attach a USB stick and wait for it to show up.
-      $machine->sendMonitorCommand("usb_add disk:$stick");
+      $machine->sendMonitorCommand("drive_add 0 id=stick,if=none,file=$stick,format=raw");
+      $machine->sendMonitorCommand("device_add usb-storage,id=stick,drive=stick");
       $machine->waitUntilSucceeds("udisksctl info -b /dev/sda1");
       $machine->succeed("udisksctl info -b /dev/sda1 | grep 'IdLabel:.*USBSTICK'");
 
@@ -52,7 +53,7 @@ in
       $machine->fail("[ -d /run/media/alice/USBSTICK ]");
 
       # Remove the USB stick.
-      $machine->sendMonitorCommand("usb_del 0.3"); # FIXME
+      $machine->sendMonitorCommand("device_del stick");
       $machine->waitUntilFails("udisksctl info -b /dev/sda1");
       $machine->fail("[ -e /dev/sda ]");
     '';