aboutsummaryrefslogtreecommitdiff
path: root/test/docker-in-docker
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-11-24 02:03:07 +0300
committerGitHub <noreply@github.com>2022-11-24 02:03:07 +0300
commit4b3ccf36eabcad859a13806a8dc47dfa651182a1 (patch)
tree31bebbe272b46d737093e1ea98bebf90b73f260b /test/docker-in-docker
parent188f1ef26bc8fa942d552dfaa8596091a8a39126 (diff)
Adds test coverage (#308)
* Add test coverage * temp: debug test * Update tests
Diffstat (limited to 'test/docker-in-docker')
-rw-r--r--test/docker-in-docker/azureDnsAutoDetectionDisabled.sh2
-rw-r--r--test/docker-in-docker/azureDnsAutoDetectionEnabled.sh2
-rw-r--r--test/docker-in-docker/dockerDefaultAddressPool.sh2
-rwxr-xr-xtest/docker-in-docker/test.sh7
4 files changed, 9 insertions, 4 deletions
diff --git a/test/docker-in-docker/azureDnsAutoDetectionDisabled.sh b/test/docker-in-docker/azureDnsAutoDetectionDisabled.sh
index d3f4159..2415116 100644
--- a/test/docker-in-docker/azureDnsAutoDetectionDisabled.sh
+++ b/test/docker-in-docker/azureDnsAutoDetectionDisabled.sh
@@ -6,7 +6,7 @@ set -e
source dev-container-features-test-lib
# Definition specific tests
-check "dns flag should not be present" test ! "$(ps -ax | grep -E 'dockerd.+\-\-dns')"
+check "dns flag should not be present" test ! "$(ps -ax | grep -v grep | grep -E 'dockerd.+\-\-dns')"
# Report result
reportResults \ No newline at end of file
diff --git a/test/docker-in-docker/azureDnsAutoDetectionEnabled.sh b/test/docker-in-docker/azureDnsAutoDetectionEnabled.sh
index e63a1f3..87f158a 100644
--- a/test/docker-in-docker/azureDnsAutoDetectionEnabled.sh
+++ b/test/docker-in-docker/azureDnsAutoDetectionEnabled.sh
@@ -6,7 +6,7 @@ set -e
source dev-container-features-test-lib
# Definition specific tests
-check "dns flag should be present" ps -ax | grep -E "dockerd.+\-\-dns"
+check "dns flag should be present" ps -ax | grep -v grep | grep -E "dockerd.+\-\-dns"
# Report result
reportResults \ No newline at end of file
diff --git a/test/docker-in-docker/dockerDefaultAddressPool.sh b/test/docker-in-docker/dockerDefaultAddressPool.sh
index 8345357..219ad82 100644
--- a/test/docker-in-docker/dockerDefaultAddressPool.sh
+++ b/test/docker-in-docker/dockerDefaultAddressPool.sh
@@ -6,7 +6,7 @@ set -e
source dev-container-features-test-lib
# Definition specific tests
-check "default address pool setting set" ps -ax | grep -E "dockerd.+base=192.168.0.0/16,size=24"
+check "default address pool setting set" ps -ax | grep -v grep | grep -E "dockerd.+base=192.168.0.0/16,size=24"
# Report result
reportResults \ No newline at end of file
diff --git a/test/docker-in-docker/test.sh b/test/docker-in-docker/test.sh
index 3a802b5..1eebfd2 100755
--- a/test/docker-in-docker/test.sh
+++ b/test/docker-in-docker/test.sh
@@ -5,8 +5,13 @@ set -e
# Optional: Import test library
source dev-container-features-test-lib
-# Definition specific tests
+# Feature specific tests
check "version" docker --version
+check "docker-init-exists" bash -c "ls /usr/local/share/docker-init.sh"
+check "log-exists" bash -c "ls /tmp/dockerd.log"
+check "log-for-completion" bash -c "cat /tmp/dockerd.log | grep 'Daemon has completed initialization'"
+check "log-contents" bash -c "cat /tmp/dockerd.log | grep 'API listen on /var/run/docker.sock'"
+check "docker-ps" bash -c "docker ps"
# Report result
reportResults \ No newline at end of file