Skip to content

Commit b8cc0a5

Browse files
committed
Update tests
1 parent 43adcba commit b8cc0a5

4 files changed

Lines changed: 166 additions & 27 deletions

File tree

.github/workflows/ca-basic-test.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,32 @@ jobs:
5050
FEDORA_VERSION=$(docker exec pki sed -n 's/^VERSION_ID=//p' /etc/os-release)
5151
echo "FEDORA_VERSION=$FEDORA_VERSION" >> $GITHUB_ENV
5252
53+
- name: Check resteasy lib
54+
if: always()
55+
run: |
56+
docker exec pki ls -l /usr/share/java
57+
58+
- name: Check pki files
59+
if: always()
60+
run: |
61+
docker exec pki ls -l /usr/share/pki
62+
63+
- name: Check pki lib
64+
if: always()
65+
run: |
66+
docker exec pki ls -l /usr/share/pki/lib
67+
68+
- name: Check pki server lib
69+
if: always()
70+
run: |
71+
docker exec pki ls -l /usr/share/pki/server/lib
72+
73+
- name: Check pki server common lib
74+
if: always()
75+
run: |
76+
docker exec pki ls -l /usr/share/pki/server/common/lib
77+
>>>>>>> d9d58284ec (Update tests)
78+
5379
- name: Check pki CLI help messages
5480
run: |
5581
docker exec pki pki info --help
@@ -94,6 +120,7 @@ jobs:
94120
wc -l output
95121
96122
- name: Check PKI server base dir after installation
123+
if: always()
97124
run: |
98125
# check file types, owners, and permissions
99126
docker exec pki ls -l /var/lib/pki/pki-tomcat \
@@ -119,6 +146,7 @@ jobs:
119146
diff expected output
120147
121148
- name: Check PKI server conf dir after installation
149+
if: always()
122150
run: |
123151
# check file types, owners, and permissions
124152
docker exec pki ls -l /etc/pki/pki-tomcat \
@@ -146,6 +174,26 @@ jobs:
146174
147175
diff expected output
148176
177+
- name: Check PKI server NSS database dir after installation
178+
if: always()
179+
run: |
180+
# check file types, owners, and permissions
181+
docker exec pki ls -l /etc/pki/pki-tomcat/alias \
182+
| sed \
183+
-e '/^total/d' \
184+
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
185+
| tee output
186+
187+
# TODO: review permissions
188+
cat > expected << EOF
189+
-rw-r--r-- pkiuser pkiuser ca.crt
190+
-rw------- pkiuser pkiuser cert9.db
191+
-rw------- pkiuser pkiuser key4.db
192+
-rw------- pkiuser pkiuser pkcs11.txt
193+
EOF
194+
195+
diff expected output
196+
149197
- name: Check server.xml
150198
if: always()
151199
run: |
@@ -162,6 +210,7 @@ jobs:
162210
docker exec pki cat /etc/sysconfig/pki-tomcat
163211
164212
- name: Check PKI server logs dir after installation
213+
<<<<<<< HEAD
165214
if: ${{ fromJSON(env.FEDORA_VERSION) < 43 }}
166215
run: |
167216
# check file types, owners, and permissions
@@ -207,6 +256,7 @@ jobs:
207256
diff expected output
208257
209258
- name: Check CA base dir
259+
if: always()
210260
run: |
211261
# check file types, owners, and permissions
212262
docker exec pki ls -l /var/lib/pki/pki-tomcat/ca \
@@ -228,6 +278,7 @@ jobs:
228278
diff expected output
229279
230280
- name: Check CA conf dir
281+
if: always()
231282
run: |
232283
# check file types, owners, and permissions
233284
docker exec pki ls -l /var/lib/pki/pki-tomcat/conf/ca \
@@ -404,6 +455,7 @@ jobs:
404455
405456
# issue audit signing cert
406457
docker exec pki pki \
458+
--debug \
407459
-n caadmin \
408460
ca-cert-issue \
409461
--profile caAuditSigningCert \

.github/workflows/ca-ecc-test.yml

