From dcbd98f08ea034f90c06946af95387d55550efcb Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Wed, 1 Mar 2023 19:19:02 +0000 Subject: Run project tests as non-root user --- test/dotnet/build_dotnet_7.sh | 2 ++ test/dotnet/run_dotnet_7.sh | 2 ++ test/dotnet/scenarios.json | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/dotnet/build_dotnet_7.sh b/test/dotnet/build_dotnet_7.sh index 62e950c..813282c 100644 --- a/test/dotnet/build_dotnet_7.sh +++ b/test/dotnet/build_dotnet_7.sh @@ -4,6 +4,8 @@ set -e source dev-container-features-test-lib +check "non-root user" test "$(id -u)" -ne 0 + pushd example_project check "dotnet restore" dotnet restore check "dotnet build" dotnet build diff --git a/test/dotnet/run_dotnet_7.sh b/test/dotnet/run_dotnet_7.sh index ea66bd4..cde1d9d 100644 --- a/test/dotnet/run_dotnet_7.sh +++ b/test/dotnet/run_dotnet_7.sh @@ -4,6 +4,8 @@ set -e source dev-container-features-test-lib +check "non-root user" test "$(id -u)" -ne 0 + pushd example_project check "dotnet run" bash -c "dotnet run | grep 'Inception'" diff --git a/test/dotnet/scenarios.json b/test/dotnet/scenarios.json index f4127f2..45a268f 100644 --- a/test/dotnet/scenarios.json +++ b/test/dotnet/scenarios.json @@ -58,7 +58,8 @@ } }, "build_dotnet_7": { - "image": "ubuntu:jammy", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "remoteUser": "vscode", "features": { "dotnet": { "version": "7" @@ -66,7 +67,8 @@ } }, "run_dotnet_7": { - "image": "ubuntu:jammy", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "remoteUser": "vscode", "features": { "dotnet": { "version": "7" -- cgit v1.2.3