diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/common-utils/devcontainer-info.sh | 25 | ||||
-rw-r--r-- | test/common-utils/devcontainer-info/Dockerfile | 3 | ||||
-rw-r--r-- | test/common-utils/devcontainer-info/meta.env | 8 | ||||
-rw-r--r-- | test/common-utils/scenarios.json | 15 |
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" } } |