From b47a6bc76c7daa24c167193b5c084d387e9272b5 Mon Sep 17 00:00:00 2001 From: Jakub Ružička Date: Oct 06 2020 11:14:03 +0000 Subject: tests: replace standard-test-rpm with -basic Currently, tests fail with TASK [standard-test-rpm : Install the test subject RPMs] *********************** fatal: [/workDir/workspace/fedora-rawhide-pr-pipeline/images/test_subject.qcow2]: FAILED! => msg: '''subjects'' is undefined' 'subjects' should be a list of RPMs to install but it looks undefined in fedora-rawhide-pr-pipeline. Try replacing this with standard-test-basic as seen in Fedora CI docs: https://docs.fedoraproject.org/en-US/ci/how-to-add-dist-git-test/ Same doc describes standard-test-rpm as "A role for installing additional rpms" which I don't think is the use case here. --- diff --git a/tests/README.md b/tests/README.md index 295aeb7..8f69da4 100644 --- a/tests/README.md +++ b/tests/README.md @@ -2,7 +2,7 @@ Package tests ============= These tests implement the standard test interface in Fedora CI. -See https://fedoraproject.org/wiki/CI/Tests for details. +See https://docs.fedoraproject.org/en-US/ci/tests/ for details. Manual execution ---------------- @@ -12,11 +12,3 @@ modifications to your system. It's best to run these on a clean, throw-away testing system or a VM. ansible-playbook tests/tests.yml -e subjects=/path/to/knot-resolver.rpm -e artifacts=/path/to/artifacts - -Automatic execution -------------------- - -These tests should eventually be automatically executed by the Fedora CI -pipeline. As of 2018-01-10, it is not supported for packages that aren't part -of Fedora Atomic. Once it is implemented, the results of these tests should be -visible in dist-git commits on src.fedoraproject.org diff --git a/tests/scripts/test_manual_activation.sh b/tests/scripts/test_manual_activation.sh new file mode 100755 index 0000000..c595e05 --- /dev/null +++ b/tests/scripts/test_manual_activation.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +systemctl stop kresd@1.service +systemctl start kresd@1.service + +dig @127.0.0.1 . diff --git a/tests/test_manual_activation.yml b/tests/test_manual_activation.yml deleted file mode 100644 index cb61748..0000000 --- a/tests/test_manual_activation.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- block: - - name: make sure kresd@1 socket and service is off - service: - name: "{{ item }}" - state: stopped - with_items: - - kresd@1.service - - kresd@1.socket - failed_when: false - - - name: start kresd@1.service - service: - name: kresd@1.service - state: started - - - name: check if query is answered - shell: dig @127.0.0.1 . - rescue: - - set_fact: - manual_activation_failed: true - always: - - name: collect journal - shell: journalctl --since -10m > {{ artifacts }}/test_manual_activation_journal.log diff --git a/tests/tests.yml b/tests/tests.yml index e504526..1f4dc95 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -1,25 +1,15 @@ --- - hosts: localhost remote_user: root - pre_tasks: - - package: # Install additional dependecies - name: bind-utils - state: latest roles: - - role: standard-test-rpm + - role: standard-test-basic tags: - classic - tasks: - - include_tasks: test_manual_activation.yml - - - set_fact: - tests_passed: '{{ manual_activation_failed is undefined }}' - - name: report results - debug: - msg: | - test_manual_activation: {{ 'FAILED' if manual_activation_failed is defined else 'OK'}} - - - name: fail playbook if tests failed - debug: - msg: --- {{ 'PASSED' if tests_passed else 'FAILED' }} --- - failed_when: not tests_passed + required_packages: + - bind-utils + tests: + - kresd-show-version: + run: kresd --version + - manual-activation: + dir: scripts + run: ./test_manual_activation.sh