-
Notifications
You must be signed in to change notification settings - Fork 138
126 lines (111 loc) · 4.47 KB
/
qe-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: QE Tests
on: [push, pull_request]
jobs:
init:
name: Initialization
uses: ./.github/workflows/init.yml
secrets: inherit
build:
name: Waiting for build
needs: init
runs-on: ubuntu-latest
steps:
- name: Wait for build
uses: lewagon/wait-on-check-action@v1.3.1
with:
ref: ${{ github.ref }}
check-name: 'Building PKI'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
if: github.event_name == 'push'
- name: Wait for build
uses: lewagon/wait-on-check-action@v1.3.1
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: 'Building PKI'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
if: github.event_name == 'pull_request'
# Tier 0
installation-sanity-test:
# This job uses Ansible playbooks in the tests dir to setup a PKI deployment.
# All 5 subsystems are deployed on "discrete" instances
name: Testing installation sanity
needs: [init, build]
runs-on: ubuntu-latest
env:
PKIDIR: /tmp/workdir/pki
steps:
- name: Clone the repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install python3-pip
pip3 install -r tests/dogtag/pytest-ansible/requirements.txt
pip3 install -e tests/dogtag/pytest-ansible
- name: Retrieve pki-runner image
uses: actions/cache@v3
with:
key: pki-runner-${{ github.sha }}
path: pki-runner.tar
- name: Load runner image
run: docker load --input pki-runner.tar
- name: Run master container
run: |
IMAGE=pki-runner \
NAME=pki1 \
HOSTNAME=pki1.example.com \
tests/bin/runner-init.sh
- name: Install dependencies in master container
run: docker exec pki1 dnf install -y 389-ds-base python3-pip
- name: Set up inventory
run: |
sed -e "s/TOPOLOGY/topology-02/g" tests/inventory > inventory
ansible -i inventory -m setup master
- name: Set up topology-02
run: |
mkdir -p /tmp/test_dir
ansible-playbook \
-b \
-i inventory \
-l all \
-M tests/dogtag/pytest-ansible/common-modules \
-vvv \
tests/dogtag/pytest-ansible/installation/main.yml
- name: Run sanity test
run: |
pytest \
--ansible-host-pattern master \
--ansible-inventory inventory \
--ansible-module-path tests/dogtag/pytest-ansible/common-modules \
--junit-xml pki_cert_junit.xml \
-qsvvv \
tests/dogtag/pytest-ansible/pytest/sanity/test_role_users.py
- name: Gather artifacts
if: always()
run: |
tests/bin/ds-artifacts-save.sh pki1 topology-02-testingmaster
mkdir -p /tmp/artifacts/pki1/etc/pki
mkdir -p /tmp/artifacts/pki1/var/log
docker exec pki1 ls -la /etc/pki
docker cp pki1:/etc/pki/pki.conf /tmp/artifacts/pki1/etc/pki
docker cp pki1:/etc/pki/topology-02-CA /tmp/artifacts/pki1/etc/pki
docker cp pki1:/etc/pki/topology-02-KRA /tmp/artifacts/pki1/etc/pki
docker cp pki1:/etc/pki/topology-02-OCSP /tmp/artifacts/pki1/etc/pki
docker cp pki1:/etc/pki/topology-02-TKS /tmp/artifacts/pki1/etc/pki
docker cp pki1:/etc/pki/topology-02-TPS /tmp/artifacts/pki1/etc/pki
docker exec pki1 ls -la /var/log/pki
docker cp pki1:/var/log/pki /tmp/artifacts/pki1/var/log
docker exec pki1 journalctl -u pki-tomcatd@topology-02-CA > /tmp/artifacts/pki1/var/log/pki/topology-02-CA/systemd.log
docker exec pki1 journalctl -u pki-tomcatd@topology-02-KRA > /tmp/artifacts/pki1/var/log/pki/topology-02-KRA/systemd.log
docker exec pki1 journalctl -u pki-tomcatd@topology-02-OCSP > /tmp/artifacts/pki1/var/log/pki/topology-02-OCSP/systemd.log
docker exec pki1 journalctl -u pki-tomcatd@topology-02-TKS > /tmp/artifacts/pki1/var/log/pki/topology-02-TKS/systemd.log
docker exec pki1 journalctl -u pki-tomcatd@topology-02-TPS > /tmp/artifacts/pki1/var/log/pki/topology-02-TPS/systemd.log
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: sanity
path: |
/tmp/artifacts/pki1