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

Commit

Permalink
re-order creds tests
Browse files Browse the repository at this point in the history
Signed-off-by: stevenhorsman <[email protected]>
  • Loading branch information
stevenhorsman committed Sep 25, 2023
1 parent 0a967f9 commit cbfe02e
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions integration/kubernetes/confidential/agent_image.bats
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ setup() {
assert_logs_contain "kata" 'Validate image failed: \[PublicKeyVerifier { key: ECDSA_P256_SHA256_ASN1'
}

@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}"

# 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_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'
}

@test "$test_tag Test pull an unencrypted unsigned image from an authenticated registry with correct credentials" {
kubectl delete secret cococred --ignore-not-found
Expand Down Expand Up @@ -154,24 +172,6 @@ setup() {
kubectl delete secret cococred --ignore-not-found
}

@test "$test_tag Test cannot pull an image from an authenticated registry without credentials" {
pod_config="$(new_pod_config "${image_authenticated}")"
echo "Pod config: ${pod_config}"

# 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_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'
}

teardown() {
teardown_common
}

0 comments on commit cbfe02e

Please sign in to comment.