Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Add debug
Browse files Browse the repository at this point in the history
Signed-off-by: stevenhorsman <[email protected]>
  • Loading branch information
stevenhorsman committed Sep 26, 2023
1 parent 12c6510 commit 2970527
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions integration/kubernetes/confidential/agent_image.bats
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ setup() {
assert_logs_contain "kata" 'Validate image failed: \[PublicKeyVerifier { key: ECDSA_P256_SHA256_ASN1'
}


@test "$test_tag Test pull an unencrypted unsigned image from an authenticated registry with correct credentials" {
kubectl delete secret cococred --ignore-not-found
AUTH_USER_NAME=$(echo "$REGISTRY_CREDENTIAL_ENCODED" |base64 -d| cut -d':' -f1)
Expand Down Expand Up @@ -154,12 +153,25 @@ setup() {
kubectl delete secret cococred --ignore-not-found
}


@test "$test_tag Test cannot pull an image from an authenticated registry without credentials" {
# TODO - anyway to reset nydus credentials?
pod_config="$(new_pod_config "${image_authenticated}")"
echo "Pod config: ${pod_config}"

assert_pod_fail "${pod_config}"
assert_logs_contain "containerd" 'failed to resolve reference \"quay.io/kata-containers/confidential-containers-auth:test\": pulling from host quay.io failed with status code \[manifests test\]: 401 UNAUTHORIZED'

# Print the logs
echo "-- Kata logs:"
sudo journalctl -xe -t kata --since "$test_start_date" -n 100000

echo "-- containerd logs:"
sudo journalctl -xe -t containerd --since "$test_start_date" -n 100000

echo "-- kubelet logs:"
sudo journalctl -xe -t kubelet --since "$test_start_date" -n 100000

assert_logs_contain "containerd" 'failed to resolve reference \\"quay.io/kata-containers/confidential-containers-auth:test\\": pulling from host quay.io failed with status code \\[manifests test\\]: 401 UNAUTHORIZED'
}

teardown() {
Expand Down

0 comments on commit 2970527

Please sign in to comment.