Skip to content

Commit 27d8b7e

Browse files
authored
Merge pull request #128 from rapier1/dev_minor
Fixes to CI system
2 parents 7351c8c + e3d333c commit 27d8b7e

File tree

8 files changed

+151
-54
lines changed

8 files changed

+151
-54
lines changed

.github/configs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ if [ "$config" = "" ]; then
1313
config="default"
1414
fi
1515

16+
if [ ! -z "${LTESTS}" ]; then
17+
OVERRIDE_LTESTS="${LTESTS}"
18+
fi
19+
1620
unset CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
1721

1822
TEST_TARGET="tests compat-tests"
@@ -144,6 +148,8 @@ case "$config" in
144148
TCMALLOC_STACKTRACE_METHOD=generic_fp
145149
TEST_SSH_SSHD_ENV="TCMALLOC_STACKTRACE_METHOD=generic_fp"
146150
export TCMALLOC_STACKTRACE_METHOD TEST_SSH_SSHD_ENV
151+
152+
SKIP_LTESTS="agent-restrict"
147153
;;
148154
krb5|heimdal)
149155
CONFIGFLAGS="--with-kerberos5"
@@ -165,6 +171,13 @@ case "$config" in
165171
CONFIGFLAGS="--with-pam"
166172
SSHD_CONFOPTS="UsePam yes"
167173
;;
174+
boringssl)
175+
CONFIGFLAGS="--disable-pkcs11"
176+
LIBCRYPTOFLAGS="--with-ssl-dir=/opt/boringssl --with-rpath=-Wl,-rpath,"
177+
;;
178+
aws-lc)
179+
LIBCRYPTOFLAGS="--with-ssl-dir=/opt/aws-lc --with-rpath=-Wl,-rpath,"
180+
;;
168181
libressl-*)
169182
LIBCRYPTOFLAGS="--with-ssl-dir=/opt/libressl --with-rpath=-Wl,-rpath,"
170183
;;
@@ -282,7 +295,7 @@ case "${TARGET_HOST}" in
282295
# Native linker is not great with PIC so OpenSSL is built w/out.
283296
CONFIGFLAGS="${CONFIGFLAGS} --disable-security-key"
284297
;;
285-
fbsd14-ppc64)
298+
fbsd14-ppc64|nbsd-arm64be)
286299
# Disable security key tests for bigendian interop test.
287300
CONFIGFLAGS="${CONFIGFLAGS} --disable-security-key"
288301
;;
@@ -342,9 +355,6 @@ case "${TARGET_HOST}" in
342355
# No sudo on Windows.
343356
SUDO=""
344357
;;
345-
windows*)
346-
SUDO=""
347-
;;
348358
esac
349359

350360
host=`./config.guess`
@@ -400,5 +410,10 @@ if [ -x "$(which plink 2>/dev/null)" ]; then
400410
export REGRESS_INTEROP_PUTTY
401411
fi
402412

413+
if [ ! -z "${OVERRIDE_LTESTS}" ]; then
414+
echo >&2 "Overriding LTESTS, was '${LTESTS}', now '${OVERRIDE_LTESTS}'"
415+
LTESTS="${OVERRIDE_LTESTS}"
416+
fi
417+
403418
export CC CFLAGS CPPFLAGS LDFLAGS LTESTS SUDO
404419
export TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS TEST_SSH_FAIL_FATAL

.github/configure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ if [ "x$LDFLAGS" != "x" ]; then
1818
fi
1919

2020
echo ./configure ${CONFIGFLAGS} --with-privsep-user=sshd
21-
./configure ${CONFIGFLAGS} --with-privsep-user=sshd
21+
./configure ${CONFIGFLAGS} --with-privsep-user=sshd 2>&1

.github/run_test.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if [ ! -z "$SUDO" ] && [ ! -z "$TEST_SSH_HOSTBASED_AUTH" ]; then
1212
$SUDO mkdir -p "${sshconf}"
1313
hostname | $SUDO tee $sshconf/shosts.equiv >/dev/null
1414
echo "EnableSSHKeysign yes" | $SUDO tee $sshconf/ssh_config >/dev/null
15+
$SUDO mkdir -p $sshconf
1516
$SUDO cp -p /etc/ssh/ssh_host*key* $sshconf
1617
$SUDO make install
1718
for key in $sshconf/ssh_host*key*.pub; do
@@ -20,18 +21,6 @@ if [ ! -z "$SUDO" ] && [ ! -z "$TEST_SSH_HOSTBASED_AUTH" ]; then
2021
done
2122
fi
2223

