aboutsummaryrefslogtreecommitdiff
path: root/test/system/500-networking.bats
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-01-31 09:58:15 -0500
committerMatthew Heon <matthew.heon@pm.me>2022-02-03 14:59:27 -0500
commit8f3f0710ff0aeda0d590cd8f74453f3a085e5e15 (patch)
tree5ce3c394fff9e91bc17279995ce05d99d9245a75 /test/system/500-networking.bats
parentfb6fca806daa0c602fba0a383f09a55b55cb60ce (diff)
downloadpodman-8f3f0710ff0aeda0d590cd8f74453f3a085e5e15.tar.gz
podman-8f3f0710ff0aeda0d590cd8f74453f3a085e5e15.tar.bz2
podman-8f3f0710ff0aeda0d590cd8f74453f3a085e5e15.zip
Only change network fields if they were actually changed by the user
Fixes: https://github.com/containers/podman/issues/13065 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system/500-networking.bats')
-rw-r--r--test/system/500-networking.bats21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 5a721c965..9f70c1c6c 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -589,4 +589,25 @@ load helpers
run_podman network rm -t 0 -f $netname
}
+@test "podman run CONTAINERS_CONF dns options" {
+ skip_if_remote "CONTAINERS_CONF redirect does not work on remote"
+ # Test on the CLI and via containers.conf
+ containersconf=$PODMAN_TMPDIR/containers.conf
+
+ searchIP="100.100.100.100"
+ cat >$containersconf <<EOF
+[containers]
+ dns_searches = [ "example.com"]
+ dns_servers = [
+ "1.1.1.1",
+ "$searchIP",
+ "1.0.0.1",
+ "8.8.8.8",
+]
+EOF
+ CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE grep "example.com" /etc/resolv.conf
+ CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE grep $searchIP /etc/resolv.conf
+ is "$output" "nameserver $searchIP" "Should only be one $searchIP not multiple"
+}
+
# vim: filetype=sh