forked from dogtagpki/pki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test scripts for CA agent cert revocation
The test code that creates, revokes, and unrevokes a CA agent cert has been moved into shell scripts.
- Loading branch information
Showing
4 changed files
with
41 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -ex | ||
|
||
# submit a cert request and capture the request ID | ||
pki client-cert-request uid=caagent | sed -n "s/^\s*Request ID:\s*\(\S*\)$/\1/p" > /tmp/request_id | ||
|
||
# approve the cert request and capture the cert ID | ||
pki -n caadmin ca-cert-request-approve `cat /tmp/request_id` --force | sed -n "s/^\s*Certificate ID:\s*\(\S*\)$/\1/p" > /tmp/cert_id | ||
|
||
# assign the cert to the user | ||
pki -n caadmin ca-user-cert-add caagent --serial `cat /tmp/cert_id` | ||
|
||
# import the cert into client | ||
pki client-cert-import caagent --serial `cat /tmp/cert_id` | ||
|
||
# test the client certificate | ||
pki -n caagent ca-cert-request-find |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash -ex | ||
|
||
# revoke the cert | ||
pki -n caadmin ca-cert-hold `cat /tmp/cert_id` --force | ||
|
||
set +e | ||
|
||
# revoked cert should not work | ||
pki -n caagent ca-cert-request-find || echo $? > /tmp/actual | ||
|
||
set -e | ||
|
||
echo 255 > /tmp/expected | ||
diff /tmp/actual /tmp/expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash -ex | ||
|
||
# unrevoke the cert | ||
pki -n caadmin ca-cert-release-hold `cat /tmp/cert_id` --force | ||
|
||
# unrevoked cert should work again | ||
pki -n caagent ca-cert-request-find |