diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-06-07 11:44:24 +0200 |
---|---|---|
committer | Marco Capitani <m.capitani@nextworks.it> | 2017-06-07 11:44:24 +0200 |
commit | 8432191cf9ed370aaf2a2e9792b546202dae0d07 (patch) | |
tree | ce781ee036c6c5675779dfa9dc60cc102e968a18 | |
parent | d62b0595ab660d6c23ab24bd94cd79453f0129ff (diff) | |
download | rumba-8432191cf9ed370aaf2a2e9792b546202dae0d07.tar.gz rumba-8432191cf9ed370aaf2a2e9792b546202dae0d07.zip |
qemu: fix for devices permission
-rw-r--r-- | rumba/testbeds/qemu.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py index b7ebef9..df02ab6 100644 --- a/rumba/testbeds/qemu.py +++ b/rumba/testbeds/qemu.py @@ -111,6 +111,13 @@ class Testbed(mod.Testbed): if os.geteuid() != 0: try: subprocess.check_call(["sudo", "-v"]) + if not os.access("/dev/vhost-net", os.R_OK) \ + or not os.access("/dev/vhost-net", os.W_OK) \ + or not os.access("/dev/kvm", os.R_OK) \ + or not os.access("/dev/kvm", os.W_OK): + raise Exception('Cannot open vhost device. Make sure it is' + 'available and you have rw permissions ' + 'on /dev/vhost-net') except subprocess.CalledProcessError: raise Exception('Not authenticated') |