From 1c997a24ab7ed9ce28cedf8895c08f2408bf3603 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Jul 11 2018 09:32:07 +0000 Subject: Add CI tests using the standard test interface Note: These tests basically wraps up the upstream tests 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 ``` Install all necessary packages from Standard_Test_Roles ``` $ sudo dnf install fedpkg libselinux-python standard-test-roles ``` Sample-run: ``` :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ 14:45:07 ] :: [ LOG ] :: Starting tests ... :: [ 14:45:07 ] :: [ LOG ] :: Starting tests ... :: [ 14:45:07 ] :: [ BEGIN ] :: Running 'cd build; ninja test' [0/1] Running all tests. 1/8 test-interface OK 0.01 s 2/8 test-server-client OK 0.03 s 3/8 test-object OK 0.01 s 4/8 test-array OK 0.01 s 5/8 test-type OK 0.01 s 6/8 test-error OK 0.01 s 7/8 test-avl OK 0.01 s 8/8 test-symbols OK 0.02 s OK: 8 FAIL: 0 SKIP: 0 TIMEOUT: 0 ``` 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. --- diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh new file mode 100755 index 0000000..c2442d4 --- /dev/null +++ b/tests/sanity/runtest.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="libvarlink" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "git clone https://github.com/varlink/libvarlink; cd libvarlink; meson build;make" + rlPhaseEnd + + rlPhaseStartTest + rlLog "Starting tests ..." + rlRun "cd build; ninja test" + rlPhaseEnd + + rlPhaseStartCleanup + rlLog "libvarlink tests done" + rlRun "rm -rf libvarlink" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd + +rlGetTestState diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..d8cdb3d --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - sanity + required_packages: + - libvarlink + - meson + - ninja-build + - gcc