From: Alexander Todorov <atodorov(a)redhat.com>
---
.gitignore | 1 +
docs/Makefile.am | 2 ++
docs/conf.py | 6 ++++
docs/index.rst | 2 ++
docs/testing.rst | 1 +
tests/README.rst | 70 ++++++++++++++++++++++++++++++++++++++++++
tests/__init__.py | 0
tests/dd_tests/__init__.py | 0
tests/dracut_tests/__init__.py | 0
tests/gettext/__init__.py | 0
tests/glade/__init__.py | 0
tests/lib/__init__.py | 0
tests/regex_tests/__init__.py | 0
tests/storage/__init__.py | 0
14 files changed, 82 insertions(+)
create mode 100644 docs/testing.rst
create mode 100644 tests/README.rst
create mode 100644 tests/__init__.py
create mode 100644 tests/dd_tests/__init__.py
create mode 100644 tests/dracut_tests/__init__.py
create mode 100644 tests/gettext/__init__.py
create mode 100644 tests/glade/__init__.py
create mode 100644 tests/lib/__init__.py
create mode 100644 tests/regex_tests/__init__.py
create mode 100644 tests/storage/__init__.py
diff --git a/.gitignore b/.gitignore
index f42cf9f..7a5cee9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,3 +98,4 @@ _sources
.buildinfo
modules.rst
pyanaconda.*rst
+docs/tests/*.rst
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 67b85a3..297bed6 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -73,6 +73,8 @@ apidoc:
if [ -f /usr/bin/$(SPHINXAPIDOC) ]; then \
rm $(addprefix ./, $(MODULE_NAMES)) ; \
$(SPHINXAPIDOC) -o . $(SOURCEDIR) ; \
+ rm $(addprefix ./, tests/*.rst) ; \
+ $(SPHINXAPIDOC) -o ./tests ../tests ../tests/storage/run_storage_tests.py ; \
fi
html: apidoc
diff --git a/docs/conf.py b/docs/conf.py
index 3b90bd0..f7ac1c9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -21,6 +21,12 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
+# configuration required to import test modules
+for path in ["../pyanaconda/isys/.libs", "../pyanaconda",
"../tests", "../tests/lib", "../dracut",
"../widgets"]:
+ sys.path.append(os.path.abspath(path))
+if not 'ANACONDA_INSTALL_CLASSES' in os.environ:
+ os.environ['ANACONDA_INSTALL_CLASSES'] =
os.path.abspath('../pyanaconda/installclasses')
+
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
diff --git a/docs/index.rst b/docs/index.rst
index 4bf1ad2..b261f82 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -19,6 +19,8 @@ Contents:
iscsi
multipath
modules
+ testing
+ tests/modules
Indices and tables
==================
diff --git a/docs/testing.rst b/docs/testing.rst
new file mode 100644
index 0000000..7e7bbfc
--- /dev/null
+++ b/docs/testing.rst
@@ -0,0 +1 @@
+.. include:: ../tests/README.rst
diff --git a/tests/README.rst b/tests/README.rst
new file mode 100644
index 0000000..206f550
--- /dev/null
+++ b/tests/README.rst
@@ -0,0 +1,70 @@
+Testing Anaconda
+================
+
+Before testing Anaconda you need to install all required dependencies,
+prepare the environment and build the sources::
+
+ make -f Makefile.am install-test-requires
+ ./autogen.sh
+ ./configure
+ make
+
+Executing the tests can be done with::
+
+ make check
+
+To run a single test do::
+
+ make TESTS=install/run_install_test.sh check
+
+See `tests/Makefile.am` for possible values. Alternatively you can try::
+
+ make ci
+
+This has the advantage of producing Python test coverage for all tests.
+In case the *ci* target fails there is also a *coverage-report* target
+which can be used to combine the multiple `.coverage` files into one and
+produce a human readable report.
+
+Test Suite Architecture
+------------------------
+
+Anaconda has a complex test suite structure where each top-level directory
+represents a different class of tests. They are
+
+- *cppcheck/* - static C/C++ code analysis using the *cppcheck* tool;
+- *dd_tests/* - Python unit tests for driver disk utilities (utils/dd);
+- *dracut_tests/* - Python unit tests for the dracut hooks used to configure the
+ installation environment and load Anaconda;
+- *gettext/* - sanity tests of files used for translation; Written in Python and
+ Bash;
+- *glade/* - sanity tests for .glade files. Written in Python;
+- *gui/* - specialized test suite for the graphical interface of anaconda. This
+ is written in Python and uses the `dogtail <
https://fedorahosted.org/dogtail/>`_
+ accessibility module. All tests are executed inside a LiveCD;
+- *install/* - basic RPM sanity test. Checks if anaconda.rpm can be installed in
+ a temporary directory without failing dependencies or other RPM issues;
+- *kickstart_tests/* - each test is a kickstart file and a shell script. The
+ test runner provisions a virtual machine using boot.iso and a kickstart file.
+ A shell script then verifies installation was as expected;
+- *lib/* - helper modules used during testing;
+- *pyanaconda_tests/* - unit tests for the :mod:`pyanaconda` module;
+- *pylint/* - checks the validity of Python source code using the *pocketlint*
+ tool;
+- *regex_tests/* - Python unit tests for regular expressions defined in
+ :mod:`pyanaconda.regexes`;
+- *storage/* - test cases used to verify partitioning scenarios for success or
+ expected failures. The scenarios are described using kickstart snippets.
+ Written in Python with a custom test case framework based on
+ `blivet <
https://github.com/rhinstaller/blivet>`_;
+
+
+
+.. NOTE::
+
+ All Python unit tests inherit from the standard :class:`unittest.TestCase`
+ class unless specified otherwise!
+
+ Some tests require root privileges and will be skipped if running as regular
+ user!
+
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/dd_tests/__init__.py b/tests/dd_tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/dracut_tests/__init__.py b/tests/dracut_tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/gettext/__init__.py b/tests/gettext/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/glade/__init__.py b/tests/glade/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/regex_tests/__init__.py b/tests/regex_tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/storage/__init__.py b/tests/storage/__init__.py
new file mode 100644
index 0000000..e69de29
--
To view this commit on github, visit
https://github.com/rhinstaller/anaconda/commit/9216146aea8d275f10e3a04501...