From 341bbb4ef365af7141e13b83f23b7df9cd4c479a Mon Sep 17 00:00:00 2001 From: Wojtek Porczyk Date: Tue, 19 Apr 2016 15:57:08 +0200 Subject: [PATCH] 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 --- .gitignore | 1 + run-tests | 10 ++++++++++ site-packages-qmemman/qubes | 1 - site-packages/qubes | 1 - test-packages/.gitignore | 1 + test-packages/libvirt.py | 15 +++++++++++++++ 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 run-tests delete mode 120000 site-packages-qmemman/qubes delete mode 120000 site-packages/qubes create mode 100644 test-packages/.gitignore create mode 100644 test-packages/libvirt.py diff --git a/.gitignore b/.gitignore index 602bc629..2cb9c2fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ rpm/ pkgs/ +qubes.egg-info/ .coverage .coverage.* htmlcov/ diff --git a/run-tests b/run-tests new file mode 100755 index 00000000..e6fc8a03 --- /dev/null +++ b/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 diff --git a/site-packages-qmemman/qubes b/site-packages-qmemman/qubes deleted file mode 120000 index e86ad82b..00000000 --- a/site-packages-qmemman/qubes +++ /dev/null @@ -1 +0,0 @@ -../qmemman \ No newline at end of file diff --git a/site-packages/qubes b/site-packages/qubes deleted file mode 120000 index c73d9e17..00000000 --- a/site-packages/qubes +++ /dev/null @@ -1 +0,0 @@ -../core \ No newline at end of file diff --git a/test-packages/.gitignore b/test-packages/.gitignore new file mode 100644 index 00000000..a9edb3e6 --- /dev/null +++ b/test-packages/.gitignore @@ -0,0 +1 @@ +qubes.egg-info/ diff --git a/test-packages/libvirt.py b/test-packages/libvirt.py new file mode 100644 index 00000000..4c850656 --- /dev/null +++ b/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')