- add pytest marks 'revert_snapshot' to all required fixtures instead
of reverting the snapshots inside them
- add get_top_fixtures_marks() that extracts all the marks
'revert_snapshot' from the test and it's fixtures, order the marks
in the same way as the fixtures depends on each other,
- in the fixture 'revert_snapshot' try to find the most suitable
snapshot for reverting, from latest to earliest.
- mark 'revert_snapshot' removed from system tests which use fixtures
with the same mark (for example, 'k8s_deployed' mark removed from
system tests where the fixture 'k8scluster' is used as a top fixture)
Change-Id: Iad9e56d96d870aa4204ba23e76a5b4df01d4385b
Co-Authored-By: Dmitry Tyzhnenko <dtyzhnenko@mirantis.com>
'hardware' snapshot will be reverted only if no 'revert_snapshot'
mark specified for test or if the specified in the mark snapshot
name not found in the environment.
If 'hardware' snapshot exists in the environment, then it won't
be created/overwritten with next test run.
Change-Id: I1c4837d7b7903c0234ff4f12763cda882289bce1
If @pytest.mark.revert_snapshot(name=<some_name>) is used for
test case, but the snapshot *or* it's config is missing in the
environment, then each fixture will try to revert the snapshot
that belongs to the fixture.
Change-Id: I819dba2e775f5be38ea8cd12c6909b2e7399e3a8
We have plugin for LVM usage in k8s, this patch adds basic test using
this plugin.
This test creates an environment (which should have extra storage),
installs required software to use LVM on nodes, uploads a plugin to
each node and then creates nginx pod using this plugin to create its
storage.
Sample command to run test:
ENV_NAME="lvm_usage"\
CONF_PATH=fuel_ccp_tests/templates/default-with-storage.yaml\
IMAGE_PATH=/path/to/image LVM_PLUGIN_PATH=/path/to/plugin/binary\
DEPLOY_SCRIPT=/path/to/fuel-ccp-installer/utils/jenkins/kargo_deploy.sh\
py.test -s fuel_ccp_tests/tests/system/test_k8s_lvm_plugin_usage.py
Change-Id: I0a31324e445902774f35b6cf2af1d9d43e74f53e
This patch adds basic test for AppController that was provided by
developers.
Test case:
1. Get AppController source on master node
2. Create AppController in k8s
3. Wait until pod with AppController is Running
4. Wait until required thirdparty resources are created
5. Create dependencies from test
6. Create definitions from test
7. Run AppController to create defined resources
8. Check if resources are created in expected order
This test could be run without environment creation via oslo.config:
TESTS_CONFIGS="/path/to/config.ini"
Sample run of this test (${fuel_ccp_installer} is path to
fuel-ccp-installer repo):
KARGO_COMMIT="kubednsrc"\
AC_COMMIT="simple-test-case"\
TESTS_CONFIGS="/path/to/config.ini"
py.test -k ac_linear_test
Change-Id: If2970f8f25d9d42c519a4a4e307b47548b882cee
Now 'underlay', 'k8scluster' or 'ccpcluster' can restore
a snapshot if the snapshot name was specified in the
pytest.mark.revert_snapshot(name=<str>).
Snapshot is reverted *only* if:
- name of the snapshot matches the name of the snapshot that
is created by fixture:
* 'underlay' fixture reverts only 'underlay' snapshot
* 'k8scluster' reverts only 'k8s_deployed' snapshot
* 'ccpcluster' reverts only 'ccp_deployed' snapshot
- snapshot actualy exists at the moment
If fixture made changes to the environment, it takes a snapshot
and stores current config to a file 'config_<snapshot_name>.ini'
Other changes:
- Removed 'initial' snapshot. It doesn't makes sense because
matches to the environment state 'never powered on yet'
- Add 'underlay' snapshot instead of 'initial', that stands for
ready Underlay layer (operation systems are provisioned and
configured)
- Move hardware.start() from 'hardware' fixture to 'underlay'
- Use for tests @pytest.mark.revert_snapshot with more suitable
snapshot names
Change-Id: I15ac734736563e3e40cd850adc49e1b4a070ae20
- K8sClient moved from ./models to ./managers
- all YAMLs placed to ./tests/fixtures/templates
- all tests placed to ./tests/ into separated folders depending
on tests types
- ssh_manager removed from helpers (unused)
- main folder 'mcp_tests' renamed to 'fuel_ccp_tests'
- conftest.py moved to the ./tests/system and ./tests/component
folder because of failed unit tests (we use fixtures with
autouse=True which fail unit tests).
- empty conftest.py added to the root of fuel_ccp_tests module
to get unit tests passed
Change-Id: I25671dd7d6f3ee294a4e4146f9f2c2ba4d9b2d06