aboutsummaryrefslogtreecommitdiff
path: root/test/nix/packages.sh
diff options
context:
space:
mode:
authorChuck Lantz <clantz@microsoft.com>2022-11-01 20:02:02 +0300
committerGitHub <noreply@github.com>2022-11-01 20:02:02 +0300
commit0752a52b0c8ac76448666822938dce8f4d55bb69 (patch)
tree39abf9124899027643a68e5d33afc78f92ecedd9 /test/nix/packages.sh
parent748be9320c99cbf6e6a2885d3b5dcc39e7ad3b78 (diff)
Nix feature (#228)
Diffstat (limited to 'test/nix/packages.sh')
-rwxr-xr-xtest/nix/packages.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/nix/packages.sh b/test/nix/packages.sh
new file mode 100755
index 0000000..ad896e9
--- /dev/null
+++ b/test/nix/packages.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -e
+
+# Optional: Import test library bundled with the devcontainer CLI
+source dev-container-features-test-lib
+
+uid="$(id -u)"
+echo "Current user UID is ${uid}."
+if [ "${uid}" != "1000" ]; then
+ echo "Current user UID was adjusted."
+fi
+set +e
+vscode_uid="$(id -u vscode)"
+set -e
+if [ "${vscode_uid}" != "" ]; then
+ echo "User vscode UID is ${vscode_uid}."
+ if [ "${vscode_uid}" != "1000" ]; then
+ echo "User vscode UID was adjusted."
+ fi
+fi
+nix_uid="$(stat /nix -c "%u")"
+echo "/nix UID is ${nix_uid}."
+
+cat /etc/os-release
+
+# Feature-specific tests
+# The 'check' command comes from the dev-container-features-test-lib.
+check "nix-env" type nix-env
+check "vim_installed" type vim
+check "node_installed" type node
+check "yarn_installed" type yarn
+
+# Report result
+# If any of the checks above exited with a non-zero exit code, the test will fail.
+reportResults &2>1 \ No newline at end of file