aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2023-08-24 22:31:40 +0300
committerGitHub <noreply@github.com>2023-08-24 22:31:40 +0300
commit0cf690ee14279d9e7ae5e1308950d6067d3aba81 (patch)
treea65d55d08b71b8432456aff80cf3457af98b0fba /test
parenta08434f2b18627f31107a4ef6ab4f578a92aeaec (diff)
[docker in docker] Adds retries for docker daemon startup and cgroup nesting (#669)feature_docker-in-docker_2.4.0
* adds retry logic * adds stress test workflow * Adds cgroup retries * update workflow * move sleep cmd * update test * cleanup
Diffstat (limited to 'test')
-rwxr-xr-xtest/docker-in-docker/docker_with_on_create_command.sh18
-rw-r--r--test/docker-in-docker/scenarios.json9
-rwxr-xr-xtest/docker-in-docker/test.sh2
3 files changed, 28 insertions, 1 deletions
diff --git a/test/docker-in-docker/docker_with_on_create_command.sh b/test/docker-in-docker/docker_with_on_create_command.sh
new file mode 100755
index 0000000..131304a
--- /dev/null
+++ b/test/docker-in-docker/docker_with_on_create_command.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+# Feature specific tests
+check "version" docker --version
+check "docker-ps" bash -c "docker ps"
+
+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'"
+
+# Report result
+reportResults \ No newline at end of file
diff --git a/test/docker-in-docker/scenarios.json b/test/docker-in-docker/scenarios.json
index de4e7d6..1274877 100644
--- a/test/docker-in-docker/scenarios.json
+++ b/test/docker-in-docker/scenarios.json
@@ -67,5 +67,14 @@
}
},
"remoteUser": "node"
+ },
+ // DO NOT REMOVE: This scenario is used by the docker-in-docker-stress-test workflow
+ "docker_with_on_create_command": {
+ "image": "mcr.microsoft.com/devcontainers/base:debian",
+ "features": {
+ "docker-in-docker": {}
+ },
+ "remoteUser": "vscode",
+ "onCreateCommand": "docker ps && sleep 5s && docker ps"
}
}
diff --git a/test/docker-in-docker/test.sh b/test/docker-in-docker/test.sh
index 1eebfd2..e86a841 100755
--- a/test/docker-in-docker/test.sh
+++ b/test/docker-in-docker/test.sh
@@ -8,10 +8,10 @@ source dev-container-features-test-lib
# Feature specific tests
check "version" docker --version
check "docker-init-exists" bash -c "ls /usr/local/share/docker-init.sh"
+check "docker-ps" bash -c "docker ps"
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