You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcpcfg/t
Alexander Lutay 051f27f03e
TT#24920 Introduce 'ngcpcfg patch --from-customtt' for initial import
8 years ago
..
fixtures TT#26206 Provide tests for 'ngcpcfg patch' action 8 years ago
sources.list.d TT#21905 Fix c945aba: update building instruction (no need to rebuild image) 8 years ago
Dockerfile TT#29456 Add more perl modules to ngcpcfg-stretch docker 8 years ago
README.adoc TT#26206 Provide README for working with tests 8 years ago
conftest.py TT#17600 pytest: import fixtures as plugins instead of importing them 9 years ago
default-git-repository.tar.gz MT#16391 Initial tests using pytest 9 years ago
pytest.ini MT#16391 Initial tests using pytest 9 years ago
test_git.py MT#16391 Initial tests using pytest 9 years ago
test_ngcpcfg.py TT#17401 Fail if destination file matches an existing directory 9 years ago
test_ngcpcfg_lib_get_all_ips.py TT#16316 lib: add status param 9 years ago
test_ngcpcfg_lib_status.py TT#16316 lib: add status param 9 years ago
test_ngcpcfg_patch.py TT#24920 Introduce 'ngcpcfg patch --from-customtt' for initial import 8 years ago
test_ngcpcfg_set_and_del.py TT#17650 Switch to use YAML::XS instead of YAML::Tiny 9 years ago
testrunner MT#16391 Initial tests using pytest 9 years ago

README.adoc

README
======

Purpose of this directory
-------------------------

This directory provides system tests for ngcpcfg, using pytest (a mature full-featured Python testing tool).

Tips for working with tests
---------------------------

If you're working on a new feature, try to simulate a specific behavior, or need to run ngcpcfg for any other reason,
you might need to run ngcpcfg with a certain environment.
This can be achieved by injecting according environment variables to ngcpcfg.
The following command line provides an example invocation:

[source,bash]
cd t # we're assuming in the following command line that you're inside this testing folder
HELPER=../helper CONFIG_POOL=/etc/ NGCPCFG=./fixtures/ngcpcfg.cfg SCRIPTS=../scripts/ FUNCTIONS=../functions/ \
NGCP_BASE_TT2=/tmp/pytest-of-root/pytest-XX/test_YYY/ NGCP_PORTFILE=/tmp/ngcpcfg.port OUTPUT_DIRECTORY=/tmp/  \
TEMPLATE_POOL_BASE=/tmp/pytest-of-root/pytest-XX/test_YYY ../sbin/ngcpcfg [...]

Test runs
----------

It's recommended to run the tests inside a docker container (see Dockerfile for usage instructions).
Running all available tests from inside the ``t`` directory then is as simple as:

[source,bash]
py.test-3 -v

To run only the tests matching 'test_patch_action' execute:

[source,bash]
py.test-3 -v  -k test_patch_action