#1 Initial commit for downstream tests using standard test interface
Merged 6 years ago by kzak. Opened 6 years ago by rasibley.
rpms/ rasibley/util-linux util-linux-tests  into  master

file added
+12
@@ -0,0 +1,12 @@ 

+ # Test which run in classic and docker environemnt

+ - hosts: localhost

+   tags:

+   - classic

+   - container

+   roles:

+   - role: standard-test-beakerlib

+     tests:

+     - various

+     required_packages:

+     - util-linux

+     - util-linux-user

@@ -0,0 +1,64 @@ 

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of /CoreOS/util-linux/various

+ #   Description: This test groups small sanity and regression tests for util-linux

+ #   Author: Miroslav Vadkerti <mvadkert@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2013 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 version 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.

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ export TEST=/CoreOS/util-linux/Sanity/various

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE

+ 

+ .PHONY: all install download clean

+ 

+ run: $(FILES) build

+ 	./runtest.sh

+ 

+ build: $(BUILT_FILES)

+ 	test -x runtest.sh || chmod a+x runtest.sh

+ 

+ clean:

+ 	rm -f *~ $(BUILT_FILES)

+ 

+ 

+ include /usr/share/rhts/lib/rhts-make.include

+ 

+ $(METADATA): Makefile

+ 	@echo "Owner:           Miroslav Vadkerti <mvadkert@redhat.com>" > $(METADATA)

+ 	@echo "Name:            $(TEST)" >> $(METADATA)

+ 	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)

+ 	@echo "Path:            $(TEST_DIR)" >> $(METADATA)

+ 	@echo "Description:     This test groups small sanity and regression tests for util-linux" >> $(METADATA)

+ 	@echo "Type:            Sanity" >> $(METADATA)

+ 	@echo "TestTime:        10m" >> $(METADATA)

+ 	@echo "RunFor:          util-linux" >> $(METADATA)

+ 	@echo "Requires:        util-linux util-linux-user" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2" >> $(METADATA)

+ 	@echo "Confidential:    no" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 	@echo "Releases:        -RHEL3 -RHEL4 -RHEL5Server -RHEL5Client -RHEL6" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,3 @@ 

+ PURPOSE of /CoreOS/util-linux/various

+ Description: This test groups small sanity and regression tests for util-linux

+ Author: Miroslav Vadkerti <mvadkert@redhat.com>

@@ -0,0 +1,52 @@ 

+ #!/bin/bash

+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest.sh of /CoreOS/util-linux/various

+ #   Description: This test groups small sanity and regression tests for util-linux

+ #   Author: Miroslav Vadkerti <mvadkert@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2013 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 version 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.

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ # Include Beaker environment

+ #. /usr/bin/rhts-environment.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="util-linux"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

+     rlPhaseEnd

+ 

+     rlPhaseStartTest "return code of chfn should be always 1 in case failure"

+         rlRun "chfn -f a:b" 1

+         rlRun "chfn -o a:b" 1

+         rlRun "chfn -p a:b" 1

+         rlRun "chfn -h a:b" 1

+         rlRun "chfn -x a:b" 1

+         rlRun "chfn -f a -o b -p c -h d unknown-user" 1

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

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: Docker, and Classic.
Test logs are stored in the Artifacts directory. Currently tests are not suitable for Atomic but may be updated later to support it.

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_DEBUG=1 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

Test Logs: (If you would like a pointer to the complete log, I can include that as well)

  • Docker
    <snip>
    08:45:33 TASK [standard-test-beakerlib : Execute beakerlib tests]
    08:45:35 changed: [46accfcf89d9ee689e79f54b24984a47b474861deb08064a9471107252e30a4b] => (item=various)
    08:45:35
    08:45:35 TASK [standard-test-beakerlib : Make the master test summary log artifact]
    08:45:36 changed: [46accfcf89d9ee689e79f54b24984a47b474861deb08064a9471107252e30a4b] => (item=various)
    08:45:36
    08:45:36 TASK [standard-test-beakerlib : Pull out the logs]
    08:45:36 changed: [46accfcf89d9ee689e79f54b24984a47b474861deb08064a9471107252e30a4b]
    08:45:36
    08:45:36 TASK [standard-test-beakerlib : Check the results]
    08:45:37 changed: [46accfcf89d9ee689e79f54b24984a47b474861deb08064a9471107252e30a4b]
    08:45:37
    08:45:37 PLAY RECAP
    08:45:37 46accfcf89d9ee689e79f54b24984a47b474861deb08064a9471107252e30a4b : ok=16 changed=11 unreachable=0 failed=0
    08:45:37
    08:45:37 ###################################
    08:45:37 Test results:
    08:45:37 ###################################
    08:45:37 PASS various

  • Classic
    <snip>
    TASK [standard-test-beakerlib : Execute beakerlib tests]
    changed: [localhost] => (item=various)
    TASK [standard-test-beakerlib : Make the master test summary log artifact]
    changed: [localhost] => (item=various)
    TASK [standard-test-beakerlib : Pull out the logs]
    changed: [localhost]
    TASK [standard-test-beakerlib : Check the results]
    changed: [localhost]
    PLAY RECAP
    localhost : ok=15 changed=9 unreachable=0 failed=0

Tests will be enabled in CI, yet gating is currently disabled, so nothing will change. However eventually gating will be enabled. Tests will run on each dist-git commit, they are not triggered on 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: rskvaril@redhat.com
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.

[0] https://fedoraproject.org/wiki/CI
[1] https://fedoraproject.org/wiki/Changes/InvokingTests

Hello, just following up to see if there is any additional information I can provide to help move this along ? Thanks!

Pull-Request has been merged by kzak

6 years ago