Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ec72311

Browse filesBrowse files
committed
test: Add comments to test case
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
1 parent 2959ec0 commit ec72311
Copy full SHA for ec72311

1 file changed

+8Lines changed: 8 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎script/tests/test_encryption.sh‎

Copy file name to clipboardExpand all lines: script/tests/test_encryption.sh
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.