Updated test script
This commit is contained in:
11
run-test.sh
11
run-test.sh
@@ -2,7 +2,7 @@
|
|||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
LAB_CA="./lab-ca"
|
LAB_CA="./lab-ca"
|
||||||
|
PROVISION_CONFIG="examples/example-certificates.hcl"
|
||||||
# Build and install
|
# Build and install
|
||||||
# Build script for lab-ca with version injection from git tag
|
# Build script for lab-ca with version injection from git tag
|
||||||
git describe --tags --always --dirty > /dev/null 2>&1
|
git describe --tags --always --dirty > /dev/null 2>&1
|
||||||
@@ -18,7 +18,7 @@ if [ $? -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
echo -e "${GREEN}Build successful! Version: $VERSION${NC}"
|
echo -e "${GREEN}Build successful! Version: $VERSION${NC}"
|
||||||
|
|
||||||
rm -rf certs private *.json crl*.pem
|
rm -rf ca
|
||||||
|
|
||||||
echo -e "\n${GREEN}Initializing CA...${NC}"
|
echo -e "\n${GREEN}Initializing CA...${NC}"
|
||||||
$LAB_CA initca || exit 1
|
$LAB_CA initca || exit 1
|
||||||
@@ -36,7 +36,7 @@ echo -e "\n${GREEN}Issuing single certificate..${NC}"
|
|||||||
$LAB_CA issue --name "blackpanther2" --subject "blackpanther2.koszewscy.waw.pl" || exit 1
|
$LAB_CA issue --name "blackpanther2" --subject "blackpanther2.koszewscy.waw.pl" || exit 1
|
||||||
|
|
||||||
echo -e "\n${GREEN}Issuing multiple certificates from file...${NC}"
|
echo -e "\n${GREEN}Issuing multiple certificates from file...${NC}"
|
||||||
$LAB_CA provision --file examples/example-certificates.hcl --verbose || exit 1
|
$LAB_CA provision --file $PROVISION_CONFIG --verbose || exit 1
|
||||||
|
|
||||||
echo -e "\n${GREEN}Revoking a certificate by name...${NC}"
|
echo -e "\n${GREEN}Revoking a certificate by name...${NC}"
|
||||||
$LAB_CA revoke --name "loki" || exit 1
|
$LAB_CA revoke --name "loki" || exit 1
|
||||||
@@ -53,4 +53,7 @@ $LAB_CA crl --validity-days 7 --crl-file crl-2.pem || exit 1
|
|||||||
openssl crl -noout -text -in crl-2.pem
|
openssl crl -noout -text -in crl-2.pem
|
||||||
|
|
||||||
echo -e "\n${GREEN}Dumping CA state...${NC}"
|
echo -e "\n${GREEN}Dumping CA state...${NC}"
|
||||||
jq '.' example_ca_state.json
|
jq '.' ca/ca_state.json
|
||||||
|
|
||||||
|
# Finished
|
||||||
|
echo -e "\n${GREEN}All operations completed successfully!${NC}"
|
Reference in New Issue
Block a user