#1 Add CI tests using the standard test interface
Closed 6 years ago by sturivny. Opened 6 years ago by sturivny.
git://fedorapeople.org/~sturivny/chkconfig add-tests  into  master

Add CI tests using the standard test interface
Serhii Turivnyi • 6 years ago  
tests/alternatives-doesn-t-update-slave-links-with/Makefile
file added
+62
@@ -0,0 +1,62 @@

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

+ #

+ #   Makefile of /CoreOS/chkconfig/Regression/alternatives-doesn-t-update-slave-links-with

+ #   Description: Test for BZ#1347541 (alternatives doesn't update slave links with)

+ #   Author: Jan Scotka <jscotka@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2016 Red Hat, Inc.

+ #

+ #   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/chkconfig/Regression/alternatives-doesn-t-update-slave-links-with

+ 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)

+ 

+ $(METADATA): Makefile

+ 	@echo "Owner:           Jan Scotka <jscotka@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for BZ#1347541 (alternatives doesn't update slave links with)" >> $(METADATA)

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

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

+ 	@echo "RunFor:          chkconfig" >> $(METADATA)

+ 	@echo "Requires:        chkconfig" >> $(METADATA)

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

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

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

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

+ 	@echo "Bug:             1347541" >> $(METADATA)

+ 	@echo "Releases:        -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

tests/alternatives-doesn-t-update-slave-links-with/PURPOSE
file added
+5
@@ -0,0 +1,5 @@

+ PURPOSE of /CoreOS/chkconfig/Regression/alternatives-doesn-t-update-slave-links-with

+ Description: Test for BZ#1347541 (alternatives doesn't update slave links with)

+ Author: Jan Scotka <jscotka@redhat.com>

+ Bug summary: alternatives doesn't update slave links with --install in manual mode

+ Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1347541

tests/alternatives-doesn-t-update-slave-links-with/runtest.sh
file added
+50
@@ -0,0 +1,50 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /CoreOS/chkconfig/Regression/alternatives-doesn-t-update-slave-links-with

+ #   Description: Test for BZ#1347541 (alternatives doesn't update slave links with)

+ #   Author: Jan Scotka <jscotka@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2016 Red Hat, Inc.

+ #

+ #   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/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="chkconfig"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

+     rlPhaseEnd

+     rlPhaseStartTest

+ 

+         rlRun "alternatives --install /usr/bin/xxx xxx /usr/bin/true 1 --slave /usr/bin/yyy yyy /usr/bin/true"

+         rlRun "alternatives --set xxx /usr/bin/true"

+         rlRun "alternatives --install /usr/bin/xxx xxx /usr/bin/true 1 --slave /usr/bin/yyy yyy /usr/bin/false"

+         rlRun "readlink /etc/alternatives/yyy | grep /usr/bin/false"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "update-alternatives --remove xxx /usr/bin/true"

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/backport-family-option-from-upstream/Makefile
file added
+63
@@ -0,0 +1,63 @@

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

+ #

+ #   Makefile of /CoreOS/chkconfig/Sanity/backport-family-option-from-upstream

+ #   Description: Test for BZ#1291340 (Backport --family option from upstream)

+ #   Author: Jan Scotka <jscotka@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2016 Red Hat, Inc.

+ #

+ #   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/chkconfig/Sanity/backport-family-option-from-upstream

+ 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)

+ 

+ 

+ $(METADATA): Makefile

+ 	@echo "Owner:           Jan Scotka <jscotka@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     Test for BZ#1291340 (Backport --family option from upstream)" >> $(METADATA)

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

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

+ 	@echo "RunFor:          chkconfig" >> $(METADATA)

+ 	@echo "Requires:        chkconfig" >> $(METADATA)

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

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

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

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

+ 	@echo "Bug:             1291340" >> $(METADATA)

+ 	@echo "Releases:        -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

tests/backport-family-option-from-upstream/PURPOSE
file added
+5
@@ -0,0 +1,5 @@

+ PURPOSE of /CoreOS/chkconfig/Sanity/backport-family-option-from-upstream

+ Description: Test for BZ#1291340 (Backport --family option from upstream)

+ Author: Jan Scotka <jscotka@redhat.com>

+ Bug summary: Backport --family option from upstream

+ Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1291340

tests/backport-family-option-from-upstream/runtest.sh
file added
+58
@@ -0,0 +1,58 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /CoreOS/chkconfig/Sanity/backport-family-option-from-upstream

+ #   Description: Test for BZ#1291340 (Backport --family option from upstream)

+ #   Author: Jan Scotka <jscotka@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2016 Red Hat, Inc.

+ #

+ #   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/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="chkconfig"

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

+         rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"

+         rlRun "touch $TmpDir/a"

+         rlRun "touch $TmpDir/b"

+         rlRun "ln -s $TmpDir/a $TmpDir/link"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "alternatives --install $TmpDir/link testname $TmpDir/a 1 --family testfamily"

+         rlRun "alternatives --install $TmpDir/link testname $TmpDir/b 2 --family testfamily"

+         rlRun "alternatives --display testname |grep 'link.*$TmpDir/b'" 

