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 3e3b39f173
).
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
This commit is contained in:
parent
81c705ad99
commit
1907120f23
|
@ -37,7 +37,8 @@ in
|
||||||
$machine->fail("udisksctl info -b /dev/sda1");
|
$machine->fail("udisksctl info -b /dev/sda1");
|
||||||
|
|
||||||
# Attach a USB stick and wait for it to show up.
|
# 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->waitUntilSucceeds("udisksctl info -b /dev/sda1");
|
||||||
$machine->succeed("udisksctl info -b /dev/sda1 | grep 'IdLabel:.*USBSTICK'");
|
$machine->succeed("udisksctl info -b /dev/sda1 | grep 'IdLabel:.*USBSTICK'");
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ in
|
||||||
$machine->fail("[ -d /run/media/alice/USBSTICK ]");
|
$machine->fail("[ -d /run/media/alice/USBSTICK ]");
|
||||||
|
|
||||||
# Remove the USB stick.
|
# Remove the USB stick.
|
||||||
$machine->sendMonitorCommand("usb_del 0.3"); # FIXME
|
$machine->sendMonitorCommand("device_del stick");
|
||||||
$machine->waitUntilFails("udisksctl info -b /dev/sda1");
|
$machine->waitUntilFails("udisksctl info -b /dev/sda1");
|
||||||
$machine->fail("[ -e /dev/sda ]");
|
$machine->fail("[ -e /dev/sda ]");
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue