summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-03 15:37:19 -0500
committerGitHub <noreply@github.com>2022-02-03 15:37:19 -0500
commit608b6142edb7a4e179ce6d2ae69707be28f29359 (patch)
tree1ea61cd58e852d849fc5941c0827e6f1ad34727f /test/system
parente1ed5a9d9c8181075011634191cde183d07ae99a (diff)
parent642a691cbba407edbbcdfb287a47224bad779ec4 (diff)
downloadpodman-608b6142edb7a4e179ce6d2ae69707be28f29359.tar.gz
podman-608b6142edb7a4e179ce6d2ae69707be28f29359.tar.bz2
podman-608b6142edb7a4e179ce6d2ae69707be28f29359.zip
Merge pull request #13024 from cevich/netavark_system
Cirrus: Add netavark/aardvark system test task
Diffstat (limited to 'test/system')
-rw-r--r--test/system/005-info.bats12
-rw-r--r--test/system/500-networking.bats10
-rw-r--r--test/system/README.md1
-rw-r--r--test/system/helpers.bash9
4 files changed, 29 insertions, 3 deletions
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index 5f3cdff7e..0f7e8b2e4 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -88,6 +88,18 @@ host.slirp4netns.executable | $expr_path
is "$output" ".*graphOptions: {}" "output includes graphOptions: {}"
}
+@test "podman info netavark " {
+ # Confirm netavark in use when explicitely required by execution environment.
+ if [[ "$NETWORK_BACKEND" == "netavark" ]]; then
+ if ! is_netavark; then
+ # Assume is_netavark() will provide debugging feedback.
+ die "Netavark driver testing required, but not in use by podman."
+ fi
+ else
+ skip "Netavark testing not requested (\$NETWORK_BACKEND='$NETWORK_BACKEND')"
+ fi
+}
+
@test "podman --root PATH info - basic output" {
if ! is_remote; then
run_podman --storage-driver=vfs --root ${PODMAN_TMPDIR}/nothing-here-move-along info --format '{{ .Store.GraphOptions }}'
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 9f70c1c6c..9b39ebf97 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -256,13 +256,17 @@ load helpers
# rootless cannot modify iptables
if ! is_rootless; then
- # flush the CNI iptables here
- run iptables -t nat -F CNI-HOSTPORT-DNAT
+ # flush the port forwarding iptable rule here
+ chain="CNI-HOSTPORT-DNAT"
+ if is_netavark; then
+ chain="NETAVARK-HOSTPORT-DNAT"
+ fi
+ run iptables -t nat -F "$chain"
# 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
fi
diff --git a/test/system/README.md b/test/system/README.md
index fe6d1ed52..76626b6dd 100644
--- a/test/system/README.md
+++ b/test/system/README.md
@@ -49,6 +49,7 @@ Running tests
To run the tests locally in your sandbox, you can use one of these methods:
* make;PODMAN=./bin/podman bats ./test/system/070-build.bats # runs just the specified test
* make;PODMAN=./bin/podman bats ./test/system # runs all
+* make;PODMAN=./bin/podman NETWORK_BACKEND=netavark bats ./test/system # Assert & enable netavark testing
To test as root:
* $ PODMAN=./bin/podman sudo --preserve-env=PODMAN bats test/system
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 36a88fc10..c622a5172 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -341,6 +341,15 @@ function is_cgroupsv2() {
test "$cgroup_type" = "cgroup2fs"
}
+# True if podman is using netavark
+function is_netavark() {
+ run_podman info --format '{{.Host.NetworkBackend}}'
+ if [[ "$output" =~ netavark ]]; then
+ return 0
+ fi
+ return 1
+}
+
# Returns the OCI runtime *basename* (typically crun or runc). Much as we'd
# love to cache this result, we probably shouldn't.
function podman_runtime() {