diff --git a/test/check-cli b/test/check-cli index 05610961..196927c8 100755 --- a/test/check-cli +++ b/test/check-cli @@ -103,6 +103,18 @@ class TestTar(composertest.ComposerTestCase): # Run the test, on the booted image 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__': composertest.main() diff --git a/test/run b/test/run index d5fd9003..f6f17e56 100755 --- a/test/run +++ b/test/run @@ -11,6 +11,8 @@ if [ -n "$TEST_SCENARIO" ]; then test/check-cli TestQcow2 elif [ "$TEST_SCENARIO" == "tar" ]; then test/check-cli TestTar + elif [ "$TEST_SCENARIO" == "ci" ]; then + test/check-cli TestPylint else test/check-cloud TestCloud.test_$TEST_SCENARIO fi diff --git a/tests/cli/test_ci.sh b/tests/cli/test_ci.sh new file mode 100755 index 00000000..8cdad64b --- /dev/null +++ b/tests/cli/test_ci.sh @@ -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