summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-03-02 15:44:45 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-03-07 08:08:32 -0500
commit326f3eda313606bcf28f413b5e6cdbd02ce2586b (patch)
treee9261d9cb37039e44669500bacf072092a8f4124 /test
parent01ffe2c30ae7bcd83e5556dfdf2d657e6a4539c2 (diff)
downloadpodman-326f3eda313606bcf28f413b5e6cdbd02ce2586b.tar.gz
podman-326f3eda313606bcf28f413b5e6cdbd02ce2586b.tar.bz2
podman-326f3eda313606bcf28f413b5e6cdbd02ce2586b.zip
Handle podman build --dns-search
Fixes: https://github.com/containers/podman/issues/9574 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/070-build.bats8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index a9f97d5ab..1a89800a5 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -168,6 +168,9 @@ EOF
CAT_SECRET="cat /run/secrets/$secret_filename"
fi
+ # For --dns-search: a domain that is unlikely to exist
+ local nosuchdomain=nx$(random_string 10).net
+
# Command to run on container startup with no args
cat >$tmpdir/mycmd <<EOF
#!/bin/sh
@@ -218,17 +221,22 @@ RUN chown 2:3 /bin/mydefaultcmd
RUN $CAT_SECRET
CMD ["/bin/mydefaultcmd","$s_echo"]
+RUN cat /etc/resolv.conf
EOF
# cd to the dir, so we test relative paths (important for podman-remote)
cd $PODMAN_TMPDIR
run_podman ${MOUNTS_CONF} build \
+ --dns-search $nosuchdomain \
-t build_test -f build-test/Containerfile build-test
local iid="${lines[-1]}"
# Make sure 'podman build' had the secret mounted
is "$output" ".*$secret_contents.*" "podman build has /run/secrets mounted"
+ is "$output" ".*search $nosuchdomain" \
+ "--dns-search added to /etc/resolv.conf"
+
if is_remote; then
ENVHOST=""
else