summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/basic.py5
-rwxr-xr-xtests/create.py8
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/basic.py b/tests/basic.py
index a4ff4c4..b6f8831 100755
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -1,6 +1,11 @@
#!/usr/bin/python -u
import libvirt
import sys
+import os
+
+if not os.access("/proc/xen", os.R_OK):
+ print 'System is not running a Xen kernel'
+ sys.exit(1)
conn = libvirt.openReadOnly(None)
if conn == None:
diff --git a/tests/create.py b/tests/create.py
index 6ef415a..d2823c8 100755
--- a/tests/create.py
+++ b/tests/create.py
@@ -4,6 +4,10 @@ import sys
import os
import time
+if not os.access("/proc/xen", os.R_OK):
+ print 'System is not running a Xen kernel'
+ sys.exit(1)
+
#
# Try to provide default OS images paths here, of course non standard
#
@@ -23,10 +27,6 @@ if osroot == None:
print "Could not find a guest OS root, edit to add the path in osroots"
sys.exit(1)
-if not os.access("/proc/xen", os.R_OK):
- print 'System is not running a Xen kernel'
- sys.exit(1)
-
kernel=open("/proc/version").read().split()
kernelOv = kernel[2]
kernelU = "/boot/vmlinuz-" + kernelOv.replace('hypervisor', 'guest')