diff --git a/.github/workflows/test_docker_debian_codename_sub_v3.yml b/.github/workflows/test_docker_debian_codename_sub_v3.yml index 2013e8dca..6ad75a6b2 100644 --- a/.github/workflows/test_docker_debian_codename_sub_v3.yml +++ b/.github/workflows/test_docker_debian_codename_sub_v3.yml @@ -27,6 +27,10 @@ on: type: string default: ubuntu-latest +env: + TEST_USER_NAME: hans + TEST_USER_GROUP: wurst + # let only one instance run the test so cache is not corrupted. # cancel already running instances as only the last run will be relevant concurrency: @@ -101,6 +105,8 @@ jobs: cache-to: type=gha,mode=max,scope=${{ steps.vars.outputs.cache_scope }} build-args: | DEBIAN_CODENAME=${{ inputs.debian_codename }} + USER_NAME=${{ env.TEST_USER_NAME }} + USER_GROUP=${{ env.TEST_USER_GROUP }} GIT_BRANCH=${{ github.head_ref || github.ref_name }} GIT_USER=${{ github.event.pull_request.head.user.login || github.repository_owner }} @@ -137,7 +143,6 @@ jobs: strategy: fail-fast: false matrix: - username: ['hans'] test_script: ['run_install_common.sh', 'run_install_faststartup.sh', 'run_install_webapp_local.sh', 'run_install_webapp_download.sh'] steps: @@ -157,11 +162,11 @@ jobs: docker load --input ${{ needs.build.outputs.image_file_name }} # Run test - - name: Run Test ${{ inputs.debian_codename }}-${{ matrix.username }}-${{ matrix.test_script }} + - name: Run Test ${{ inputs.debian_codename }}-${{ env.TEST_USER_NAME }}-${{ matrix.test_script }} uses: tj-actions/docker-run@v2 with: image: ${{ needs.build.outputs.image_tag_name }} - options: --platform ${{ inputs.platform }} --user ${{ matrix.username }} --init + options: --platform ${{ inputs.platform }} --user ${{ env.TEST_USER_NAME }} --init name: ${{ matrix.test_script }} args: | ./${{ matrix.test_script }} diff --git a/ci/ci-debian.Dockerfile b/ci/ci-debian.Dockerfile index 1a227755a..2a0c593fd 100644 --- a/ci/ci-debian.Dockerfile +++ b/ci/ci-debian.Dockerfile @@ -40,8 +40,8 @@ RUN echo "--- install packages (1) ---" \ RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections # ------ -# Base Target for setting up the default user. user can be selected with the docker '--user YYY' option -FROM base as user +# Base Target for setting up a test user. user can be selected with the docker '--user YYY' option +FROM base as test-user ARG USER_NAME=pi ARG USER_GROUP=$USER_NAME ARG USER_ID=1000 @@ -56,18 +56,6 @@ RUN groupadd --gid 1000 $USER_GROUP \ ENV XDG_RUNTIME_DIR=/run/user/$USER_ID DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$USER_ID/bus # ------ - -# Target for setting up an alternativ user 'hans:wurst'. user can be selected with the docker '--user YYY' option -FROM user as test-user - -RUN export USER_ALT=hans \ - && export USER_ALT_GROUP=wurst \ - && groupadd --gid 1001 $USER_ALT_GROUP \ - && useradd -u 1001 -g $USER_ALT_GROUP -G sudo,$TEST_USER_GROUP -d /home/$USER_ALT -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' $USER_ALT \ - && echo "$USER_ALT ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER_ALT -# ------ - - # Target for adding envs and scripts from the repo to test installation FROM test-user as test-code ARG GIT_BRANCH