diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-16 20:53:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 20:53:43 +0000 |
commit | 2a21dcda8e949c5546c9281ca4b900910c6c42e8 (patch) | |
tree | 8c260329e475da741fc34fe7c23424a972b0e3ac /test/system/600-completion.bats | |
parent | 3ac83bf611ecf54d3608255ac70fc58d40764a11 (diff) | |
parent | be0d56ce1c404388cddb092c9d4508fb8bc72e6c (diff) | |
download | podman-2a21dcda8e949c5546c9281ca4b900910c6c42e8.tar.gz podman-2a21dcda8e949c5546c9281ca4b900910c6c42e8.tar.bz2 podman-2a21dcda8e949c5546c9281ca4b900910c6c42e8.zip |
Merge pull request #8755 from edsantiago/bats
System tests: better diagnostics in completion test
Diffstat (limited to 'test/system/600-completion.bats')
-rw-r--r-- | test/system/600-completion.bats | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/test/system/600-completion.bats b/test/system/600-completion.bats index 39906704e..e52db9af0 100644 --- a/test/system/600-completion.bats +++ b/test/system/600-completion.bats @@ -72,8 +72,9 @@ function check_shell_completion() { if ! is_remote; then run_completion "$@" $cmd "--" # If this fails there is most likely a problem with the cobra library - is "${lines[0]}" "--.*" "Found flag in suggestions" - [ ${#lines[@]} -gt 2 ] || die "No flag suggestions" + is "${lines[0]}" "--.*" \ + "$* $cmd: flag(s) listed in suggestions" + [ ${#lines[@]} -gt 2 ] || die "$* $cmd: No flag suggestions" _check_completion_end NoFileComp fi # continue the outer for args loop @@ -87,7 +88,8 @@ function check_shell_completion() { fi run_completion "$@" $cmd "${extra_args[@]}" "" - is "$output" ".*-$random_container_name${nl}" "Found expected container in suggestions for '$cmd'" + is "$output" ".*-$random_container_name${nl}" \ + "$* $cmd: actual container listed in suggestions" match=true # resume @@ -95,7 +97,8 @@ function check_shell_completion() { *POD*) run_completion "$@" $cmd "${extra_args[@]}" "" - is "$output" ".*-$random_pod_name${nl}" "Found expected pod in suggestions" + is "$output" ".*-$random_pod_name${nl}" \ + "$* $cmd: actual pod listed in suggestions" _check_completion_end NoFileComp match=true @@ -104,16 +107,20 @@ function check_shell_completion() { *IMAGE*) run_completion "$@" $cmd "${extra_args[@]}" "" - is "$output" ".*localhost/$random_image_name:$random_image_tag${nl}" "Found expected image in suggestions" + is "$output" ".*localhost/$random_image_name:$random_image_tag${nl}" \ + "$* $cmd: actual image listed in suggestions" # check that we complete the image with and without tag after at least one char is typed run_completion "$@" $cmd "${extra_args[@]}" "${random_image_name:0:1}" - is "$output" ".*$random_image_name:$random_image_tag${nl}" "Found expected image with tag in suggestions" - is "$output" ".*$random_image_name${nl}" "Found expected image without tag in suggestions" + is "$output" ".*$random_image_name:$random_image_tag${nl}" \ + "$* $cmd: image name:tag included in suggestions" + is "$output" ".*$random_image_name${nl}" \ + "$* $cmd: image name(w/o tag) included in suggestions" # check that we complete the image id after at least two chars are typed run_completion "$@" $cmd "${extra_args[@]}" "${random_image_id:0:2}" - is "$output" ".*$random_image_id${nl}" "Found expected image id in suggestions" + is "$output" ".*$random_image_id${nl}" \ + "$* $cmd: image id included in suggestions when two leading characters present in command line" match=true # resume @@ -121,7 +128,8 @@ function check_shell_completion() { *NETWORK*) run_completion "$@" $cmd "${extra_args[@]}" "" - is "$output" ".*$random_network_name${nl}" "Found network in suggestions" + is "$output" ".*$random_network_name${nl}" \ + "$* $cmd: actual network listed in suggestions" _check_completion_end NoFileComp match=true @@ -130,7 +138,8 @@ function check_shell_completion() { *VOLUME*) run_completion "$@" $cmd "${extra_args[@]}" "" - is "$output" ".*$random_volume_name${nl}" "Found volume in suggestions" + is "$output" ".*$random_volume_name${nl}" \ + "$* $cmd: actual volume listed in suggestions" _check_completion_end NoFileComp match=true @@ -142,7 +151,7 @@ function check_shell_completion() { ### FIXME how can we get the configured registries? _check_completion_end NoFileComp ### FIXME this fails if no registries are configured - [[ ${#lines[@]} -gt 2 ]] || die "No registries found in suggestions" + [[ ${#lines[@]} -gt 2 ]] || die "$* $cmd: No REGISTRIES found in suggestions" match=true # resume @@ -157,7 +166,7 @@ function check_shell_completion() { _check_completion_end NoSpace else _check_completion_end Default - [[ ${#lines[@]} -eq 2 ]] || die "Suggestions are in the output" + [[ ${#lines[@]} -eq 2 ]] || die "$* $cmd: Suggestions are in the output" fi ;; |