23-
output_failed_logs() {
24-
for i in regress/failed*.log; do
25-
if [ -f "$i" ]; then
26-
echo -------------------------------------------------------------------------
27-
echo LOGFILE $i
28-
cat $i
29-
echo -------------------------------------------------------------------------
30-
fi
31-
done
32-
}
33-
trap output_failed_logs 0
34-
3524
env=""
3625
if [ ! -z "${SUDO}" ]; then
3726
env="${env} SUDO=${SUDO}"

.github/setup_ci.sh

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
11
#!/bin/sh
22

3+
config="$1"
4+
target="$2"
5+
36
PACKAGES=""
47

5-
. .github/configs $@
8+
echo Running as:
9+
id
10+
11+
echo Environment:
12+
set
13+
14+
. .github/configs ${config}
615

716
host=`./config.guess`
817
echo "config.guess: $host"
918
case "$host" in
1019
*cygwin)
1120
PACKAGER=setup
1221
echo Setting CYGWIN system environment variable.
13-
setx CYGWIN "binmode"
22+
setx CYGWIN "winsymlinks:native"
1423
echo Removing extended ACLs so umask works as expected.
24+
set -x
1525
setfacl -b . regress
26+
icacls regress /c /t /q /Inheritance:d
27+
icacls regress /c /t /q /Grant ${USERNAME}:F
28+
icacls regress /c /t /q /Remove:g "Authenticated Users" \
29+
BUILTIN\\Administrators BUILTIN Everyone System Users
30+
takeown /F regress
31+
icacls regress
32+
set +x
1633
PACKAGES="$PACKAGES,autoconf,automake,cygwin-devel,gcc-core"
1734
PACKAGES="$PACKAGES,make,openssl,libssl-devel,zlib-devel"
1835
;;
@@ -24,10 +41,9 @@ case "$host" in
2441
PACKAGER=apt
2542
esac
2643

27-
TARGETS=$@
44+
TARGETS=${config}
2845

2946
INSTALL_FIDO_PPA="no"
30-
#COPY_PAM_MODULE="no"
3147
export DEBIAN_FRONTEND=noninteractive
3248

3349
set -e
@@ -139,6 +155,14 @@ for TARGET in $TARGETS; do
139155
esac
140156
PACKAGES="${PACKAGES} putty-tools dropbear-bin"
141157
;;
158+
boringssl)
159+
INSTALL_BORINGSSL=1
160+
PACKAGES="${PACKAGES} cmake ninja-build"
161+
;;
162+
aws-lc)
163+
INSTALL_AWSLC=1
164+
PACKAGES="${PACKAGES} cmake ninja-build"
165+
;;
142166
putty-*)
143167
INSTALL_PUTTY=$(echo "${TARGET}" | cut -f2 -d-)
144168
PACKAGES="${PACKAGES} cmake"
@@ -160,14 +184,6 @@ if [ "yes" = "$INSTALL_FIDO_PPA" ]; then
160184
sudo apt-add-repository -y ppa:yubico/stable
161185
fi
162186

163-
#need to copy the pam modules for sshd to hpnsshd on
164-
#macos with pam.
165-
#if [ "yes" = "$COPY_PAM_MODULE" ]; then
166-
# if [ `uname` = "Darwin" }; then
167-
# sudo cp /etc/pam.d/sshd /etc/pam.d/hpnsshd
168-
# fi
169-
#fi
170-
171187
tries=3
172188
while [ ! -z "$PACKAGES" ] && [ "$tries" -gt "0" ]; do
173189
case "$PACKAGER" in
@@ -185,7 +201,8 @@ while [ ! -z "$PACKAGES" ] && [ "$tries" -gt "0" ]; do
185201
fi
186202
;;
187203
setup)
188-
if /cygdrive/c/setup.exe -q -P `echo "$PACKAGES" | tr ' ' ,`; then
204+
setup="/cygdrive/$(echo "${CYGWIN_SETUP}" | tr -d : | tr '\' '/')"
205+
if "${setup}" -q -P `echo "$PACKAGES" | tr ' ' ,`; then
189206
PACKAGES=""
190207
fi
191208
;;
@@ -236,6 +253,24 @@ if [ ! -z "${INSTALL_LIBRESSL}" ]; then
236253
fi
237254
fi
238255

