aboutsummaryrefslogtreecommitdiff
path: root/test/podman_run_dns.bats
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-19 10:24:52 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-19 18:23:32 +0000
commit94000cc26326fe47587c6f5dc36953c6d1e4a528 (patch)
tree8ec589fdf3f958de9ed08d8766c651c4f08326c7 /test/podman_run_dns.bats
parent70306466d08c0e52a5a70c6d8eb8b021f95d22de (diff)
downloadpodman-94000cc26326fe47587c6f5dc36953c6d1e4a528.tar.gz
podman-94000cc26326fe47587c6f5dc36953c6d1e4a528.tar.bz2
podman-94000cc26326fe47587c6f5dc36953c6d1e4a528.zip
Add dns tests
In the dns commit, tests were accidently omitted due to a rebase against master. Signed-off-by: baude <bbaude@redhat.com> Closes: #245 Approved by: baude
Diffstat (limited to 'test/podman_run_dns.bats')
-rw-r--r--test/podman_run_dns.bats47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/podman_run_dns.bats b/test/podman_run_dns.bats
new file mode 100644
index 000000000..bdb99dedd
--- /dev/null
+++ b/test/podman_run_dns.bats
@@ -0,0 +1,47 @@
+#!/usr/bin/env bats
+
+load helpers
+
+function teardown() {
+ cleanup_test
+}
+
+function setup() {
+ copy_images
+}
+
+@test "test addition of a search domain" {
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --rm --dns-search=foobar.com ${ALPINE} cat /etc/resolv.conf | grep foo"
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "test addition of a bad dns server" {
+ run ${PODMAN_BINARY} ${PODMAN_OPTIONS} create --dns="foo" ${ALPINE} ls
+ echo "$output"
+ [ "$status" -ne 0 ]
+}
+
+@test "test addition of a dns server" {
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --rm --dns='1.2.3.4' ${ALPINE} cat /etc/resolv.conf | grep '1.2.3.4'"
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "test addition of a dns option" {
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --rm --dns-opt='debug' ${ALPINE} cat /etc/resolv.conf | grep 'options debug'"
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "test addition of a bad add-host" {
+ run ${PODMAN_BINARY} ${PODMAN_OPTIONS} create --add-host="foo:1.2" ${ALPINE} ls
+ echo "$output"
+ [ "$status" -ne 0 ]
+}
+
+@test "test addition of add-host" {
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --rm --add-host='foobar:1.1.1.1' ${ALPINE} cat /etc/hosts | grep 'foobar'"
+ echo "$output"
+ [ "$status" -eq 0 ]
+}