blob: 724213b24728f9fa445f227a96376ae48089d222 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
cat /etc/nix/nix.conf
# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib.
check "nix-env" type nix-env
check "First added line" grep -E '^extra-substituters = https://foo\.cachix\.org$' /etc/nix/nix.conf
check "Second added line" grep -E '^extra-trusted-public-keys = foo\.cachix\.org-1:bar=$' /etc/nix/nix.conf
# Report result
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults &2>1
|