Skip to content

Commit

Permalink
Test install as non root user.
Browse files Browse the repository at this point in the history
  • Loading branch information
naturedamends committed Aug 22, 2023
1 parent 007b876 commit 4240ee8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
12 changes: 12 additions & 0 deletions test/common-utils/configure_zsh_no_template_first_step.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
check "default-zsh-with-no-zshrc" bash -c "[ ! -e ~/.zshrc ]"

# Report result
reportResults
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
function file_not_overridden() {
cat ~/.zshrc | grep 'alias fnomockalias=' | grep testingmock
cat $1 | grep 'alias fnomockalias=' | grep testingmock
}
check "default-zsh-with-no-zshrc" file_not_overridden
check "default-zsh-with-no-zshrc" file_not_overridden /home/devcontainer/.zshrc

# Report result
reportResults
16 changes: 13 additions & 3 deletions test/common-utils/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,20 @@
}
}
},
"configure_zsh_no_template": {
"configure_zsh_no_template_second_step": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"postCreateCommand": "echo alias fnomockalias=testingmock >> /root/.zshrc",
"remoteUser": "root",
"postCreateCommand": "echo alias fnomockalias=testingmock >> /home/devcontainer/.zshrc",
"remoteUser": "devcontainer",
"features": {
"common-utils": {
"installZsh": true,
"installOhMyZshConfig": false
}
}
},
"configure_zsh_no_template_first_step": {
"image": "debian:bullseye",
"remoteUser": "devcontainer",
"features": {
"common-utils": {
"installZsh": true,
Expand Down

0 comments on commit 4240ee8

Please sign in to comment.