256+
if [ ! -z "${INSTALL_BORINGSSL}" ]; then
257+
(cd ${HOME} && git clone https://boringssl.googlesource.com/boringssl &&
258+
cd ${HOME}/boringssl && mkdir build && cd build &&
259+
cmake -GNinja -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. && ninja &&
260+
mkdir -p /opt/boringssl/lib &&
261+
cp ${HOME}/boringssl/build/libcrypto.a /opt/boringssl/lib &&
262+
cp -r ${HOME}/boringssl/include /opt/boringssl)
263+
fi
264+
265+
if [ ! -z "${INSTALL_AWSLC}" ]; then
266+
(cd ${HOME} && git clone --depth 1 --branch v1.46.1 https://github.com/aws/aws-lc.git &&
267+
cd ${HOME}/aws-lc && mkdir build && cd build &&
268+
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF .. && ninja &&
269+
mkdir -p /opt/aws-lc/lib &&
270+
cp ${HOME}/aws-lc/build/crypto/libcrypto.a /opt/aws-lc/lib &&
271+
cp -r ${HOME}/aws-lc/include /opt/aws-lc)
272+
fi
273+
239274
if [ ! -z "${INSTALL_ZLIB}" ]; then
240275
(cd ${HOME} && git clone https://github.com/madler/zlib.git &&
241276
cd ${HOME}/zlib && ./configure && make &&
@@ -263,3 +298,21 @@ if [ ! -z "${INSTALL_PUTTY}" ]; then
263298
)
264299
/usr/local/bin/plink -V
265300
fi
301+
302+
# If we're running on an ephemeral VM, set a random password and set
303+
# up to run the password auth test.
304+
if [ ! -z "${EPHEMERAL_VM}" ]; then
305+
306+
# This is the github "target" as specified in the yml file.
307+
# In particular, ubuntu-latest sets the password field to the locked
308+
# value, so unless we reset it here most of the tests will fail.
309+
case "${target}" in
310+
ubuntu-*)
311+
echo ${target} target: setting random password.
312+
openssl rand -base64 9 >regress/password
313+
pw=$(tr -d '\n' <regress/password | openssl passwd -6 -stdin)
314+
sudo usermod --password "${pw}" runner
315+
sudo usermod --unlock runner
316+
;;
317+
esac
318+
fi

.github/workflows/c-cpp.yml

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
name: C/C++ CI
22

3+
# For testing, you can set variables in your repo (Repo -> Settings ->
4+
# Security -> Actions -> Variables) to restrict the tests that are run.
5+
# The supported variables are:
6+
#
7+
# RUN_ONLY_TARGET_CONFIG: Run only the single matching target and config,
8+
# separated by spaces, eg "ubuntu-latest default". All other tests will
9+
# fail immediately.
10+
#
11+
# LTESTS: Override the set of tests run.
12+
313
on:
414
push:
5-
branches: [ master, pre-stage, release_candidates, dev_major, dev_minor ]
15+
branches: [ master, dev_major, dev_minor ]
616
paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/c-cpp.yml' ]
717
pull_request:
8-
branches: [ master, release_candidates ]
18+
branches: [ master, dev_major, dev_minor ]
919
paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/c-cpp.yml' ]
1020

