@@ -638,20 +638,26 @@ testJWE() {
638638
639639 MSG=$( $CTR container rm testcontainer1 2>&1 )
640640 MSG=$( $CTR snapshot rm testcontainer1 2>&1 )
641+
642+ # Create testcontainer1 from encrypted bash image ${BASH_ENC}
643+ # Creating the container without providing (right) key must fail
641644 MSG=$( sudo $CTR container create ${BASH_ENC} testcontainer1 2>&1 )
642645 if [ $? -eq 0 ]; then
643646 MSG=$( $CTR container rm testcontainer1 2>&1 )
644647 MSG=$( $CTR snapshot rm testcontainer1 2>&1 )
645648 failExit 1 " Should not have been able to create a container from encrypted image without passing keys"
646649 fi
647650 MSG=$( $CTR snapshot rm testcontainer1 2>&1 )
651+
652+ # creating the container when providing right key must work
648653 MSG=$( sudo bash -c " $CTR container create \
649654 --key ${PRIVKEYJWK} \
650655 ${BASH_ENC} testcontainer1 2>&1" )
651656 failExit $? " Should have been able to create a container from encrypted image when passing keys\n${MSG} "
652657 MSG=$( $CTR container rm testcontainer1 2>&1 )
653658 MSG=$( $CTR snapshot rm testcontainer1 2>&1 )
654659
660+ # running the container without providing (right) key must fail
655661 MSG=$( sudo bash -c " $CTR run \
656662 --rm \
657663 ${BASH_ENC} testcontainer1 echo 'Hello world'" 2>&1 )
@@ -660,6 +666,8 @@ testJWE() {
660666 failExit 1 " Should not have been able to run a container from encrypted image without passing keys"
661667 fi
662668 MSG=$( $CTR snapshot rm testcontainer1 2>&1 )
669+
670+ # Running the container when providing right key must work
663671 MSG=$( sudo bash -c " $CTR run \
664672 --key ${PRIVKEYJWK} \
665673 --rm \
0 commit comments