generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These files appear to be new additions for a test suite related to t…
…he `azure-cli-persistence` feature, which is designed to persist Azure CLI configuration across container restarts. The tests are written in Bash and use the `dev-container-features-test-lib` library for reporting test results. The `scenarios.json` file defines four different test scenarios: one using Node.js, one using Zsh shell, one using Fish shell, and one using a root user. Each scenario specifies an image to use as the base container and lists the required features (including `azure-cli-persistence`). The `test.sh` file is empty, but it's likely that it would import the test library and then run the tests for each scenario defined in `scenarios.json`. The other files (`with_node.sh`, `zsh_shell.sh`, `fish_shell.sh`, and `root_user.sh`) are specific test scripts for each scenario, which likely contain commands to check that the Azure CLI configuration is persisted across container restarts. Overall, these files suggest that the `azure-cli-persistence` feature is designed to work with different shells (Node.js, Zsh, Fish, and root user) and that it can be tested using a set of automated tests.
- Loading branch information
1 parent
4c19a42
commit 653d55d
Showing
8 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# This script is the "default" test script for the azure-cli-persistence feature. | ||
# It is not run as a scenario, but is run by other test scripts. | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# check that `azure --help` works | ||
check "help" bash -c "azure help | grep 'usage'" | ||
|
||
# check that `.azure` and `/dc/azure-cli` exist under the user (should be node) | ||
check "~/.azure existence" bash -c "ls -la ~ | grep '.azure'" | ||
check "/dc/azure-cli existence" bash -c "ls -la /dc | grep 'azure-cli'" | ||
|
||
# check that the folders are owned by the user | ||
# https://askubuntu.com/a/175060 | ||
echo "Checking ownership of ~/.azure and /dc/azure-cli (ensure it is owned by $USER)" | ||
|
||
check "~/.azure owned by user" bash -c "test \"$(stat -c "%U" ~/.azure)\" = $USER" | ||
check "/dc/azure-cli owned by user" bash -c "test \"$(stat -c "%U" /dc/azure-cli)\" = $USER" | ||
|
||
# Report result | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Run default test script (in same folder) | ||
# See: https://github.com/devcontainers/features/blob/562305d37b97d47331d96306ffc2a0a3cce55e64/test/azure-cli/install_extensions_bookworm.sh | ||
./_default.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source dev-container-features-test-lib | ||
|
||
# Run default test script (in same folder) | ||
# See: https://github.com/devcontainers/features/blob/562305d37b97d47331d96306ffc2a0a3cce55e64/test/azure-cli/install_extensions_bookworm.sh | ||
./_default.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"with_node": { | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18", | ||
"features": { | ||
"ghcr.io/devcontainers/features/azure-cli": {}, | ||
"azure-cli-persistence": {} | ||
} | ||
}, | ||
"zsh_shell": { | ||
"image": "mcr.microsoft.com/devcontainers/base:debian", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"configureZshAsDefaultShell": true | ||
}, | ||
"ghcr.io/devcontainers/features/azure-cli": {}, | ||
"azure-cli-persistence": {} | ||
} | ||
}, | ||
"fish_shell": { | ||
"image": "mcr.microsoft.com/devcontainers/base:debian", | ||
"features": { | ||
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {}, | ||
"ghcr.io/devcontainers/features/azure-cli": {}, | ||
"azure-cli-persistence": {} | ||
} | ||
}, | ||
"root_user": { | ||
"image": "mcr.microsoft.com/devcontainers/base:debian", | ||
"features": { | ||
"ghcr.io/devcontainers/features/azure-cli": {}, | ||
"azure-cli-persistence": {} | ||
}, | ||
"remoteUser": "root" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# NOTE: azure is not installed inside the `test.sh` run | ||
# see: test/github-cli-persistence/test.sh | ||
|
||
|
||
# check that `~/.azure` and `/dc/azure-cli` exist` | ||
check "~/.azure existence" bash -c "ls -la ~ | grep '.azure'" | ||
check "/dc/azure-cli existence" bash -c "ls -la /dc | grep 'azure-cli'" | ||
|
||
# check that `~/.azure` is a symlink | ||
# https://unix.stackexchange.com/a/96910 | ||
check "~/.azure is a symlink" bash -c "test -L ~/.azure && test -d ~/.azure" | ||
|
||
# Report result | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Run default test script (in same folder) | ||
# See: https://github.com/devcontainers/features/blob/562305d37b97d47331d96306ffc2a0a3cce55e64/test/azure-cli/install_extensions_bookworm.sh | ||
./_default.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Run default test script (in same folder) | ||
# See: https://github.com/devcontainers/features/blob/562305d37b97d47331d96306ffc2a0a3cce55e64/test/azure-cli/install_extensions_bookworm.sh | ||
./_default.sh |