+         rlRun "alternatives --display testname |grep 'link.*$TmpDir/a'" 1

+         rlRun "alternatives --display testname |grep '$TmpDir/a.*testfamily priority 1'"

+         rlRun "alternatives --list | grep 'testname.*$TmpDir/b'"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun " alternatives --remove testname $TmpDir/a"

+         rlRun " alternatives --remove testname $TmpDir/b"

+         rlRun "rm -rf $TmpDir"

+     rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

tests/chkconfig-prioritory-set-inconsistently/Makefile
file added
+61
@@ -0,0 +1,61 @@

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

+ #

+ #   Makefile of /CoreOS/chkconfig/Regression/chkconfig-prioritory-set-inconsistently

+ #   Description: chkconfig-prioritory-set-inconsistently

+ #   Author: Martin Cermak <mcermak@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2012 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/chkconfig/Regression/chkconfig-prioritory-set-inconsistently

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE service-a-fake service-b-fake service-c-fake

+ 

+ .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)

+ 

+ $(METADATA): Makefile

+ 	@echo "Owner:           Martin Cermak <mcermak@redhat.com>" > $(METADATA)

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

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

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

+ 	@echo "Description:     chkconfig-prioritory-set-inconsistently" >> $(METADATA)

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

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

+ 	@echo "RunFor:          chkconfig" >> $(METADATA)

+ 	@echo "Requires:        chkconfig" >> $(METADATA)

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

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

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

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

+ 	@echo "Bug:             771455" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

tests/chkconfig-prioritory-set-inconsistently/PURPOSE
file added
+5
@@ -0,0 +1,5 @@

+ PURPOSE of /CoreOS/chkconfig/Regression/chkconfig-prioritory-set-inconsistently

+ Description: chkconfig-prioritory-set-inconsistently

+ Author: Martin Cermak <mcermak@redhat.com>

+ Bug summary: chkconfig S## prioritory set inconsistently for initscript with Requires-Start: $network

+ Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=771455

tests/chkconfig-prioritory-set-inconsistently/runtest.sh
file added
+82
@@ -0,0 +1,82 @@

+ #!/bin/bash

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

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

+ #

+ #   runtest.sh of /CoreOS/chkconfig/Regression/chkconfig-prioritory-set-inconsistently

+ #   Description: chkconfig-prioritory-set-inconsistently

+ #   Author: Martin Cermak <mcermak@redhat.com>

+ #

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

+ #

+ #   Copyright (c) 2012 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/lib/beakerlib/beakerlib.sh

+ 

+ PACKAGE="chkconfig"

+ 

+ myGetPriority() {

+         SERVICE=$1

+         basename $( ls /etc/rc.d/rc3.d/S[0-9][0-9]$SERVICE ) | tr -d "[a-zA-Z\-]"

+ }

+ 

+ # Test scenario: 

+ # https://bugzilla.redhat.com/show_bug.cgi?id=771455#c0

+ 

+ rlJournalStart

+     rlPhaseStartSetup

+         rlAssertRpm $PACKAGE

+         rlRun "cp service-{a,b,c}-fake /etc/rc.d/init.d/"

+ 

+         # A has Required-Start on B or C, thus the reversed order:

+         rlRun "/usr/lib/lsb/install_initd service-c-fake"

+         rlRun "/usr/lib/lsb/install_initd service-b-fake"

+         rlRun "/usr/lib/lsb/install_initd service-a-fake"

+ 

+         rlRun "chkconfig service-a-fake off"

+         rlRun "chkconfig service-b-fake off"

+         rlRun "chkconfig service-c-fake off"

+     rlPhaseEnd

+ 

+     rlPhaseStartTest

+         rlRun "chkconfig service-b-fake on"

+         rlRun "chkconfig service-a-fake on"

+         rlRun "PRIO=$( myGetPriority service-a-fake )"

+         # now, the priority of A should be >= 40 (should be = 40 in ideal world)

+         # and hopefully it is < 80

+         rlRun "[ $PRIO -ge 40 ]"

+         rlRun "[ $PRIO -lt 80 ]"

+ 

+         rlRun "chkconfig service-c-fake on"

+         rlRun "PRIO=$( myGetPriority service-a-fake )"

+         # MAIN TEST:

+         # right after enabling C, A should raise its priority above 80

+         # this should fail with unpatched package (e.g. chkconfig-1.3.47-1.el6)

+         # ... and pass with patched one (e.g. chkconfig-1.3.49.3-2.el6)

+         rlRun "[ $PRIO -gt 80 ]"

+     rlPhaseEnd

+ 

+     rlPhaseStartCleanup

+         rlRun "/usr/lib/lsb/remove_initd service-a-fake"

+         rlRun "/usr/lib/lsb/remove_initd service-b-fake"

+         rlRun "/usr/lib/lsb/remove_initd service-c-fake"

+         rlRun "rm -rf /etc/rc.d/init.d/service-{a,b,c}-fake"

+     rlPhaseEnd

+ #rlJournalPrintText

+ rlJournalEnd

