#6 Add CI tests using the standard test interface
Opened 6 years ago by sturivny. Modified 6 years ago
git://fedorapeople.org/~sturivny/docker add-tests  into  f28

No commits found

no initial comment

Justification

Adds tests according to the CI wiki specifically the standard test interface in the spec.

The playbook includes Tier1 level test cases that have been tested in the following contexts and is passing reliably: Classic and Container. Test logs are stored in the artifacts directory.

The following steps are used to execute the tests using the standard test interface:


Test environment

Make sure you have installed packages from the spec

$ rpm -q ansible python2-dnf libselinux-python standard-test-roles
ansible-2.3.2.0-1.fc26.noarch
python2-dnf-2.6.3-11.fc26.noarch
libselinux-python-2.6-7.fc26.x86_64
standard-test-roles-2.4-1.fc26.noarch



Clone tests to your PC

$ git clone git://fedorapeople.org/~sturivny/docker
$ cd docker/



Run tests for Classic

All test should be run under the root

# ansible-playbook --tags=container tests.yml

Snip of the example test run:

TASK [autotest-installed : autotest-docker | custom config] ************************************************************************************************************
ok: [localhost] => (item=control.ini)
changed: [localhost] => (item=defaults.ini)
ok: [localhost] => (item=tests.ini)

TASK [autotest-installed : start docker] *******************************************************************************************************************************
ok: [localhost]

TASK [Run test] ********************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 1, "stderr": "", "stdout": "", "stdout_lines": []}

TASK [Pull out logs] ***************************************************************************************************************************************************
changed: [localhost] => (item={u'localname': u'test.log', u'remote_path': u'test.log'})
changed: [localhost] => (item={u'localname': u'test.debug.log', u'remote_path': u'results/default/debug/client.DEBUG'})
        to retry, use: --limit @/home/fedora/docker/tests.retry

PLAY RECAP *************************************************************************************************************************************************************
localhost                  : ok=10   changed=3    unreachable=0    failed=1   



Run tests for Atomic Host

All test should be run under the root

# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
# curl -Lo atomic.qcow2 https://ci.centos.org/artifacts/fedora-atomic/f27/images/latest-atomic.qcow2
# export TEST_SUBJECTS=$PWD/atomic.qcow2
# ansible-playbook --tags=atomic tests.yml

Snip of the example test run:

TASK [autotest-installed : start docker] *********************************************************************************************************************************************
ok: [/home/fedora/atomic.qcow2]

TASK [Run test] **********************************************************************************************************************************************************************
changed: [/home/fedora/atomic.qcow2]

TASK [Pull out logs] *****************************************************************************************************************************************************************
changed: [/home/fedora/atomic.qcow2] => (item={u'localname': u'test.log', u'remote_path': u'test.log'})
changed: [/home/fedora/atomic.qcow2] => (item={u'localname': u'test.debug.log', u'remote_path': u'results/default/debug/client.DEBUG'})

PLAY RECAP ***************************************************************************************************************************************************************************
/home/fedora/atomic.qcow2  : ok=12   changed=5    unreachable=0    failed=0



Notes

Tests will be enabled in CI, yet gating is currently disabled, so nothing will change. Tests will run on each dist-git commit, they are not triggered by koji builds and if you are using FMN, it should notify you of failures normally.

The RH QE maintainer contact in case you have questions: Eduardo Santiago (santiago)
The idea is that these tests become yours just as you're maintaining the package, there will, of course, be people around if you have questions or troubles.

Metadata