diff --git a/test/block-001-list-attach-use-detach b/test/block-001-list-attach-use-detach new file mode 100755 index 0000000..ec52a18 --- /dev/null +++ b/test/block-001-list-attach-use-detach @@ -0,0 +1,50 @@ +#!/bin/sh + +tmpf=`mktemp` + +## === List +echo 'qvm-block -l' +qvm-block -l > $tmpf + +cat <<'END' | diff -u $tmpf - +netvm:sda STORAGE_DEVICE () 0 B +dom0:sdb1 Cruzer () 3 GiB +dom0:sdb Cruzer () 3 GiB +END + +## === Attach +echo 'qvm-block -a' +qvm-block -a work dom0:sdb | diff -u /dev/null - + +## === List again +echo 'qvm-block -l' +qvm-block -l > $tmpf + +cat <<'END' | diff -u $tmpf - +netvm:sda STORAGE_DEVICE () 0 B +dom0:sdb1 Cruzer () 3 GiB +dom0:sdb Cruzer () 3 GiB (attached to 'work' as 'xvdi') +END + +## === Use +echo 'qvm-run work fdisk' +qvm-run -qp work 'su - root -c "fdisk -l /dev/xvdi"' > $tmpf + +cat <<'END' | diff -u $tmpf - + +Disk /dev/xvdi: 4022 MB, 4022337024 bytes +124 heads, 62 sectors/track, 1021 cylinders, total 7856127 sectors +Units = sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disk identifier: 0x3963a77b + + Device Boot Start End Blocks Id System +/dev/xvdi1 * 62 7849447 3924693 c W95 FAT32 (LBA) +END + +## === Detach +echo 'qvm-block -d' +qvm-block -d work dom0:sdb1 | diff -u /dev/null - + +rm $tmpf diff --git a/test/pvusb-001-mouse-kbd-attached b/test/pvusb-001-mouse-kbd-attached new file mode 100755 index 0000000..8011b64 --- /dev/null +++ b/test/pvusb-001-mouse-kbd-attached @@ -0,0 +1,14 @@ +#!/bin/sh + +tmpf=`mktemp` + +sudo xenstore-ls -f qubes-usb-devices | sort > $tmpf + +cat << 'END' | diff -u $tmpf - +qubes-usb-devices/045e_0745 = "" +qubes-usb-devices/045e_0745/desc = "045e_0745 Microsoft_Microsoft\xc2\xae_Nano_Transceiver_v1.0" +qubes-usb-devices/046a_0021 = "" +qubes-usb-devices/046a_0021/desc = "046a_0021 046a_0021" +END + +rm $tmpf diff --git a/test/pvusb-002-mouse-kbd-usbstick-wlan-attached b/test/pvusb-002-mouse-kbd-usbstick-wlan-attached new file mode 100755 index 0000000..66b78aa --- /dev/null +++ b/test/pvusb-002-mouse-kbd-usbstick-wlan-attached @@ -0,0 +1,18 @@ +#!/bin/sh + +tmpf=`mktemp` + +sudo xenstore-ls -f qubes-usb-devices | sort > $tmpf + +cat << 'END' | diff -u $tmpf - +qubes-usb-devices/045e_0745 = "" +qubes-usb-devices/045e_0745/desc = "045e_0745 Microsoft_Microsoft\xc2\xae_Nano_Transceiver_v1.0" +qubes-usb-devices/046a_0021 = "" +qubes-usb-devices/046a_0021/desc = "046a_0021 046a_0021" +qubes-usb-devices/0781_5406 = "" +qubes-usb-devices/0781_5406/desc = "0781_5406 SanDisk_U3_Cruzer_Micro_4528400C7A43627E" +qubes-usb-devices/07d1_3c0a = "" +qubes-usb-devices/07d1_3c0a/desc = "07d1_3c0a Ralink_11n_Adapter_1.0" +END + +rm $tmpf