(Add obsoletion warning) |
|||
(22 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
===Preconditions=== | |||
{{admon/important|Obsoleted Content|This page has been obsoleted by the [https://docs.fedoraproject.org/en-US/ci/quick-start-guide/ Quick Start Guide].}} | |||
<br/> | |||
<br/> | |||
==='''Preconditions'''=== | |||
To start working with a test you need Fedora installed on your PC or VM. | To start working with a test you need Fedora installed on your PC or VM. | ||
Line 15: | Line 20: | ||
</pre> | </pre> | ||
===Get tests=== | <br/> | ||
==='''Get tests''' (pull request src.fedoraproject.org)=== | |||
Navigate to the https://src.fedoraproject.org/rpms/elfutils <br /> | |||
Navigate to the '''Pull Requests''' tab: <br /> | |||
[[File:Selection 008.png|frame|left|Pull Request tab]] | |||
<br/><br/><br/><br/><br/><br/><br/> | |||
<br/><br/><br/><br/><br/><br/><br/> | |||
<br/><br/><br/><br/><br/><br/><br/> | |||
<br/><br/><br/><br/> | |||
Select Pull Request you would like to download <br/> | |||
[[File:Selection 009.png|frame|left|Pull Request tab]] | |||
On the Pull Request tab find source of the code you would like do download <br/> | |||
[[File:Selection 010.png|frame|left|Source code]] | |||
Copy this string to the clipboard and execute the following commands in the terminal. <br/> | |||
For this particular case: | |||
<pre> | |||
# git clone git://fedorapeople.org/~sturivny/elfutils | |||
# cd elfutils/tests/ | |||
</pre> | |||
==='''Get tests''' (Upstream First repository)=== | |||
Navigate to the https://upstreamfirst.fedorainfracloud.org/ and choose any package you like to run.<br /> | Navigate to the https://upstreamfirst.fedorainfracloud.org/ and choose any package you like to run.<br /> | ||
Line 39: | Line 69: | ||
[[File:Selection 002.png|frame|left|List of tags]] | [[File:Selection 002.png|frame|left|List of tags]] | ||
<br/><br/><br/><br/><br/><br/><br/> | <br/><br/><br/><br/><br/><br/><br/> | ||
<br/><br/><br/><br/><br/><br/><br/> | |||
It means that we have <code>container, atomic, classic</code> tags | It means that we have <code>container, atomic, classic</code> tags | ||
So we can run our tests for each of them. | So we can run our tests for each of them. | ||
<br/> | |||
===Run classic (local) tests=== | ==='''Run classic (local) tests'''=== | ||
Now we are ready for running tests on our laptop. | Now we are ready for running tests on our laptop. | ||
Execute command: | Execute command: | ||
Line 54: | Line 85: | ||
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> | <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> | ||
===Run Container (docker) tests=== | ==='''Run Container (docker) tests'''=== | ||
To run tests in Docker container we need to export environment variables in the first place: | To run tests in Docker container we need to export environment variables in the first place: | ||
Line 61: | Line 92: | ||
# export TEST_SUBJECTS=docker:docker.io/library/fedora:26 | # export TEST_SUBJECTS=docker:docker.io/library/fedora:26 | ||
</pre> | </pre> | ||
Let's | Let's check that all variables were setup.<br/> | ||
Execute command:<br/> | |||
<pre> | |||
printenv | grep -E "ANSIBLE_INVENTORY|TEST_SUBJECTS" | |||
</pre> | |||
The output should be:<br/> | |||
[[File:Selection 004.png|frame|left|Environment variables]] <br/> | [[File:Selection 004.png|frame|left|Environment variables]] <br/> | ||
<br/><br/><br/><br/><br/><br/> | |||
Now we are ready for running tests in Docker container. | Now we are ready for running tests in Docker container. | ||
Execute command: | Execute command: | ||
Line 69: | Line 108: | ||
# ansible-playbook --tags=container tests.yml | # ansible-playbook --tags=container tests.yml | ||
</pre> | </pre> | ||
<br /> | |||
==='''Run Atomic Host tests'''=== | |||
To run tests in Docker container we need to export environment variables in the first place: | |||
<pre> | |||
# 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 | |||
</pre> | |||
Let's check that all variables were setup.<br/> | |||
Execute command:<br/> | |||
<pre> | |||
printenv | grep -E "ANSIBLE_INVENTORY|TEST_SUBJECTS" | |||
</pre> | |||
The output should be:<br/> | |||
[[File:Selection 007.png|frame|left|Environment variables]] <br/> | |||
<br/><br/><br/><br/><br/><br/> | |||
Now we are ready for running tests in Atomic Host VM. | |||
Execute command: | |||
<pre> | |||
# ansible-playbook --tags=atomic tests.yml | |||
</pre> | |||
==='''FAQ'''=== | |||
<br/> | |||
===='''How can I get list of tags?'''==== | |||
Yuo can gat list of tags executing <code>ansible-playbook --list-tags tests.yml</code> command | |||
<br/> | |||
===='''Localhost: Where can I find test logs?'''==== | |||
You can find logs in tests folder in <code>artifacts/</code>, <code>/tmp</code> or in the <code>/var/tmp</code> folders | |||
<br/> | |||
===='''Container: Where can I find test logs?'''==== | |||
You can find logs in tests folder in <code>/usr/local/bin/</code> folder | |||
<br/> | |||
===='''Atomic: Where can I find test logs?'''==== | |||
You can find logs in tests folder in <code>/usr/local/bin/</code> folder | |||
<br/> | |||
===='''Atomic: How to install new package?'''==== | |||
You can easelly instal new package executing folowing command <code>rpm-ostree install <package name> && rpm-ostree ex livefs</code> folder | |||
<br/> | |||
===='''How can I get VM pid?'''==== | |||
Yuo can gat VM pid by executing <code>pgrep -lfa qemu</code> command |
Latest revision as of 16:42, 18 March 2019
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:
Select Pull Request you would like to download
On the Pull Request tab find source of the code you would like do download
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
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:
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:
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:
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:
Now we are ready for running tests in Atomic Host VM.
Execute command:
# ansible-playbook --tags=atomic tests.yml
FAQ
How can I get list of tags?
Yuo can gat list of tags executing ansible-playbook --list-tags tests.yml
command
Localhost: Where can I find test logs?
You can find logs in tests folder in artifacts/
, /tmp
or in the /var/tmp
folders
Container: Where can I find test logs?
You can find logs in tests folder in /usr/local/bin/
folder
Atomic: Where can I find test logs?
You can find logs in tests folder in /usr/local/bin/
folder
Atomic: How to install new package?
You can easelly instal new package executing folowing command rpm-ostree install <package name> && rpm-ostree ex livefs
folder
How can I get VM pid?
Yuo can gat VM pid by executing pgrep -lfa qemu
command