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
This commit is contained in:
Wojtek Porczyk 2016-04-19 15:57:08 +02:00
parent adbca5c0f6
commit 341bbb4ef3
6 changed files with 27 additions and 2 deletions

1
.gitignore vendored
View File

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

10
run-tests Executable file
View File

@ -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

View File

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

View File

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

1
test-packages/.gitignore vendored Normal file
View File

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

15
test-packages/libvirt.py Normal file
View File

@ -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')