Skip to content

Commit

Permalink
Debug layer info
Browse files Browse the repository at this point in the history
Signed-off-by: Derek McGowan <derek@mcg.dev>
  • Loading branch information
dmcgowan committed May 27, 2024
1 parent 724a4cd commit 19594e7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions script/tests/test_encryption.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,14 @@ pullImages() {
echo "Note: Image pull credentials can be passed with env. variable IMAGE_PULL_CREDS=<username>:<password>"
fi
$CTR images rm --sync ${ALPINE_ENC} ${ALPINE_DEC} ${NGINX_ENC} ${NGINX_DEC} ${BASH_ENC} &>/dev/null
$CTR images pull ${IMAGE_PULL_CREDS:+--user ${IMAGE_PULL_CREDS}} --all-platforms ${ALPINE}
$CTR content fetch ${IMAGE_PULL_CREDS:+--user ${IMAGE_PULL_CREDS}} --all-platforms ${ALPINE}
failExit $? "Image pull failed on ${ALPINE}"

$CTR images pull ${IMAGE_PULL_CREDS:+--user ${IMAGE_PULL_CREDS}} --platform linux/amd64 ${NGINX} &>/dev/null
failExit $? "Image pull failed on ${NGINX}"

# pull bash only for local platform
$CTR content fetch ${IMAGE_PULL_CREDS:+--user ${IMAGE_PULL_CREDS}} --all-platforms ${BASH} &>/dev/null
$CTR images pull ${IMAGE_PULL_CREDS:+--user ${IMAGE_PULL_CREDS}} ${BASH} &>/dev/null
failExit $? "Image pull failed on ${BASH}"

LAYER_INFO_ALPINE="$($CTR images layerinfo ${ALPINE})"
Expand Down Expand Up @@ -1375,7 +1374,7 @@ testKeyprovider() {

echo "Testing keyprovider using '${KEYPROVIDER}'"

echo "Testing large recpient list"
echo "Testing single recipient list"

$CTR images encrypt \
--recipient provider:testkeyprovider:foobar \
Expand All @@ -1392,10 +1391,6 @@ testKeyprovider() {
<(echo -n "ENCRYPTIONprovider.testkeyprovider")
failExit $? "Image layerinfo on keyprovider encrypted image shows unexpected encryption"

MSG=$(sudo $CTR container create ${ALPINE_ENC} --skip-decrypt-auth --key provider:testkeyprovider:xyz testcontainer1 2>&1)

failExit $? "Should have been able to create a container from encrypted (keyprovider)\n${MSG}"

$CTR images decrypt \
--key provider:testkeyprovider:123 \
${ALPINE_ENC} ${ALPINE_DEC}
Expand All @@ -1407,6 +1402,11 @@ testKeyprovider() {
diff <(echo "${LAYER_INFO_ALPINE}") <(echo "${LAYER_INFO_ALPINE_DEC}")
failExit $? "Image layerinfos are different (keyprovider)"

#MSG=$(sudo $CTR container create ${ALPINE_ENC} --skip-decrypt-auth --key provider:testkeyprovider:xyz testcontainer1 2>&1)
MSG=$(sudo $CTR container create ${ALPINE_ENC} --key provider:testkeyprovider:123 testcontainer1 2>&1)

failExit $? "Should have been able to create a container from encrypted (keyprovider)\n${MSG}\n${LAYER_INFO_ALPINE_ENC}"

$CTR images rm --sync ${ALPINE_ENC} ${ALPINE_DEC} &>/dev/null
echo "Decryption with keyprovider worked."

Expand Down

0 comments on commit 19594e7

Please sign in to comment.