#5 [TEST] update Fedora CI tests
Opened 3 years ago by jruzicka. Modified 3 years ago
rpms/ jruzicka/knot-resolver update-epel-ci-tests  into  epel8

file modified
+1 -9
@@ -2,7 +2,7 @@ 

  =============

  

  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 @@ 

  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

@@ -0,0 +1,7 @@ 

+ #!/bin/bash

+ set -ex

+ 

+ systemctl stop kresd@1.service

+ systemctl start kresd@1.service

+ 

+ dig @127.0.0.1 .

@@ -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

@@ -1,23 +0,0 @@ 

- ---

- - block:

-     - name: make sure kresd socket and service is off

-       service:

-         name: "{{ item }}"

-         state: stopped

-       with_items:

-         - kresd@1.service

-         - kresd.socket

- 

-     - name: start kresd.socket

-       service:

-         name: kresd.socket

-         state: started

- 

-     - name: check if query is answered

-       shell: dig @127.0.0.1 .

-   rescue:

-     - set_fact:

-         socket_activation_failed: true

-   always:

-     - name: collect journal

-       shell: journalctl --since -10m > {{ artifacts }}/test_socket_activation_journal.log

file modified
+9 -22
@@ -1,28 +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_socket_activation.yml

-       when: ansible_distribution == 'Fedora'

-     - include_tasks: test_manual_activation.yml

- 

-     - set_fact:

-         tests_passed: '{{ socket_activation_failed is undefined and manual_activation_failed is undefined }}'

-     - name: report results

-       debug:

-         msg: |

-           test_socket_activation: {{ 'FAILED' if socket_activation_failed is defined else 'OK'}}

-           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