From: Darren Tucker Date: Sun, 29 Jun 2025 01:14:18 +0000 (+1000) Subject: Enable password tests on Github ephemeral VMs. X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a9384de483b8fb69a800e0347273686a5715fc3;p=thirdparty%2Fopenssh-portable.git Enable password tests on Github ephemeral VMs. --- diff --git a/.github/setup_ci.sh b/.github/setup_ci.sh index 5e778d377..598b0624a 100755 --- a/.github/setup_ci.sh +++ b/.github/setup_ci.sh @@ -299,12 +299,20 @@ if [ ! -z "${INSTALL_PUTTY}" ]; then /usr/local/bin/plink -V fi -# This is the github "target" as specificed in the yml file. -case "${target}" in -ubuntu-latest) - echo ubuntu-latest target: setting random password string. +# If we're running on an ephemeral VM, set a random password and set +# up to run the password auth test. +if [ ! -z "${EPHEMERAL_VM}" ]; then + + # This is the github "target" as specified in the yml file. + # In particular, ubuntu-latest sets the password field to the locked + # value, so unless we reset it here most of the tests will fail. + case "${target}" in + ubuntu-*) + echo ${target} target: setting random password string. pw=$(openssl rand -base64 9) sudo usermod --password "${pw}" runner sudo usermod --unlock runner + echo "${pw}" > regress/password ;; -esac + esac +fi diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 7ee179646..82087c057 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -121,6 +121,8 @@ jobs: - { target: macos-15, config: pam } runs-on: ${{ matrix.target }} steps: + - env: + EPHEMERAL_VM: yes - name: check RUN_ONLY_TARGET_CONFIG if: vars.RUN_ONLY_TARGET_CONFIG != '' run: sh -c 'if [ "${{ vars.RUN_ONLY_TARGET_CONFIG }}" != "${{ matrix.target }} ${{matrix.config }}" ]; then exit 1; else exit 0; fi'