From Fedora Project Wiki

< CI

Revision as of 11:37, 24 January 2018 by Sturivny (talk | contribs) (add FAQ)



Preconditions

To start working with a test you need Fedora installed on your PC or VM.

Change user to root:

$ sudo -s

Install necessary packages:

# dnf install git
# dnf install ansible python2-dnf libselinux-python standard-test-roles


Get tests (pull request src.fedoraproject.org)

Navigate to the https://src.fedoraproject.org/rpms/elfutils
Navigate to the Pull Requests tab:

Pull Request tab


























Select Pull Request you would like to download

Pull Request tab

On the Pull Request tab find source of the code you would like do download

Source code

Copy this string to the clipboard and execute the following commands in the terminal.
For this particular case:

# git clone git://fedorapeople.org/~sturivny/elfutils
# cd elfutils/tests/

Get tests (Upstream First repository)

Navigate to the https://upstreamfirst.fedorainfracloud.org/ and choose any package you like to run.

For example elfutils

Navigate to the page with tests: https://upstreamfirst.fedorainfracloud.org/elfutils

Copy Source GIT URL

Source GIT URL

Navigate to you VM or laptop command line and clone this package:

# git clone https://upstreamfirst.fedorainfracloud.org/elfutils.git
# cd elfutils

Check tags that you have. Execute command:

# ansible-playbook --list-tags tests.yml

The output will be something like tis:

List of tags















It means that we have container, atomic, classic tags So we can run our tests for each of them.

Run classic (local) tests

Now we are ready for running tests on our laptop. Execute command:

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

This command will run all package's tests. And the result will be:

Classic tests result























Run Container (docker) tests

To run tests in Docker container we need to export environment variables in the first place:

# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
# export TEST_SUBJECTS=docker:docker.io/library/fedora:26

Let's check that all variables were setup.
Execute command:

printenv | grep -E "ANSIBLE_INVENTORY|TEST_SUBJECTS"

The output should be:

Environment variables








Now we are ready for running tests in Docker container. Execute command:

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


Run Atomic Host tests

To run tests in Docker container we need to export environment variables in the first place:

# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
# curl -Lo atomic.qcow2 https://ftp-stud.hs-esslingen.de/pub/Mirrors/alt.fedoraproject.org/atomic/stable/Fedora-Atomic-26-20170707.1/CloudImages/x86_64/images/Fedora-Atomic-26-20170707.1.x86_64.qcow2
# export TEST_SUBJECTS=$PWD/atomic.qcow2

Let's check that all variables were setup.
Execute command:

printenv | grep -E "ANSIBLE_INVENTORY|TEST_SUBJECTS"

The output should be:

Environment variables








Now we are ready for running tests in Atomic Host VM. Execute command:

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

"""FAQ"""

"""Where can I find logs after tests have been exequted?"""