tests/chkconfig-prioritory-set-inconsistently/service-a-fake
file added
+17
@@ -0,0 +1,17 @@

+ #!/bin/sh

+ #

+ # service-a-fake  

+ 

+ # chkconfig: 2345 40 89

+ # description: Fake service a

+ #

+ ### BEGIN INIT INFO

+ # Provides:          service-a-fake 

+ # Default-Start:     2 3 4 5

+ # Default-Stop:      0 6

+ # Required-Start:    bz771455fakeservice

+ # Short-Description: Fake service a

+ # Description:       Fake service a

+ ### END INIT INFO

+ 

+ 

tests/chkconfig-prioritory-set-inconsistently/service-b-fake
file added
+16
@@ -0,0 +1,16 @@

+ #!/bin/sh

+ #

+ # service-b-fake  

+ 

+ # chkconfig: 2345 14 89

+ # description: Fake service b

+ #

+ ### BEGIN INIT INFO

+ # Provides:          bz771455fakeservice

+ # Default-Start:     2 3 4 5

+ # Default-Stop:      0 6

+ # Short-Description: Fake service b

+ # Description:       Fake service b

+ ### END INIT INFO

+ 

+ 

tests/chkconfig-prioritory-set-inconsistently/service-c-fake
file added
+16
@@ -0,0 +1,16 @@

+ #!/bin/sh

+ #

+ # service-c-fake  

+ 

+ # chkconfig: 2345 80 89

+ # description: Fake service c

+ #

+ ### BEGIN INIT INFO

+ # Provides:          bz771455fakeservice

+ # Default-Start:     2 3 4 5

+ # Default-Stop:      0 6

+ # Short-Description: Fake service c

+ # Description:       Fake service c

+ ### END INIT INFO

+ 

+ 

tests/tests.retry
file added
+1
@@ -0,0 +1,1 @@

+ localhost

tests/tests.yml
file added
+15
@@ -0,0 +1,15 @@

+ ---

+ # This first play always runs on the local staging system

+ - hosts: localhost

+   roles:

+   - role: standard-test-beakerlib

+     tags:

+     - classic

+     - container

+     tests:

+     - alternatives-doesn-t-update-slave-links-with

+     - backport-family-option-from-upstream

+     - chkconfig-prioritory-set-inconsistently

+     required_packages:

+     - chkconfig

+     - lsb

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/chkconfig
$ cd chkconfig/



Run tests for Classic

All test should be run under the root

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

Snip of the example test run:

TASK [standard-test-beakerlib : Copy tests to test environment] ***********************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : Fix up beakerlib at tests environment] ****************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : Run beakerlib tests] **********************************************************************************************************************************
changed: [localhost] => (item=alternatives-doesn-t-update-slave-links-with)
changed: [localhost] => (item=backport-family-option-from-upstream)
changed: [localhost] => (item=chkconfig-prioritory-set-inconsistently)

TASK [standard-test-beakerlib : Make the master tests summary log artifact] ***********************************************************************************************************
changed: [localhost] => (item=alternatives-doesn-t-update-slave-links-with)
changed: [localhost] => (item=backport-family-option-from-upstream)
changed: [localhost] => (item=chkconfig-prioritory-set-inconsistently)

TASK [standard-test-beakerlib : include_role] *****************************************************************************************************************************************

TASK [str-common : Pull out the logs from test environment to test runner] ************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : Check the results] ************************************************************************************************************************************
changed: [localhost]

PLAY RECAP ****************************************************************************************************************************************************************************
localhost                  : ok=27   changed=12   unreachable=0    failed=0  



Run tests for Container

All test should be run under the root

# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
# export TEST_SUBJECTS=docker:docker.io/library/fedora:27
# ansible-playbook --tags=container tests.yml

Snip of the example test run:

TASK [standard-test-beakerlib : Copy tests to test environment] ***********************************************************************************************************************
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57]

TASK [standard-test-beakerlib : Fix up beakerlib at tests environment] ****************************************************************************************************************
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57]

TASK [standard-test-beakerlib : Run beakerlib tests] **********************************************************************************************************************************
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57] => (item=alternatives-doesn-t-update-slave-links-with)
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57] => (item=backport-family-option-from-upstream)
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57] => (item=chkconfig-prioritory-set-inconsistently)

TASK [standard-test-beakerlib : Make the master tests summary log artifact] ***********************************************************************************************************
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57] => (item=alternatives-doesn-t-update-slave-links-with)
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57] => (item=backport-family-option-from-upstream)
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57] => (item=chkconfig-prioritory-set-inconsistently)

TASK [standard-test-beakerlib : include_role] *****************************************************************************************************************************************

TASK [str-common : Pull out the logs from test environment to test runner] ************************************************************************************************************
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57]

TASK [standard-test-beakerlib : Check the results] ************************************************************************************************************************************
changed: [aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57]

PLAY RECAP ****************************************************************************************************************************************************************************
aa5577642fd241220d14038efebd9f50efb912bbcd77e217dc65c69074db4f57 : ok=27   changed=16   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: Martin Cermak mcermak@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.

Pull-Request has been closed by sturivny

6 years ago