Lines changed: 80 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,18 @@ jobs:
3333
tests/bin/ds-create.sh \
3434
--image=${{ env.DS_IMAGE }} \
3535
--hostname=ds.example.com \
36+
--network=example \
37+
--network-alias=ds.example.com \
3638
--password=Secret.123 \
3739
ds
3840
39-
- name: Connect DS container to network
40-
run: docker network connect example ds --alias ds.example.com
41-
4241
- name: Set up PKI container
4342
run: |
44-
tests/bin/runner-init.sh pki
45-
env:
46-
HOSTNAME: pki.example.com
47-
48-
- name: Connect PKI container to network
49-
run: docker network connect example pki --alias pki.example.com
43+
tests/bin/runner-init.sh \
44+
--hostname=pki.example.com \
45+
--network=example \
46+
--network-alias=pki.example.com \
47+
pki
5048
5149
- name: Install CA
5250
run: |
@@ -55,7 +53,69 @@ jobs:
5553
-s CA \
5654
-D pki_ds_url=ldap://ds.example.com:3389 \
5755
-D pki_enable_access_log=False \
58-
-v
56+
--debug \
57+
> >(tee stdout) 2> >(tee stderr >&2)
58+
59+
- name: Check for warnings
60+
if: always()
61+
run: |
62+
sed -n '/^WARNING:/p' stderr | tee output
63+
wc -l output
64+
65+
- name: Check external commands
66+
if: always()
67+
run: |
68+
sed -n '/^DEBUG: Command:/p' stderr | tee output
69+
wc -l output
70+
71+
- name: Check PKI server conf dir after installation
72+
if: always()
73+
run: |
74+
# check file types, owners, and permissions
75+
docker exec pki ls -l /etc/pki/pki-tomcat \
76+
| sed \
77+
-e '/^total/d' \
78+
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
79+
| tee output
80+
81+
# TODO: review permissions
82+
cat > expected << EOF
83+
drwxrwx--- pkiuser pkiuser Catalina
84+
drwxrwx--- pkiuser pkiuser alias
85+
drwxrwx--- pkiuser pkiuser ca
86+
-rw-r--r-- pkiuser pkiuser catalina.policy
87+
lrwxrwxrwx pkiuser pkiuser catalina.properties -> /usr/share/pki/server/conf/catalina.properties
88+
drwxrwx--- pkiuser pkiuser certs
89+
lrwxrwxrwx pkiuser pkiuser context.xml -> /etc/tomcat/context.xml
90+
lrwxrwxrwx pkiuser pkiuser logging.properties -> /usr/share/pki/server/conf/logging.properties
91+
-rw-rw---- pkiuser pkiuser password.conf
92+
-rw-rw---- pkiuser pkiuser server.xml
93+
-rw-rw---- pkiuser pkiuser serverCertNick.conf
94+
-rw-rw---- pkiuser pkiuser tomcat.conf
95+
lrwxrwxrwx pkiuser pkiuser web.xml -> /etc/tomcat/web.xml
96+
EOF
97+
98+
diff expected output
99+
100+
- name: Check PKI server NSS database dir after installation
101+
if: always()
102+
run: |
103+
# check file types, owners, and permissions
104+
docker exec pki ls -l /etc/pki/pki-tomcat/alias \
105+
| sed \
106+
-e '/^total/d' \
107+
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
108+
| tee output
109+
110+
# TODO: review permissions
111+
cat > expected << EOF
112+
-rw-r--r-- pkiuser pkiuser ca.crt
113+
-rw------- pkiuser pkiuser cert9.db
114+
-rw------- pkiuser pkiuser key4.db
115+
-rw------- pkiuser pkiuser pkcs11.txt
116+
EOF
117+
118+
diff expected output
59119
60120
- name: Check system cert keys
61121
run: |
@@ -216,7 +276,12 @@ jobs:
216276
docker exec pki pki pkcs12-import \
217277
--pkcs12 /root/.dogtag/pki-tomcat/ca_admin_cert.p12 \
218278
--pkcs12-password Secret.123
219-
docker exec pki pki -n caadmin ca-user-show caadmin
279+
280+
docker exec pki pki \
281+
--debug \
282+
-n caadmin \
283+
ca-user-show \
284+
caadmin
220285
221286
- name: Check CA admin cert
222287
run: |
@@ -275,21 +340,12 @@ jobs:
275340
run: |
276341
docker exec pki journalctl -x --no-pager -u pki-tomcatd@pki-tomcat.service
277342
278-
- name: Check CA debug log
343+
- name: Check PKI server access log
279344
if: always()
280345
run: |
281-
docker exec pki find /var/lib/pki/pki-tomcat/logs/ca -name "debug.*" -exec cat {} \;
346+
docker exec pki find /var/log/pki/pki-tomcat -name "localhost_access_log.*" -exec cat {} \;
282347
283-
- name: Gather artifacts
348+
- name: Check CA debug log
284349
if: always()
285350
run: |
286-
tests/bin/ds-artifacts-save.sh ds
287-
tests/bin/pki-artifacts-save.sh pki
288-
continue-on-error: true
289-
290-
- name: Upload artifacts
291-
if: always()
292-
uses: actions/upload-artifact@v4
293-
with:
294-
name: ca-ecc
295-
path: /tmp/artifacts
351+
docker exec pki find /var/lib/pki/pki-tomcat/logs/ca -name "debug.*" -exec cat {} \;

.github/workflows/kra-hsm-test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,20 @@ jobs:
122122
-D pki_audit_signing_token=HSM \
123123
-D pki_subsystem_token=HSM \
124124
-D pki_sslserver_token=internal \
125-
-v
125+
--debug \
126+
> >(tee stdout) 2> >(tee stderr >&2)
127+
128+
- name: Check for warnings
129+
if: always()
130+
run: |
131+
sed -n '/^WARNING:/p' stderr | tee output
132+
wc -l output
133+
134+
- name: Check external commands
135+
if: always()
136+
run: |
137+
sed -n '/^DEBUG: Command:/p' stderr | tee output
138+
wc -l output
126139
127140
- name: Check system certs in internal token
128141
run: |

.github/workflows/server-basic-test.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ jobs:
5959
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
6060
| tee output
6161
62+
- name: Check PKI server lib dir
63+
run: |
64+
# check file types, owners, and permissions
65+
docker exec pki ls -l /usr/share/pki/server/lib \
66+
| sed \
67+
-e '/^total/d' \
68+
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
69+
| tee output
70+
6271
- name: Check PKI server common lib dir
6372
run: |
6473
# check file types, owners, and permissions
@@ -68,10 +77,19 @@ jobs:
6877
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
6978
| tee output
7079
71-
- name: Check PKI server lib dir
80+
- name: Check CA lib dir
7281
run: |
7382
# check file types, owners, and permissions
74-
docker exec pki ls -l /usr/share/pki/server/lib \
83+
docker exec pki ls -l /usr/share/pki/ca/webapps/ca/WEB-INF/lib \
84+
| sed \
85+
-e '/^total/d' \
86+
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
87+
| tee output
88+
89+
- name: Check KRA lib dir
90+
run: |
91+
# check file types, owners, and permissions
92+
docker exec pki ls -l /usr/share/pki/kra/webapps/kra/WEB-INF/lib \
7593
| sed \
7694
-e '/^total/d' \
7795
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \

0 commit comments

Comments
 (0)