Browse Source

run-tests: Script for running tests in repo

Currently additional steps are needed (those have to be done manually):
- allow writing to /var/lib/qubes
- copy /etc/qubes/storage.conf
Wojtek Porczyk 8 years ago
parent
commit
341bbb4ef3
6 changed files with 27 additions and 2 deletions
  1. 1 0
      .gitignore
  2. 10 0
      run-tests
  3. 0 1
      site-packages-qmemman/qubes
  4. 0 1
      site-packages/qubes
  5. 1 0
      test-packages/.gitignore
  6. 15 0
      test-packages/libvirt.py

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 rpm/
 pkgs/
+qubes.egg-info/
 .coverage
 .coverage.*
 htmlcov/

+ 10 - 0
run-tests

@@ -0,0 +1,10 @@
+#!/bin/sh
+
+: "${PYTHON:=python}"
+: "${TESTPYTHONPATH:=test-packages}"
+
+PYTHONPATH="${TESTPYTHONPATH}:${PYTHONPATH}"
+export PYTHONPATH
+
+"${PYTHON}" setup.py egg_info --egg-base "${TESTPYTHONPATH}"
+"${PYTHON}" -m qubes.tests.run

+ 0 - 1
site-packages-qmemman/qubes

@@ -1 +0,0 @@
-../qmemman

+ 0 - 1
site-packages/qubes

@@ -1 +0,0 @@
-../core

+ 1 - 0
test-packages/.gitignore

@@ -0,0 +1 @@
+qubes.egg-info/

+ 15 - 0
test-packages/libvirt.py

@@ -0,0 +1,15 @@
+"""mock libvirt module
+
+WARNING: you did not import real libvirt module
+
+This is needed, because we don't currently ship libvirt-python for templates.
+The module contains libvirtError and openReadOnly() function, which
+does nothing and raises the aforementioned exception. More functions can be
+added as needed.
+"""
+
+class libvirtError(Exception):
+    pass
+
+def openReadOnly(*args, **kwargs):
+    raise libvirtError('mock module, always raises')