From fb0dac65069d11d83056d89bec1edf46dd9d7977 Mon Sep 17 00:00:00 2001 From: guzman-raphael Date: Tue, 11 Oct 2022 07:06:51 -0500 Subject: [PATCH] Allow creating in main when uid changes at startup. --- dist/alpine/Dockerfile | 1 + dist/debian/Dockerfile | 1 + tests/main.sh | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dist/alpine/Dockerfile b/dist/alpine/Dockerfile index 5786be1..d59690a 100644 --- a/dist/alpine/Dockerfile +++ b/dist/alpine/Dockerfile @@ -66,6 +66,7 @@ RUN \ export uid=3000 gid=$(awk -F':' '/^anaconda/{print $3}' /etc/group) && \ mkdir -p /home/anaconda && \ mkdir /main && \ + chmod g+w /main && \ echo "anaconda:x:${uid}:${gid}:Developer,,,:/home/anaconda:/bin/sh" >> /etc/passwd && \ # echo "anaconda:x:${uid}:" >> /etc/group && \ chown ${uid}:${gid} -R /home/anaconda && \ diff --git a/dist/debian/Dockerfile b/dist/debian/Dockerfile index df66a8c..cb43d34 100644 --- a/dist/debian/Dockerfile +++ b/dist/debian/Dockerfile @@ -19,6 +19,7 @@ RUN \ export uid=3000 gid=$(awk -F':' '/^anaconda/{print $3}' /etc/group) && \ mkdir -p /home/anaconda && \ mkdir /main && \ + chmod g+w /main && \ echo "anaconda:x:${uid}:${gid}:Developer,,,:/home/anaconda:/bin/bash"\ >> /etc/passwd && \ # echo "anaconda:x:${uid}:" >> /etc/group && \ diff --git a/tests/main.sh b/tests/main.sh index b34232f..6c2a808 100755 --- a/tests/main.sh +++ b/tests/main.sh @@ -13,9 +13,11 @@ assert () if ! eval "$2"; then echo "Assertion ($1) failed: \"$2\"" echo "File \"$0\", line $lineno" + echo "---------------- TEST[$SHELL_CMD_FLAGS]: $1 ❌ ----------------" | \ + tr -d '\t' exit $E_ASSERT_FAILED else - echo "---------------- TEST[$SHELL_CMD_FLAGS]: $1 ✔️ ----------------" | \ + echo "---------------- TEST[$SHELL_CMD_FLAGS]: $1 ✅ ----------------" | \ tr -d '\t' fi } @@ -35,6 +37,8 @@ validate () { assert "username" "[ $($SHELL_CMD "id -u -n") == anaconda ]" $LINENO assert "default group" "[ $($SHELL_CMD "id -g -n") == anaconda ]" $LINENO assert "home" "[ $($SHELL_CMD "cd ~ && pwd") == '/home/anaconda' ]" $LINENO + assert "create in main" "[ $($SHELL_CMD \ + "touch /main/something && echo works") == works ]" $LINENO assert "conda channel priority config" "[ $($SHELL_CMD 'eval "$(cat)"' <<-END conda config --show channel_priority | awk -F': ' '{print \$2}' END