config="default"
fi
+if [ ! -z "${LTESTS}" ]; then
+ OVERRIDE_LTESTS="${LTESTS}"
+fi
+
unset CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
TEST_TARGET="tests compat-tests"
TCMALLOC_STACKTRACE_METHOD=generic_fp
TEST_SSH_SSHD_ENV="TCMALLOC_STACKTRACE_METHOD=generic_fp"
export TCMALLOC_STACKTRACE_METHOD TEST_SSH_SSHD_ENV
+
+ SKIP_LTESTS="agent-restrict"
;;
krb5|heimdal)
CONFIGFLAGS="--with-kerberos5"
export REGRESS_INTEROP_PUTTY
fi
+if [ ! -z "${OVERRIDE_LTESTS}" ]; then
+ echo >&2 "Overriding LTESTS, was '${LTESTS}', now '${OVERRIDE_LTESTS}'"
+ LTESTS="${OVERRIDE_LTESTS}"
+fi
+
export CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
export TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS TEST_SSH_FAIL_FATAL
PACKAGES=""
+echo Running as:
+id
+
+echo Environment:
+set
+
. .github/configs ${config}
host=`./config.guess`
/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.
- pw=$(openssl rand -base64 9)
+# 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.
+ openssl rand -base64 9 >regress/password
+ pw=$(tr -d '\n' <regress/password | openssl passwd -6 -stdin)
sudo usermod --password "${pw}" runner
sudo usermod --unlock runner
;;
-esac
+ esac
+fi
name: C/C++ CI
+# For testing, you can set variables in your repo (Repo -> Settings ->
+# Security -> Actions -> Variables) to restrict the tests that are run.
+# The supported variables are:
+#
+# RUN_ONLY_TARGET_CONFIG: Run only the single matching target and config,
+# separated by spaces, eg "ubuntu-latest default". All other tests will
+# fail immediately.
+#
+# LTESTS: Override the set of tests run.
+
on:
push:
paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/c-cpp.yml' ]
- { target: macos-15, config: pam }
runs-on: ${{ matrix.target }}
steps:
- - name: check RUN_ONLY_TEST
- # For testing, you can set the repo variable RUN_ONLY_TEST in your repo
- # (Repo -> Settings -> Security -> Actions -> Variables) to run only
- # that test config.
- if: vars.RUN_ONLY_TEST != ''
- run: sh -c 'if [ "${{ vars.RUN_ONLY_TEST }}" != "${{ matrix.target }} ${{matrix.config }}" ]; then exit 1; else exit 0; fi'
+ - 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'
- name: set cygwin git params
if: ${{ startsWith(matrix.target, 'windows') }}
run: git config --global core.autocrlf input
env:
TEST_SSH_UNSAFE_PERMISSIONS: 1
TEST_SSH_HOSTBASED_AUTH: yes
+ LTESTS: ${{ vars.LTESTS }}
- name: show logs
if: failure()
run: for i in regress/failed*.log; do echo ====; echo logfile $i; echo =====; cat $i; done
+ - name: chown logs
+ if: failure()
+ run: test -x "$(which sudo 2>&1)" && sudo chown -R "${LOGNAME}" regress
- name: save logs
if: failure()
uses: actions/upload-artifact@main
path: |
config.h
config.log
- regress/*.log
- regress/valgrind-out/
- regress/asan.log.*
- regress/msan.log.*
- regress/log/*
+ regress/
runs-on: ${{ matrix.host }}
timeout-minutes: 600
env:
- DEBUG_ACTIONS: false
HOST: ${{ matrix.host }}
TARGET_HOST: ${{ matrix.target }}
TARGET_CONFIG: ${{ matrix.config }}
- obsd51
- obsd67
- obsd72
- - obsd73
- obsd74
+ - obsd76
+ - obsd77
- obsdsnap
- obsdsnap-i386
- omnios
if: github.repository == 'openssh/openssh-portable-selfhosted'
runs-on: ${{ matrix.host }}
env:
- DEBUG_ACTIONS: true
EPHEMERAL: true
HOST: ${{ matrix.host }}
TARGET_HOST: ${{ matrix.target }}
run: sshfs_mount
working-directory: ${{ runner.temp }}
- name: update source
- run: vmrun "cd /usr/src && cvs up -dPA usr.bin/ssh regress/usr.bin/ssh"
+ run: vmrun "cd /usr/src && cvs -q up -dPA usr.bin/ssh regress/usr.bin/ssh usr.bin/nc"
+ - name: update netcat
+ run: vmrun "cd /usr/src/usr.bin/nc && make clean all && sudo make install"
- name: make clean
run: vmrun "cd /usr/src/usr.bin/ssh && make obj && make clean && cd /usr/src/regress/usr.bin/ssh && make obj && make clean && sudo chmod -R g-w /usr/src /usr/obj"
- name: make