Skip to content

Commit

Permalink
Simplified assertion to check that SVID verification message is logged
Browse files Browse the repository at this point in the history
  • Loading branch information
nialdaly committed Jan 2, 2025
1 parent a98977c commit a8b446f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
12 changes: 10 additions & 2 deletions tests/integration/federation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,17 @@ function show_workload_status() {
-n $NAMESPACE_POLICY_NAMESPACE \
-o jsonpath='{.items[0].metadata.name}' \
--context $K8S_CLUSTER_1_CONTEXT)
./cofidectl workload status --namespace $NAMESPACE_POLICY_NAMESPACE \
WORKLOAD_STATUS_RESPONSE=$(./cofidectl workload status --namespace $NAMESPACE_POLICY_NAMESPACE \
--pod-name $POD_NAME \
--trust-zone $TRUST_ZONE_1
--trust-zone $TRUST_ZONE_1)

if [[ ! $WORKLOAD_STATUS_RESPONSE == *"SVID verified against trust bundle"* ]]; then
echo "cofidectl workload status unsuccessful"
exit 1
fi

echo "cofidectl workload status successful"
exit 0
}

function down() {
Expand Down
17 changes: 1 addition & 16 deletions tests/integration/single-trust-zone/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,7 @@ function show_workload_status() {
--pod-name $POD_NAME \
--trust-zone $TRUST_ZONE)

ERROR_PATTERNS=(
"Unable to create workload API client"
"unable to fetch X.509 trust bundles"
"unable to fetch X.509 SVIDs"
"SVID verification failed"
"No trust bundle found for trust domain"
)

for pattern in "${ERROR_PATTERNS[@]}"; do
if [[ $WORKLOAD_STATUS_RESPONSE == *"$pattern"* ]]; then
echo "cofidectl workload status unsuccessful"
exit 1
fi
done

if [[ ! $WORKLOAD_STATUS_RESPONSE == *"Trust bundles received"* ]] && [[ ! $WORKLOAD_STATUS_RESPONSE == *"SVIDs received"* ]]; then
if [[ ! $WORKLOAD_STATUS_RESPONSE == *"SVID verified against trust bundle"* ]]; then
echo "cofidectl workload status unsuccessful"
exit 1
fi
Expand Down

0 comments on commit a8b446f

Please sign in to comment.