tests: Add new test to run 'test' and 'check' in cockpit ci

(cherry picked from commit ac01d52fa6c27de274394dfaa144990f05d9b8df)

Related: rhbz#1785154
This commit is contained in:
Jakub Rusz 2019-10-21 10:37:41 +02:00 committed by Alexander Todorov
parent 226708b27e
commit 0f20c8f5cf
3 changed files with 37 additions and 0 deletions

View File

@ -103,6 +103,18 @@ class TestTar(composertest.ComposerTestCase):
# Run the test, on the booted image # Run the test, on the booted image
self.runImageTest("/tests/cli/test_boot_tar_kickstart.sh") self.runImageTest("/tests/cli/test_boot_tar_kickstart.sh")
class TestPylint(composertest.ComposerTestCase):
def test_ci(self):
# Create an empty folder for the upload bellow
self.execute(["mkdir", "/lorax"])
# Upload contents of repo for running the test
self.machine.upload(["../tests", "../src", "../share", "../docs", "../Makefile",
"../test-packages"], "/lorax")
# Running the test
self.runImageTest("/tests/cli/test_ci.sh")
if __name__ == '__main__': if __name__ == '__main__':
composertest.main() composertest.main()

View File

@ -11,6 +11,8 @@ if [ -n "$TEST_SCENARIO" ]; then
test/check-cli TestQcow2 test/check-cli TestQcow2
elif [ "$TEST_SCENARIO" == "tar" ]; then elif [ "$TEST_SCENARIO" == "tar" ]; then
test/check-cli TestTar test/check-cli TestTar
elif [ "$TEST_SCENARIO" == "ci" ]; then
test/check-cli TestPylint
else else
test/check-cloud TestCloud.test_$TEST_SCENARIO test/check-cloud TestCloud.test_$TEST_SCENARIO
fi fi

23
tests/cli/test_ci.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# Note: execute this file from the project root directory
set -e
. /usr/share/beakerlib/beakerlib.sh
yum-config-manager --enable epel
dnf -y install $(cat /lorax/test-packages)
pip3 install pocketlint
cd /lorax
rlJournalStart
rlPhaseStartTest "check"
# running with -k because of possible errors that would make "make test" to not run
rlRun "make ci -k"
rlPhaseEnd
rlJournalEnd
rlJournalPrintText