From 685fa2e0f151b4545b444135a5ef6877de20e851 Mon Sep 17 00:00:00 2001 From: Krikchai Pongtaveewould Date: Thu, 3 Aug 2023 05:12:14 +0700 Subject: Fix: common-utils configureZshAsDefaultShell option not working on alpine linux image (#557) * alpine defaultZsh fix * common-utils: replace pam.d/chsh permission with `sufficient` * common-utils: revert match auth sufficient * common-utils: append auth string instead of replacing a whole file * fix grep 2nd param * fix: line checking condition --- test/common-utils/alpine-base-zsh-default.sh | 13 +++++++++++++ test/common-utils/scenarios.json | 13 +++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 test/common-utils/alpine-base-zsh-default.sh (limited to 'test/common-utils') diff --git a/test/common-utils/alpine-base-zsh-default.sh b/test/common-utils/alpine-base-zsh-default.sh new file mode 100644 index 0000000..9fc00a2 --- /dev/null +++ b/test/common-utils/alpine-base-zsh-default.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +check "alpine default shell zsh" \ + bash -c "getent passwd $(whoami) | awk -F : '{ print $7 }' | grep '/bin/zsh'" + +# Report result +reportResults diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json index 21cb940..9800242 100644 --- a/test/common-utils/scenarios.json +++ b/test/common-utils/scenarios.json @@ -143,6 +143,7 @@ "build": { "dockerfile": "Dockerfile" }, + "remoteUser": "vscode", "features": { "common-utils": { "username": "vscode", @@ -151,7 +152,15 @@ "upgradePackages": true, "installZsh": true } - }, - "remoteUser": "vscode" + } + }, + "alpine-base-zsh-default": { + "image": "mcr.microsoft.com/devcontainers/base:alpine", + "remoteUser": "vscode", + "features": { + "common-utils": { + "configureZshAsDefaultShell": true + } + } } } -- cgit v1.2.3