blob: 3e2bd3b5ce29ee63392ac41314b96433aa841927 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
Testing
=======
Tests must be run as root on machine with cimom broker.
There are number of environment variables, that affect test running:
``LMI_CIMOM_USERNAME``
``LMI_CIMOM_PASSWORD``
``LMI_CIMOM_BROKER``
``LMI_CIMOM_URL``
``LMI_RUN_DANGEROUS`` - valid values: 0, 1
``LMI_RUN_TEDIOUS`` - valid values: 0, 1
``LMI_SOFTWARE_DB_CACHE``
Where to store the file with information about generated testing
database. If not set, temporary file will be created and whole cache
will be removed after tests are complete. If set and the file does not
yet exist its created and user may choose if he wants to preserve
generated cache for another run (with ``LMI_SOFTWARE_CLEANUP_CACHE``).
If set and the file exists, database is reused, which speeds up the
intialization.
``LMI_SOFTWARE_CLEANUP_CACHE`` - valid values: 0, 1
Whether to preserve generated reposities and database file (cache) for
next runs to speed them up. Defaults to False.
``LMI_SOFTWARE_DB_CACHE`` must be set for this to have any effect.
Dependencies
------------
* @development-tools (rpmbuild, createrepo, yum-utils, etc.)
* unittest2 module must be installed on systems with Python < 2.7
Preparation
-----------
``lmi.test`` module must be on python path. The easiest way to get it there is
to export ``PYTHONPATH`` environment variable like this: ::
export PYTHONPATH="${PATH_TO_GIT_ROOT}/src/python"
Running tests
-------------
Each test module can be run as a stand-alone script or with run.py script: ::
./run.py
To pass any arguments to underlying ``unittest.main()`` function, append them
after "--" swith like this: ::
./run.py -- -v TestSoftwarePackage
All environment variables defined above can be overriden by command-line
arguments. See help message of ``run.py`` script.
|