aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephen A. Imhoff <clockwork-muse@outlook.com>2023-05-10 20:04:16 +0300
committerGitHub <noreply@github.com>2023-05-10 20:04:16 +0300
commit1869e5931cfe0517f75d58cb70863a6b4874c487 (patch)
tree2a0f240f07402c49843e701e230f12462e700f04 /test
parent4420cd5d27a551abbaa622bcde71dedb39617283 (diff)
Create .config directory in common-utils (#547)feature_common-utils_2.0.10
* Add test case for mounted subdirectory. * Correct some trailing whitespace. * Correct variable name to better reflect status as user home path. * Add config directory creation. * Remove extra debug line. * Bump feature version. * Mount host user home directory as "subdirectory" * Correct test naming, run test in explicit bash shell.
Diffstat (limited to 'test')
-rwxr-xr-xtest/common-utils/config-subdirectory.sh13
-rw-r--r--test/common-utils/scenarios.json10
2 files changed, 23 insertions, 0 deletions
diff --git a/test/common-utils/config-subdirectory.sh b/test/common-utils/config-subdirectory.sh
new file mode 100755
index 0000000..ba67fb6
--- /dev/null
+++ b/test/common-utils/config-subdirectory.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+# Definition specific tests
+check "owned-config-sub-directory" bash -c "ls -ld ~/.config/subdirectory | awk '{print $3}' | grep 'devcontainer'"
+check "owned-config-directory" bash -c "ls -ld ~/.config | awk '{print $3}' | grep 'devcontainer'"
+
+# Report result
+reportResults
diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json
index 43d11c9..21cb940 100644
--- a/test/common-utils/scenarios.json
+++ b/test/common-utils/scenarios.json
@@ -115,6 +115,16 @@
}
}
},
+ "config-subdirectory": {
+ "image": "alpine",
+ "remoteUser": "devcontainer",
+ "features": {
+ "common-utils": {}
+ },
+ "mounts": [
+ "source=${localEnv:HOME},target=/home/devcontainer/.config/subdirectory,type=bind,readonly"
+ ]
+ },
"alpine-3-14": {
"image": "alpine:3.14",
"remoteUser": "devcontainer",