1121
jobs:
@@ -18,21 +28,22 @@ jobs:
1828
# First we test all OSes in the default configuration.
1929
target:
2030
- ubuntu-22.04
21-
- ubuntu-24.04
31+
- ubunut-24.04
2232
- ubuntu-latest
2333
- ubuntu-22.04-arm
2434
- ubuntu-24.04-arm
2535
- macos-13
2636
- macos-14
2737
- macos-15
28-
- windows-2019
2938
- windows-2022
39+
- windows-2025
3040
config: [default]
3141
# Then we include any extra configs we want to test for specific VMs.
42+
# Valgrind slows things down quite a bit, so start them first.
3243
include:
33-
- { target: windows-2019, config: cygwin-release }
3444
- { target: windows-2022, config: cygwin-release }
35-
# binn.c no longer works with c89 so remove this test.
45+
- { target: windows-2025, config: cygwin-release }
46+
# binn no longer supports c89 so skip.
3647
# - { target: ubuntu-22.04, config: c89 }
3748
- { target: ubuntu-22.04, config: clang-11 }
3849
- { target: ubuntu-22.04, config: clang-12-Werror }
@@ -56,15 +67,26 @@ jobs:
5667
- { target: ubuntu-22.04, config: valgrind-2 }
5768
- { target: ubuntu-22.04, config: valgrind-3 }
5869
- { target: ubuntu-22.04, config: valgrind-4 }
59-
# - { target: ubuntu-22.04, config: valgrind-5 }
70+
- { target: ubuntu-22.04, config: valgrind-5 }
6071
- { target: ubuntu-22.04, config: valgrind-6 }
6172
- { target: ubuntu-22.04, config: valgrind-7 }
6273
- { target: ubuntu-22.04, config: valgrind-unit }
6374
- { target: ubuntu-22.04, config: without-openssl }
6475
- { target: ubuntu-latest, config: gcc-14 }
6576
- { target: ubuntu-latest, config: clang-15 }
6677
- { target: ubuntu-latest, config: clang-19 }
78+
# these don't support our crypto methods
79+
# - { target: ubuntu-latest, config: boringssl }
80+
# - { target: ubuntu-latest, config: aws-lc }
6781
- { target: ubuntu-latest, config: libressl-master }
82+
# We don't support libreSSL earlier than 3.7 due to problems with
83+
# the structures used by the aes-ctr mt cipher that wasn't address
84+
# before 3.7
85+
# - { target: ubuntu-latest, config: libressl-3.2.6 }
86+
# - { target: ubuntu-latest, config: libressl-3.3.6 }
87+
# - { target: ubuntu-latest, config: libressl-3.4.3 }
88+
# - { target: ubuntu-latest, config: libressl-3.5.3 }
89+
# - { target: ubuntu-latest, config: libressl-3.6.1 }
6890
- { target: ubuntu-latest, config: libressl-3.7.2 }
6991
- { target: ubuntu-latest, config: libressl-3.8.4 }
7092
- { target: ubuntu-latest, config: libressl-3.9.2 }
@@ -102,26 +124,36 @@ jobs:
102124
- { target: ubuntu-latest, config: putty-snapshot }
103125
- { target: ubuntu-latest, config: zlib-develop }
104126
- { target: ubuntu-latest, config: tcmalloc }
105-
# musl doesn't work because it doesn't know about linux/tcp.h
106-
# - { target: ubuntu-latest, config: musl }
127+
#musl doens't know about linux/tcp.h so skip
128+
# - { target: ubuntu-latest, config: musl }
107129
- { target: ubuntu-22.04-arm, config: kitchensink }
108130
- { target: ubuntu-24.04-arm, config: kitchensink }
109-
# we know pam doesn't work because we can't install a new pam file
110-
# for hpnssh via the CI test methods
111-
# - { target: macos-13, config: pam }
112-
# - { target: macos-14, config: pam }
113-
# - { target: macos-15, config: pam }
131+
# Can't copy the necessary pam file in darwin without
132+
# user interaction so skip these
133+
# - { target: macos-13, config: pam }
134+
# - { target: macos-14, config: pam }
135+
# - { target: macos-15, config: pam }
114136
runs-on: ${{ matrix.target }}
137+
env:
138+
EPHEMERAL_VM: yes
115139
steps:
140+
- name: check RUN_ONLY_TARGET_CONFIG
141+
if: vars.RUN_ONLY_TARGET_CONFIG != ''
142+
run: sh -c 'if [ "${{ vars.RUN_ONLY_TARGET_CONFIG }}" != "${{ matrix.target }} ${{matrix.config }}" ]; then exit 1; else exit 0; fi'
116143
- name: set cygwin git params
117144
if: ${{ startsWith(matrix.target, 'windows') }}
118145
run: git config --global core.autocrlf input
119146
- name: install cygwin
147+
id: cygwin_install
120148
if: ${{ startsWith(matrix.target, 'windows') }}
121149
uses: cygwin/cygwin-install-action@master
150+
env:
151+
CYGWIN: "winsymlinks:native"
122152
- uses: actions/checkout@main
123153
- name: setup CI system
124-
run: sh ./.github/setup_ci.sh ${{ matrix.config }}
154+
run: sh ./.github/setup_ci.sh ${{ matrix.config }} ${{ matrix.target }}
155+
env:
156+
CYGWIN_SETUP: ${{ steps.cygwin_install.outputs.setup }}
125157
- name: autoreconf
126158
run: sh -c autoreconf
127159
- name: configure
@@ -140,6 +172,13 @@ jobs:
140172
env:
141173
TEST_SSH_UNSAFE_PERMISSIONS: 1
142174
TEST_SSH_HOSTBASED_AUTH: yes
175+
LTESTS: ${{ vars.LTESTS }}
176+
- name: show logs
177+
if: failure()
178+
run: for i in regress/failed*.log; do echo ====; echo logfile $i; echo =====; cat $i; done
179+
- name: chown logs
180+
if: failure()
181+
run: test -x "$(which sudo 2>&1)" && sudo chown -R "${LOGNAME}" regress
143182
- name: save logs
144183
if: failure()
145184
uses: actions/upload-artifact@main
@@ -148,8 +187,4 @@ jobs:
148187
path: |
149188
config.h
150189
config.log
151-
regress/*.log
152-
regress/valgrind-out/
153-
regress/asan.log.*
154-
regress/msan.log.*
155-
regress/log/*
190+
regress/

0 commit comments

Comments
 (0)