-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path50_test_ocsp.sh
executable file
·37 lines (29 loc) · 1.32 KB
/
50_test_ocsp.sh
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
#!/bin/bash
pushd ${BUILD_DIR}
wget https://localhost:8443/testapp/ --ca-certificate=${BUILD_DIR}/ca-cert.pem -O revoked-client-test.txt --certificate=${BUILD_DIR}/revoked-client-cert.pem --private-key=${BUILD_DIR}/revoked-client-key.pem || true
wget https://localhost:8443/testapp/ --ca-certificate=${BUILD_DIR}/ca-cert.pem -O valid-client-test.txt --certificate=${BUILD_DIR}/valid-client-cert.pem --private-key=${BUILD_DIR}/valid-client-key.pem || true
OCSP_TEST_EXIT=0
# check responses
if ! (grep -q "The testapp index" valid-client-test.txt); then
echo "[FAILURE] Valid client didn't reach the test application"
let OCSP_TEST_EXIT++
fi
OCSP_TEST_EXIT=$((OCSP_TEST_EXIT<<1))
if (grep -q "The testapp index" revoked-client-test.txt); then
echo "[FAILURE] Revoked client reached the test application"
let OCSP_TEST_EXIT++
fi
OCSP_TEST_EXIT=$((OCSP_TEST_EXIT<<1))
if ! (grep -q "Cert Status: good" ocsp_responder.log); then
echo "[FAILURE] OCSP responder didn't check the valid client"
let OCSP_TEST_EXIT++
fi
OCSP_TEST_EXIT=$((OCSP_TEST_EXIT<<1))
if ! (grep -q "Cert Status: revoked" ocsp_responder.log); then
echo "[FAILURE] OCSP responder didn't check the revoked client"
let OCSP_TEST_EXIT++
fi
OCSP_TEST_EXIT=$((OCSP_TEST_EXIT<<1))
# TODO wget https://localhost:9443/management/
export OCSP_TEST_EXIT
popd # ${BUILD_DIR}