| |
@@ -0,0 +1,85 @@
|
| |
+ # Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
|
| |
+ # is made available to anyone wishing to use, modify, copy, or
|
| |
+ # redistribute it subject to the terms and conditions of the GNU General
|
| |
+ # Public License v.2.
|
| |
+ #
|
| |
+ # This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
| |
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
| |
+ # PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
| |
+ #
|
| |
+ # You should have received a copy of the GNU General Public License
|
| |
+ # along with this program; if not, write to the Free Software
|
| |
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
| |
+ #
|
| |
+ # Author: bpeck@redhat.com
|
| |
+
|
| |
+ #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
| |
+ # Example Makefile for RHTS #
|
| |
+ # This example is geared towards a test for a specific package #
|
| |
+ # It does most of the work for you, but may require further coding #
|
| |
+ #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|
| |
+
|
| |
+ # The toplevel namespace within which the test lives.
|
| |
+ # FIXME: You will need to change this:
|
| |
+ TOPLEVEL_NAMESPACE=CoreOS
|
| |
+
|
| |
+ # The name of the package under test:
|
| |
+ # FIXME: you wil need to change this:
|
| |
+ PACKAGE_NAME=diffutils
|
| |
+
|
| |
+ # The path of the test below the package:
|
| |
+ # FIXME: you wil need to change this:
|
| |
+ RELATIVE_PATH=whitespace
|
| |
+
|
| |
+ # Version of the Test. Used with make tag.
|
| |
+ export TESTVERSION=1.1
|
| |
+
|
| |
+ # The combined namespace of the test.
|
| |
+ export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
| |
+
|
| |
+
|
| |
+ # A phony target is one that is not really the name of a file.
|
| |
+ # It is just a name for some commands to be executed when you
|
| |
+ # make an explicit request. There are two reasons to use a
|
| |
+ # phony target: to avoid a conflict with a file of the same
|
| |
+ # name, and to improve performance.
|
| |
+ .PHONY: all install download clean
|
| |
+
|
| |
+ # executables to be built should be added here, they will be generated on the system under test.
|
| |
+ BUILT_FILES=
|
| |
+
|
| |
+ # data files, .c files, scripts anything needed to either compile the test and/or run it.
|
| |
+ FILES=$(METADATA) runtest.sh Makefile PURPOSE file1 file2
|
| |
+
|
| |
+ run: $(FILES) build
|
| |
+ ./runtest.sh
|
| |
+
|
| |
+ build: $(BUILT_FILES)
|
| |
+ chmod a+x ./runtest.sh
|
| |
+
|
| |
+ clean:
|
| |
+ rm -f *~ *.rpm $(BUILT_FILES)
|
| |
+
|
| |
+ # You may need to add other targets e.g. to build executables from source code
|
| |
+ # Add them here:
|
| |
+
|
| |
+
|
| |
+ # Include Common Makefile
|
| |
+ include /usr/share/rhts/lib/rhts-make.include
|
| |
+
|
| |
+ # Generate the testinfo.desc here:
|
| |
+ $(METADATA): Makefile
|
| |
+ @touch $(METADATA)
|
| |
+ # Change to the test owner's name
|
| |
+ @echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA)
|
| |
+ @echo "Name: $(TEST)" >> $(METADATA)
|
| |
+ @echo "Path: $(TEST_DIR)" >> $(METADATA)
|
| |
+ @echo "License: GPL V2" >> $(METADATA)
|
| |
+ @echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
| |
+ @echo "Description: diff -b should ignore whitespace ">> $(METADATA)
|
| |
+ @echo "TestTime: 5m" >> $(METADATA)
|
| |
+ @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
| |
+ @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
|
| |
+
|
| |
+ # You may need other fields here; see the documentation
|
| |
+ rhts-lint $(METADATA)
|
| |
Adds tests according to the CI wiki [0] specifically the standard test interface in the spec [1].
The playbook includes Tier1 level test cases that have been tested in the following contexts and is passing reliably: Atomic Host, Docker, and Classic.
Test logs are stored in the Artifacts directory.
The following steps are used to execute the tests using the standard test interface:
Atomic
sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS=../atomic.qcow2 TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags atomic tests.yml
Docker
sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS=docker:docker.io/library/fedora:26 TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags container tests.yml
Classic
sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS="" TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags classic tests.yml
[0] https://fedoraproject.org/wiki/CI
[1] https://fedoraproject.org/wiki/Changes/InvokingTests
Test Logs: (If you you would like a pointer to the complete log, I can include that as well)
Atomic
<snip>
TASK [standard-test-beakerlib : Execute beakerlib tests] *****
changed: [../atomic.qcow2] => (item=cmp-s-returns-1-even-if-files-are-identical)
changed: [../atomic.qcow2] => (item=diff-hang-long-files)
changed: [../atomic.qcow2] => (item=diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space)
changed: [../atomic.qcow2] => (item=diff-Z-hangs)
changed: [../atomic.qcow2] => (item=sdiff-does-not-recognize-E-option)
changed: [../atomic.qcow2] => (item=whitespace)
TASK [standard-test-beakerlib : Make the master test summary log artifact] *
changed: [../atomic.qcow2] => (item=cmp-s-returns-1-even-if-files-are-identical)
changed: [../atomic.qcow2] => (item=diff-hang-long-files)
changed: [../atomic.qcow2] => (item=diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space)
changed: [../atomic.qcow2] => (item=diff-Z-hangs)
changed: [../atomic.qcow2] => (item=sdiff-does-not-recognize-E-option)
changed: [../atomic.qcow2] => (item=whitespace)
TASK [standard-test-beakerlib : Pull out the logs] *****
changed: [../atomic.qcow2]
TASK [standard-test-beakerlib : Check the results] *****
changed: [../atomic.qcow2]
PLAY RECAP ***********
../atomic.qcow2 : ok=13 changed=9 unreachable=0 failed=0
Test results:
PASS cmp-s-returns-1-even-if-files-are-identical
PASS diff-hang-long-files
PASS diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space
PASS diff-Z-hangs
PASS sdiff-does-not-recognize-E-option
PASS whitespace
Docker
<snip>
TASK [standard-test-beakerlib : Execute beakerlib tests] *****
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=cmp-s-returns-1-even-if-files-are-identical)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=diff-hang-long-files)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=diff-Z-hangs)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=sdiff-does-not-recognize-E-option)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=whitespace)
TASK [standard-test-beakerlib : Make the master test summary log artifact] *
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=cmp-s-returns-1-even-if-files-are-identical)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=diff-hang-long-files)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=diff-Z-hangs)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=sdiff-does-not-recognize-E-option)
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e] => (item=whitespace)
TASK [standard-test-beakerlib : Pull out the logs] *****
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e]
TASK [standard-test-beakerlib : Check the results] *****
changed: [ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e]
PLAY RECAP ***********
ed02612e6d71ec33d62782c41a340d65cb0ce5331002582c88528ec39892dd1e : ok=15 changed=10 unreachable=0 failed=0
Test results:
PASS cmp-s-returns-1-even-if-files-are-identical
PASS diff-hang-long-files
PASS diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space
PASS diff-Z-hangs
PASS sdiff-does-not-recognize-E-option
PASS whitespace
Classic
<snip>
==> default: TASK [standard-test-beakerlib : Execute beakerlib tests] ***
==> default: changed: [localhost] => (item=cmp-s-returns-1-even-if-files-are-identical)
==> default: changed: [localhost] => (item=diff-hang-long-files)
==> default: changed: [localhost] => (item=diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space)
==> default: changed: [localhost] => (item=diff-Z-hangs)
==> default: changed: [localhost] => (item=sdiff-does-not-recognize-E-option)
==> default: changed: [localhost] => (item=whitespace)
==> default:
==> default: TASK [standard-test-beakerlib : Make the master test summary log artifact] *
==> default: changed: [localhost] => (item=cmp-s-returns-1-even-if-files-are-identical)
==> default: changed: [localhost] => (item=diff-hang-long-files)
==> default: changed: [localhost] => (item=diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space)
==> default: changed: [localhost] => (item=diff-Z-hangs)
==> default: changed: [localhost] => (item=sdiff-does-not-recognize-E-option)
==> default: changed: [localhost] => (item=whitespace)
==> default:
==> default: TASK [standard-test-beakerlib : Pull out the logs] *****
==> default: changed: [localhost]
==> default:
==> default: TASK [standard-test-beakerlib : Check the results] *****
==> default: changed: [localhost]
==> default:
==> default: PLAY RECAP ***********
==> default: localhost : ok=15 changed=11 unreachable=0 failed=0
==> default: ++ '[' 0 -ne 0 ']'
==> default: ++ cat /root/diffutils/artifacts/test.log
==> default: PASS cmp-s-returns-1-even-if-files-are-identical
==> default: PASS diff-hang-long-files
==> default: PASS diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space
==> default: PASS diff-Z-hangs
==> default: PASS sdiff-does-not-recognize-E-option
==> default: PASS whitespace