From 216de67120e1a4007e3ca568f9a598727457319c Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 28 May 2019 14:03:11 +0200 Subject: [PATCH 1/8] ci: add basic smoke test for bolt Just execute 'boltctl --version' to check we can at least run. --- tests/tests.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/tests.yml diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..b21e12a --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +--- +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - bolt + tests: + - smoke: + dir: smoke + run: boltctl --version From 757c1edc2d3e528d119a7a58a19cc7eb0cdf3dc2 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 28 May 2019 16:55:20 +0200 Subject: [PATCH 2/8] gitignore: add test related directories to ignore For no artifacts/ and source/ in the test/ dir. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 3bf8b9c..de0c553 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,10 @@ results_bolt/ *.log *.rpm +#testing +tests/artifacts/ +tests/source/ + #tarballs /bolt-0.1.tar.gz /bolt-0.2.tar.gz From 82ab8ea99b931a3273a122193f3fdcfb13282538 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 28 May 2019 17:53:51 +0200 Subject: [PATCH 3/8] ci: enable gating Now that we have some basic tests, let's gate on them. --- gating.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 gating.yml diff --git a/gating.yml b/gating.yml new file mode 100644 index 0000000..d71584a --- /dev/null +++ b/gating.yml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_testing +rules: + - !PassingTestCaseRule {test_case_name: dist.depcheck} From 779d5c5d1a0943ff6165be30eaf048e2ba8db9c5 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 28 May 2019 18:38:31 +0200 Subject: [PATCH 4/8] ci: execute integration tests Run the integration tests for the 'boltd' installed on the system. A custom script is used so that each tests gets run individually. --- tests/run-it.sh | 20 ++++++++++++++++++++ tests/tests.yml | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100755 tests/run-it.sh diff --git a/tests/run-it.sh b/tests/run-it.sh new file mode 100755 index 0000000..bc5bb6f --- /dev/null +++ b/tests/run-it.sh @@ -0,0 +1,20 @@ +#!/usr/bin/bash +set -u + +IT="$1" + +# discover all the tests +TESTS=() +while IFS= read -r line; do + TESTS+=( "${line% *}" ) +done < <( "$1" list-tests ) + +# execute all the tests, one by one +RESULT=0 +for test in ${TESTS[@]}; do + echo "$test" + umockdev-wrapper "$IT" "$test" + ((RESULT += $?)) +done + +exit $RESULT diff --git a/tests/tests.yml b/tests/tests.yml index b21e12a..fefd28f 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -1,12 +1,22 @@ --- - hosts: localhost roles: + - role: standard-test-source + tags: + - always - role: standard-test-basic tags: - classic required_packages: - bolt + - pygobject3-devel + - python3-dbus + - python3-dbusmock + - umockdev-devel tests: - smoke: dir: smoke run: boltctl --version + - integration: + dir: . + run: ./run-it.sh source/tests/test-integration From 52f1373438cab297ec0d78d3a43f164f3b05b3b8 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 3 Jun 2019 14:50:11 +0200 Subject: [PATCH 5/8] ci: add -atomic to the tags Can't hurt. --- tests/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tests.yml b/tests/tests.yml index fefd28f..c3c996b 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -6,6 +6,7 @@ - always - role: standard-test-basic tags: + - atomic - classic required_packages: - bolt From e30fba1fac15d468a29a51a24fe5f9509fee054a Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 3 Jun 2019 14:48:42 +0200 Subject: [PATCH 6/8] ci: add support for running on rhel This is so we have one script for Fedora/RHEL. It can also handle bolt < 0.6 now, after which the test-integration list-test output changed. --- tests/run-it.sh | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/tests/run-it.sh b/tests/run-it.sh index bc5bb6f..5153471 100755 --- a/tests/run-it.sh +++ b/tests/run-it.sh @@ -1,13 +1,44 @@ #!/usr/bin/bash set -u -IT="$1" +# helper functions +vcmp_lt () { + # argument $1 is less than $2 + MV=$(echo "$@" | tr " " "\n" | sort -rV | head -n1) + test "$1" != "$MV" +} + +# main script +IT="${1:-source/tests/test-integration}" + +# check if we need to install additional packages +# which is the case if we are on RHEL 8 +source /etc/os-release || exit 1 + +if [[ "$ID" = *"rhel"* ]] && [[ "$VERSION_ID" == *"8"* ]]; then + dnf config-manager -y --add-repo umockdev.repo + dnf install -y umockdev-devel python3-gobject-base + pip3 install python-dbusmock +fi + +BOLT_VERSION=$(boltctl --version | cut -d " " -f2) + +# check if we can even discover the tests +"$IT" list-tests > /dev/null || exit 1 + +# The format of "list-tests" changed with 0.6 +if vcmp_lt $BOLT_VERSION 0.6; then + echo "Old style integration test names" + DELIM=" " +else + DELIM=$'\n' +fi # discover all the tests -TESTS=() -while IFS= read -r line; do +declare -a TESTS=() +while IFS= read -r -d "$DELIM" line; do TESTS+=( "${line% *}" ) -done < <( "$1" list-tests ) +done < <( $IT list-tests ) # execute all the tests, one by one RESULT=0 From 4058e236955bd5b7377105476c76e8b98a6da8c5 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 14 Jun 2019 00:33:20 +0200 Subject: [PATCH 7/8] bolt 0.8 release Major new feature is iommu support. Package the new CHANGELOG.md and adapt for the dbus configuration file move to /usr from /etc. --- .gitignore | 1 + bolt.spec | 13 +++++++++---- sources | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index de0c553..7b697d4 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ tests/source/ /bolt-0.5.tar.gz /bolt-0.6.tar.gz /bolt-0.7.tar.gz +/bolt-0.8.tar.gz diff --git a/bolt.spec b/bolt.spec index 0bd4219..2122660 100644 --- a/bolt.spec +++ b/bolt.spec @@ -1,6 +1,6 @@ Name: bolt -Version: 0.7 -Release: 2%{?dist} +Version: 0.8 +Release: 1%{?dist} Summary: Thunderbolt device manager License: LGPLv2+ URL: https://gitlab.freedesktop.org/bolt/bolt @@ -61,12 +61,12 @@ mentioned tasks. %files %license COPYING -%doc README.md +%doc README.md CHANGELOG.md %{_bindir}/boltctl %{_libexecdir}/boltd %{_unitdir}/%{name}.service %{_udevrulesdir}/*-%{name}.rules -%{_sysconfdir}/dbus-1/system.d/org.freedesktop.bolt.conf +%{_datadir}/dbus-1/system.d/org.freedesktop.bolt.conf %{_datadir}/dbus-1/interfaces/org.freedesktop.bolt.xml %{_datadir}/polkit-1/actions/org.freedesktop.bolt.policy %{_datadir}/polkit-1/rules.d/org.freedesktop.bolt.rules @@ -76,6 +76,11 @@ mentioned tasks. %ghost %dir %{_localstatedir}/lib/boltd %changelog +* Thu Jun 13 2019 Christian Kellner - 0.8-1 +- bolt 0.8 release + D-Bus Configuration moved from sysconfdir to datadir. + Package new CHNAGELOG.md. + * Thu Jan 31 2019 Fedora Release Engineering - 0.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index d79317f..1e80b94 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (bolt-0.7.tar.gz) = 6786f701501cc2680fac52cda7cdfe37971044abcf058b5c83bfa9f1d0a0381ba00e3377cfc97fcccf53760a2eafc1f8f6d0754f0e121d94201711ad8e40a135 +SHA512 (bolt-0.8.tar.gz) = 0fdbc026178a4ca6a8c53aa46933d1c411eb04e350955f8b10c7faff814576d0796dd28e56b968648e549c79cf5fa13d43970d797595af0f66457abaef8ace09 From 86f0dd3980429ec6be016fb9d4b89aa4ed7dd24e Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 14 Jun 2019 15:33:47 +0200 Subject: [PATCH 8/8] ci: it is .yAml not .yml for gating.yaml And apparently that is important. --- gating.yml => gating.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gating.yml => gating.yaml (100%) diff --git a/gating.yml b/gating.yaml similarity index 100% rename from gating.yml rename to gating.yaml