-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System tests: tighten 'is' operator #11776
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,26 +20,26 @@ load helpers | |
# Simple import | ||
run_podman import -q $archive | ||
iid="$output" | ||
run_podman run -t --rm $iid cat /random.txt | ||
run_podman run --rm $iid cat /random.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
is "$output" "$random_content" "simple import" | ||
run_podman rmi -f $iid | ||
|
||
# Simple import via stdin | ||
run_podman import -q - < <(cat $archive) | ||
iid="$output" | ||
run_podman run -t --rm $iid cat /random.txt | ||
run_podman run --rm $iid cat /random.txt | ||
is "$output" "$random_content" "simple import via stdin" | ||
run_podman rmi -f $iid | ||
|
||
# Tagged import | ||
run_podman import -q $archive $fqin | ||
run_podman run -t --rm $fqin cat /random.txt | ||
run_podman run --rm $fqin cat /random.txt | ||
is "$output" "$random_content" "tagged import" | ||
run_podman rmi -f $fqin | ||
|
||
# Tagged import via stdin | ||
run_podman import -q - $fqin < <(cat $archive) | ||
run_podman run -t --rm $fqin cat /random.txt | ||
run_podman run --rm $fqin cat /random.txt | ||
is "$output" "$random_content" "tagged import via stdin" | ||
run_podman rmi -f $fqin | ||
} | ||
|
@@ -100,7 +100,7 @@ EOF | |
|
||
# Confirm exit within timeout | ||
run_podman ps -a --filter name=$a_cnt --format '{{.Status}}' | ||
is "$output" "Exited (33)" "Exit by non-TERM/KILL" | ||
is "$output" "Exited (33) .*" "Exit by non-TERM/KILL" | ||
|
||
run_podman rm -f $a_cnt | ||
run_podman rmi $b_img $a_img | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,7 +245,7 @@ function _test_skopeo_credential_sharing() { | |
is "$status" "0" "skopeo inspect - exit status" | ||
|
||
got_name=$(jq -r .Name <<<"$output") | ||
is "$got_name" "$registry/$dest_name" "skopeo inspect -> Name" | ||
is "$got_name" "$registry/$destname" "skopeo inspect -> Name" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops. My bad. This has been broken from the beginning. This is a great example of why we need this PR. |
||
|
||
# Now try without a valid login; it should fail | ||
run_podman logout "$@" $registry | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -261,7 +261,8 @@ EOF | |
|
||
# prune should remove v4 | ||
run_podman volume prune --force | ||
is "$output" "${v[4]}" "volume prune, with 1, 2, 3 in use, deletes only 4" | ||
is "$(echo $(sort <<<$output))" "${v[4]} ${v[5]} ${v[6]}" \ | ||
"volume prune, with 1, 2, 3 in use, deletes only 4, 5, 6" | ||
Comment on lines
+264
to
+265
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is another great example of why we need this PR. Between the time I wrote this test and today, someone added some new volumes, and this check was not catching the addition. |
||
|
||
# Remove the container using v2 and v3. Prune should now remove those. | ||
# The 'echo sort' is to get the output sorted and in one line. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ spec: | |
containers: | ||
- command: | ||
- sleep | ||
- "100" | ||
- \"100\" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and line 52 are completely unrelated; it's just something that makes color highlighting work better in my editors. |
||
env: | ||
- name: PATH | ||
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
@@ -49,7 +49,7 @@ spec: | |
capabilities: {} | ||
privileged: false | ||
seLinuxOptions: | ||
level: "s0:c1,c2" | ||
level: \"s0:c1,c2\" | ||
readOnlyRootFilesystem: false | ||
volumeMounts: | ||
- mountPath: /testdir:z | ||
|
@@ -73,7 +73,7 @@ RELABEL="system_u:object_r:container_file_t:s0" | |
run_podman play kube - < $PODMAN_TMPDIR/test.yaml | ||
if [ -e /usr/sbin/selinuxenabled -a /usr/sbin/selinuxenabled ]; then | ||
run ls -Zd $TESTDIR | ||
is "$output" ${RELABEL} "selinux relabel should have happened" | ||
is "$output" "${RELABEL} $TESTDIR" "selinux relabel should have happened" | ||
fi | ||
|
||
run_podman stop -a -t 0 | ||
|
@@ -88,7 +88,7 @@ RELABEL="system_u:object_r:container_file_t:s0" | |
run_podman play kube $PODMAN_TMPDIR/test.yaml | ||
if [ -e /usr/sbin/selinuxenabled -a /usr/sbin/selinuxenabled ]; then | ||
run ls -Zd $TESTDIR | ||
is "$output" ${RELABEL} "selinux relabel should have happened" | ||
is "$output" "${RELABEL} $TESTDIR" "selinux relabel should have happened" | ||
fi | ||
|
||
run_podman stop -a -t 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update on the
-dev
issue: I confirmed (back to 1.4) that the only values areN.M
andN.M-dev
, but then ended up unable to useexpr
to handle-dev
. So the above expression now handlesN.M
with any suffix, such as1.23.0-dev
but also1.23abcfoothisisnonsensehellogoodbye
. I think we'll need to call that Good Enough.