aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoreitsupi <50911393+eitsupi@users.noreply.github.com>2023-01-11 00:50:09 +0300
committerGitHub <noreply@github.com>2023-01-11 00:50:09 +0300
commit7e32db56c00b79a2d35838ffa6f7081f517805b1 (patch)
treeee3a49b3866034c6a0b04847786fc3bb81d94712 /test
parent59fa3e3c21fd2c896da2d3272604509ea9a55a91 (diff)
[common-utils] Fix permission of scripts in containers (#388)
* fix permission in containers * add test * bump version * more tests * update tests * Update test/common-utils/devcontainer-info/Dockerfile Co-authored-by: Samruddhi Khandale <skhandale@microsoft.com> * Update test/common-utils/scenarios.json Co-authored-by: Samruddhi Khandale <skhandale@microsoft.com> * Update scenarios.json * Update devcontainer-info.sh Co-authored-by: Samruddhi Khandale <skhandale@microsoft.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/common-utils/devcontainer-info.sh25
-rw-r--r--test/common-utils/devcontainer-info/Dockerfile3
-rw-r--r--test/common-utils/devcontainer-info/meta.env8
-rw-r--r--test/common-utils/scenarios.json15
4 files changed, 51 insertions, 0 deletions
diff --git a/test/common-utils/devcontainer-info.sh b/test/common-utils/devcontainer-info.sh
new file mode 100755
index 0000000..65a4a40
--- /dev/null
+++ b/test/common-utils/devcontainer-info.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+check_info() {
+ local info=$1
+ check "devcontainer-info ${info}" sh -c "devcontainer-info | grep test-${info}"
+}
+
+# Definition specific tests
+check "user" bash -c "whoami | grep vscode"
+check_info "version"
+check_info "id"
+check_info "variant"
+check_info "repository"
+check_info "release"
+check_info "revision"
+check_info "time"
+check_info "url"
+
+# Report result
+reportResults
diff --git a/test/common-utils/devcontainer-info/Dockerfile b/test/common-utils/devcontainer-info/Dockerfile
new file mode 100644
index 0000000..28247d9
--- /dev/null
+++ b/test/common-utils/devcontainer-info/Dockerfile
@@ -0,0 +1,3 @@
+FROM ubuntu:focal
+
+COPY meta.env /usr/local/etc/dev-containers/meta.env
diff --git a/test/common-utils/devcontainer-info/meta.env b/test/common-utils/devcontainer-info/meta.env
new file mode 100644
index 0000000..dfc61d3
--- /dev/null
+++ b/test/common-utils/devcontainer-info/meta.env
@@ -0,0 +1,8 @@
+VERSION='test-version'
+DEFINITION_ID='test-id'
+VARIANT='test-variant'
+GIT_REPOSITORY='test-repository'
+GIT_REPOSITORY_RELEASE='test-release'
+GIT_REPOSITORY_REVISION='test-revision'
+BUILD_TIMESTAMP='test-time'
+CONTENTS_URL='test-url'
diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json
index bc1c784..dbf9cdc 100644
--- a/test/common-utils/scenarios.json
+++ b/test/common-utils/scenarios.json
@@ -114,5 +114,20 @@
"configureZshAsDefaultShell": true
}
}
+ },
+ "devcontainer-info": {
+ "build": {
+ "dockerfile": "Dockerfile"
+ },
+ "features": {
+ "common-utils": {
+ "username": "vscode",
+ "userUid": "1000",
+ "userGid": "1000",
+ "upgradePackages": true,
+ "installZsh": true
+ }
+ },
+ "remoteUser": "vscode"
}
}