summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-09-17 23:47:33 +0200
committeraszlig <aszlig@redmoonstudios.org>2015-09-21 22:32:13 +0200
commit9a39c2e9434b848175a8763c9d5a5f544603e16d (patch)
tree507794d76b8fe9b07bb5a46c39550859faa2b214 /nixos
parent030fa33958461a153411fc236594201a99df21fd (diff)
downloadnixlib-9a39c2e9434b848175a8763c9d5a5f544603e16d.tar
nixlib-9a39c2e9434b848175a8763c9d5a5f544603e16d.tar.gz
nixlib-9a39c2e9434b848175a8763c9d5a5f544603e16d.tar.bz2
nixlib-9a39c2e9434b848175a8763c9d5a5f544603e16d.tar.lz
nixlib-9a39c2e9434b848175a8763c9d5a5f544603e16d.tar.xz
nixlib-9a39c2e9434b848175a8763c9d5a5f544603e16d.tar.zst
nixlib-9a39c2e9434b848175a8763c9d5a5f544603e16d.zip
tests/virtualbox: Add a subtest for host USB.
Unfortunately, we can't test whether USB is really working, but we can
make sure that VirtualBox has access to the USB devices.

This is essentially testing #9736, which I haven't yet been able to
reproduce though, but it makes sense to test it so it won't happen in
future releases.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/virtualbox.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix
index 1a5a6f7b5bbc..728d46d446ea 100644
--- a/nixos/tests/virtualbox.nix
+++ b/nixos/tests/virtualbox.nix
@@ -389,6 +389,21 @@ in {
 
     destroyVM_simple;
 
+    sub removeUUIDs {
+      return join("\n", grep { $_ !~ /^UUID:/ } split(/\n/, $_[0]))."\n";
+    }
+
+    subtest "host-usb-permissions", sub {
+      my $userUSB = removeUUIDs vbm("list usbhost");
+      print STDERR $userUSB;
+      my $rootUSB = removeUUIDs $machine->succeed("VBoxManage list usbhost");
+      print STDERR $rootUSB;
+
+      die "USB host devices differ for root and normal user"
+        if $userUSB ne $rootUSB;
+      die "No USB host devices found" if $userUSB =~ /<none>/;
+    };
+
     subtest "systemd-detect-virt", sub {
       createVM_detectvirt;
       vbm("startvm detectvirt");