diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/system/040-ps.bats | 5 | ||||
-rw-r--r-- | test/system/160-volumes.bats | 3 | ||||
-rw-r--r-- | test/system/200-pod.bats | 11 | ||||
-rw-r--r-- | test/system/330-corrupt-images.bats | 4 | ||||
-rw-r--r-- | test/system/500-networking.bats | 33 |
5 files changed, 42 insertions, 14 deletions
diff --git a/test/system/040-ps.bats b/test/system/040-ps.bats index ae27c479f..182d75547 100644 --- a/test/system/040-ps.bats +++ b/test/system/040-ps.bats @@ -5,6 +5,9 @@ load helpers @test "podman ps - basic tests" { rand_name=$(random_string 30) + run_podman ps --noheading + is "$output" "" "baseline: empty results from ps --noheading" + run_podman run -d --name $rand_name $IMAGE sleep 5 cid=$output is "$cid" "[0-9a-f]\{64\}$" @@ -30,8 +33,6 @@ load helpers "${cid:0:12} \+$IMAGE *sleep .* Exited .* $rand_name" \ "podman ps -a" - - run_podman rm $cid } diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats index 4952eafc2..98992f973 100644 --- a/test/system/160-volumes.bats +++ b/test/system/160-volumes.bats @@ -23,6 +23,9 @@ function teardown() { @test "podman run --volumes : basic" { skip_if_remote "volumes cannot be shared across hosts" + run_podman volume list --noheading + is "$output" "" "baseline: empty results from list --noheading" + # Create three temporary directories vol1=${PODMAN_TMPDIR}/v1_$(random_string) vol2=${PODMAN_TMPDIR}/v2_$(random_string) diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats index c65449212..054eda908 100644 --- a/test/system/200-pod.bats +++ b/test/system/200-pod.bats @@ -17,6 +17,17 @@ function teardown() { } +@test "podman pod - basic tests" { + run_podman pod list --noheading + is "$output" "" "baseline: empty results from list --noheading" + + run_podman pod ls --noheading + is "$output" "" "baseline: empty results from ls --noheading" + + run_podman pod ps --noheading + is "$output" "" "baseline: empty results from ps --noheading" +} + @test "podman pod top - containers in different PID namespaces" { # With infra=false, we don't get a /pause container (we also # don't pull k8s.gcr.io/pause ) diff --git a/test/system/330-corrupt-images.bats b/test/system/330-corrupt-images.bats index 9836de363..c51cc8d46 100644 --- a/test/system/330-corrupt-images.bats +++ b/test/system/330-corrupt-images.bats @@ -77,7 +77,7 @@ function _corrupt_image_test() { # Run the requested command. Confirm it succeeds, with suitable warnings run_podman $* - is "$output" ".*error determining parent of image" \ + is "$output" ".*error determining parent of image.*ignoring the error" \ "$* with missing $what_to_rm" run_podman images -a --noheading @@ -117,7 +117,7 @@ function _corrupt_image_test() { } @test "podman corrupt images - system reset" { - _corrupt_image_test "image prune -a -f" + _corrupt_image_test "system reset -f" } # END actual tests diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index cda054b15..8da864798 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -5,6 +5,19 @@ load helpers +@test "podman network - basic tests" { + heading="*NETWORK*ID*NAME*VERSION*PLUGINS*" + run_podman network ls + if [[ ${output} != ${heading} ]]; then + die "network ls expected heading is not available" + fi + + run_podman network ls --noheading + if [[ ${output} = ${heading} ]]; then + die "network ls --noheading did not remove heading: $output" + fi +} + # Copied from tsweeney's https://github.com/containers/podman/issues/4827 @test "podman networking: port on localhost" { skip_if_remote "FIXME: reevaluate this one after #7360 is fixed" @@ -20,9 +33,9 @@ load helpers # Bind-mount this file with a different name to a container running httpd run_podman run -d --name myweb -p "$HOST_PORT:80" \ - -v $INDEX1:/var/www/index.txt \ - -w /var/www \ - $IMAGE /bin/busybox-extras httpd -f -p 80 + -v $INDEX1:/var/www/index.txt \ + -w /var/www \ + $IMAGE /bin/busybox-extras httpd -f -p 80 cid=$output # In that container, create a second file, using exec and redirection @@ -71,7 +84,7 @@ load helpers # We could get more parseable output by using $NCAT_REMOTE_ADDR, # but busybox nc doesn't support that. run_podman run -d --userns=keep-id -p 127.0.0.1:$myport:$myport \ - $IMAGE nc -l -n -v -p $myport + $IMAGE nc -l -n -v -p $myport cid="$output" # emit random string, and check it @@ -108,7 +121,7 @@ load helpers # (Assert that output is formatted, not a one-line blob: #8011) run_podman network inspect $mynetname if [[ "${#lines[*]}" -lt 5 ]]; then - die "Output from 'pod inspect' is only ${#lines[*]} lines; see #8011" + die "Output from 'pod inspect' is only ${#lines[*]} lines; see #8011" fi run_podman run --rm --network $mynetname $IMAGE ip a @@ -116,7 +129,7 @@ load helpers "sdfsdf" run_podman run --rm -d --network $mynetname -p 127.0.0.1:$myport:$myport \ - $IMAGE nc -l -n -v -p $myport + $IMAGE nc -l -n -v -p $myport cid="$output" # emit random string, and check it @@ -159,9 +172,9 @@ load helpers # Bind-mount this file with a different name to a container running httpd run_podman run -d --name myweb -p "$HOST_PORT:80" \ - -v $INDEX1:/var/www/index.txt \ - -w /var/www \ - $IMAGE /bin/busybox-extras httpd -f -p 80 + -v $INDEX1:/var/www/index.txt \ + -w /var/www \ + $IMAGE /bin/busybox-extras httpd -f -p 80 cid=$output run_podman inspect $cid --format "{{.NetworkSettings.IPAddress}}" @@ -179,7 +192,7 @@ load helpers # check that we cannot curl (timeout after 5 sec) run timeout 5 curl -s $SERVER/index.txt if [ "$status" -ne 124 ]; then - die "curl did not timeout, status code: $status" + die "curl did not timeout, status code: $status" fi # reload the network to recreate the iptables rules |