Commit Graph

176 Commits

Author SHA1 Message Date
dtucker@openbsd.org
1b05d5437b
upstream: Remove sshd logfile in start_sshd
... and ssh and sshd log wrappers before recreating them.  Prevents "can't
create" errors during tests when running tests without SUDO after having
run them with SUDO.

OpenBSD-Regress-ID: 2f0a83532e3dccd673a9bf0291090277268c69a6
2024-10-22 19:19:26 +11:00
djm@openbsd.org
74856204a3
upstream: regress support for split sshd-auth binary
OpenBSD-Regress-ID: df7d18a87b475f70004770f0f4e404adba5f6ab7
2024-10-14 14:03:07 +11:00
dtucker@openbsd.org
8de2c8cebc
upstream: Remove dropbear key types not supported
by current OpenSSH. Allows subsequent test runs to work if OpenSSH is
rebuilt w/out OpenSSL.

OpenBSD-Regress-ID: e0129eb2b1d31771105903a8055216fbba20a770
2024-06-20 18:34:35 +10:00
dtucker@openbsd.org
dbd3b833f6
upstream: Rework dropbear key setup
to always generate ed25519 keys, other types only if OpenSSH has support
for the corresponding key type.

OpenBSD-Regress-ID: 8f91f12604cddb9f8d93aa34f3f93a3f6074395d
2024-06-19 20:36:56 +10:00
dtucker@openbsd.org
de1c2e70e5
upstream: Re-enable ssh-dss tests
... if ssh is compiled with DSA support

OpenBSD-Regress-ID: bbfaf8c17f2b50a2d46ac35cb97af99b990c990d
2024-06-18 19:57:41 +10:00
anton@openbsd.org
dabc2c7cf3
upstream: Stop using DSA in dropbear interop tests.
OpenBSD-Regress-ID: abfd4457d99d8cc1417fd22ca2c570270f74c1cf
2024-06-18 19:57:36 +10:00
djm@openbsd.org
b0a711c00b
upstream: fix PIDFILE handling, broken for SUDO=doas in last commit
here

OpenBSD-Regress-ID: 96fec579af228f87a036e94801eb294af9074625
2024-06-11 12:02:37 +10:00
djm@openbsd.org
b8ebd86cef
upstream: make sure logs are saved from sshd run via start_sshd
OpenBSD-Regress-ID: de4ef0e32e3ab85ff3a6c36eb08d1909c0dd1b4a
2024-06-07 05:54:15 +10:00
djm@openbsd.org
d7b2070bda
upstream: simplify
OpenBSD-Regress-ID: 50316e0d1ae0c0a057a45af042253e54ce23d11c
2024-06-07 05:54:14 +10:00
djm@openbsd.org
e6ea3d2245
upstream: prepare for PerSourcePenalties being enabled by default
in future

OpenBSD-Regress-ID: 5236c6d1c823997aac5a35e2915da30f1903bec7
2024-06-07 05:52:59 +10:00
djm@openbsd.org
b88b690e99
upstream: allow overriding the sshd-session binary path
OpenBSD-Regress-ID: 5058cd1c4b6ca1a15474e33546142931d9f964da
2024-05-17 14:41:39 +10:00
anton@openbsd.org
a68f80f251
upstream: Since ssh-agent(1) is only readable by root by now, use
ssh(1) while generating data in tests.

OpenBSD-Regress-ID: 24eb40de2e6b0ace185caaba35e2d470331ffe68
2024-05-17 14:41:39 +10:00
dtucker@openbsd.org
83621b6351
upstream: In PuTTY interop test, don't assume the PuTTY major
version is 0. Patch from cjwatson at debian.org via bz#3671.

OpenBSD-Regress-ID: 835ed03c1b04ad46be82e674495521f11b840191
2024-03-26 18:46:29 +11:00
Darren Tucker
dc37d2d247
If we're using xpg4's id, remember to pass args. 2024-03-26 16:26:14 +11:00
Darren Tucker
2d7964a03e
Move xpg4 'id' handling into test-exec.sh.
Handle replacement of 'id' the same way as we do other Portable specific
replacements in test-exec.sh.  This brings percent.sh back into sync
with upstream.
2024-03-25 14:05:40 +11:00
dtucker@openbsd.org
2f9d2af5cb
upstream: Invoke ProxyCommand that uses stderr redirection via
$TEST_SHELL. Fixes test when run by a user whose login shell is tcsh.
Found by vinschen at redhat.com.

OpenBSD-Regress-ID: f68d79e7f00caa8d216ebe00ee5f0adbb944062a
2024-03-08 23:12:10 +11:00
dtucker@openbsd.org
e27f032aa8
upstream: Always define puttysetup function.
OpenBSD-Regress-ID: b4c0ccfa4006a1bc5dfd99ccf21c854d3ce2aee0
2024-02-19 20:35:31 +11:00
dtucker@openbsd.org
bbf541ee2a
upstream: Factor out PuTTY setup.
Factor out PuTTY and call only when needed.

This allows us to avoid PuTTY key setup when it's not needed, which
speeds up the overall test run by a couple of percent.

OpenBSD-Regress-ID: c25eaccc3c91bc874400f7c85ce40e9032358c1c
2024-02-19 18:48:26 +11:00
dtucker@openbsd.org
fb06f9b5a0
upstream: Don't try to use sudo inside sshd log wrapper.
We still need to check if we're using sudo since we don't want to chown
unecessarily, as on some platforms this causes an error which pollutes
stderr. We also don't want to unnecessarily invoke sudo, since it's
running in the context of the proxycommand, on *other* platforms it
may not be able to authenticate, and if we're using SUDO then it should
already be privileged.

OpenBSD-Regress-ID: 70d58df7503db699de579a9479300e5f3735f4ee
2023-10-31 15:35:53 +11:00
dtucker@openbsd.org
fc3cc33e88
upstream: Only try to chmod logfile if we have sudo. If we don't have
sudo then we won't need to chmod.

OpenBSD-Regress-ID: dbad2f5ece839658ef8af3376cb1fb1cabe2e324
2023-10-31 14:01:25 +11:00
djm@openbsd.org
3a506598fd
upstream: move PKCS#11 setup code to test-exec.sh so it can be reused
elsewhere

OpenBSD-Regress-ID: 1d29e6be40f994419795d9e660a8d07f538f0acb
2023-10-31 10:04:32 +11:00
dtucker@openbsd.org
1d6a878ceb
upstream: Only try to chown logfiles that exist to prevent spurious
errors.

OpenBSD-Regress-ID: f1b20a476734e885078c481f1324c9ea03af991e
2023-10-29 17:33:18 +11:00
Darren Tucker
f993bb5835
Resync PuTTY and Conch path handling with upstream.
Now that configure finds these for us we can remove these -portable
specific changes.
2023-10-20 20:39:03 +11:00
dtucker@openbsd.org
c54a50359b
upstream: Allow overriding the locations of the Dropbear binaries
similar to what we do for the PuTTY ones.

OpenBSD-Regress-ID: 7de0e00518fb0c8fdc5f243b7f82f523c936049c
2023-10-20 20:28:20 +11:00
dtucker@openbsd.org
fbaa707d45
upstream: Add interop test with Dropbear.
Right now this is only dbclient not the Dropbear server since it won't
currently run as a ProxyCommand.

OpenBSD-Regress-ID: 8cb898c414fcdb252ca6328896b0687acdaee496
2023-10-20 18:35:32 +11:00
djm@openbsd.org
c49a3fbf10
upstream: ensure logs are owned by correct user; feedback/ok
dtucker@

OpenBSD-Regress-ID: c3297af8f07717f1d400a5d34529962f1a76b5a3
2023-10-12 14:52:45 +11:00
dtucker@openbsd.org
5fc60e8246
upstream: Remove SUDO in proxy command wrapper. Anything that needs
sudo is already run by it, and it breaks if root isn't in sudoers.

OpenBSD-Regress-ID: 6cf22fda32a89c16915f31a6ed9bbdbef2a3bac9
2023-03-02 22:33:12 +11:00
dtucker@openbsd.org
0d514659b2
upstream: Fix breakage on dhgex test.
This was due to the sshd logs being written to the wrong log file.
While there, make save_debug_logs less verbose, write the name of the
tarball to regress.log and use $SUDO to remove the old symlinks (which
shouldn't be needed, but won't hurt).  Initial problem spotted by anton@.

OpenBSD-Regress-ID: 9c44fb9cd418e6ff31165e7a6c1f9f11a6d19f5b
2023-03-02 19:32:21 +11:00
dtucker@openbsd.org
13fe8f9785
upstream: Remove old log symlinks
before creating new ones. In -portable some platforms don't like
overwriting existing symlinks.

OpenBSD-Regress-ID: 7e7ddc0beb73e945e1c4c58d51c8a125b518120f
2023-03-02 17:43:00 +11:00
dtucker@openbsd.org
a6f4ac8a2b
upstream: Rework logging for the regression tests.
Previously we would log to ssh.log and sshd.log, but that is insufficient
for tests that have more than one concurent ssh/sshd.

Instead, we'll log to separate datestamped files in a $OBJ/log/ and
leave a symlink at the previous location pointing at the most recent
instance with an entry in regress.log showing which files were created
at each point.  This should be sufficient to reconstruct what happened
even for tests that use multiple instances of each program.  If the test
fails, tar up all of the logs for later analysis.

This will let us also capture the output from some of the other tools
which was previously sent to /dev/null although most of those will be
in future commits.

OpenBSD-Regress-ID: f802aa9e7fa51d1a01225c05fb0412d015c33e24
2023-03-01 22:02:47 +11:00
Darren Tucker
eb88d07c43
Revert explicit chmods on private keys.
This should no longer be needed on Cygwin test runners due to previous
commit.
2023-02-25 14:45:41 +11:00
Darren Tucker
0c5d4c843d
Explicitly set permissions on user and host keys.
On cygwin, the umask might not be sufficient.  Should fix tests on
Github runners.
2023-02-24 13:44:13 +11:00
Darren Tucker
ab69dda05d
Always use the openssl binary configure tells us.
This fixes tests on platforms that do not have the openssl tool
installed at all.
2023-02-20 20:01:29 +11:00
dtucker@openbsd.org
625f6bc398
upstream: Move scp path setting to a helper function. The previous
commit to add scp to the test sshd's path causes the t-envpass test to fail
when the test scp is given using a fully qualified path.  Put this in a
helper function and only call it from the scp tests.

OpenBSD-Regress-ID: 7533dc1c4265c1de716abb062957994195b36df4
2023-01-13 16:02:49 +11:00
dtucker@openbsd.org
6e6f886470
upstream: Add scp's path to test sshd's PATH.
If the scp we're testing is fully qualified (eg it's not in the system
PATH) then add its path to the under-test sshd's PATH so we can find
it. Prompted by bz#3518.

OpenBSD-Regress-ID: 7df4f5a0be3aa135495b7e5a6719d3cbc26cc4c0
2023-01-13 15:52:17 +11:00
dtucker@openbsd.org
5a4a9f7a96 upstream: Restore missing "!" in TEST_SSH_ELAPSED_TIMES test.
OpenBSD-Regress-ID: 38783f9676ec348c5a792caecee9a16e354b37b0
2022-07-25 17:33:44 +10:00
dtucker@openbsd.org
0ff886be13 upstream: Test TEST_SSH_ELAPSED_TIMES for empty string not
executable.  No-op on most platforms but should prevent warnings in -portable
on systems that don't have 'date %s'.

OpenBSD-Regress-ID: e39d79867b8065e33d0c5926fa1a31f85659d2a4
2022-07-25 11:05:27 +10:00
Darren Tucker
f69319ad8a Convert "have_prog" function into "which".
"which" and its behaviour is not standardized, so convert the existing
have_prog function into "which" so we can rely on it being available
and what its semantics are.  Add a have_prog wrapper that maintains the
existing behaviour.
2022-07-23 14:40:49 +10:00
dtucker@openbsd.org
35ef2b3b6e upstream: Add TEST_REGRESS_CACHE_DIR.
If set, it is used to cache regress test names that have succeeded and
skip those on a re-run.

OpenBSD-Regress-ID: a7570dd29a58df59f2cca647c3c2ec989b49f247
2022-07-04 19:41:06 +10:00
Damien Miller
b2aee35a1f find sk-dummy.so when build_dir != src_dir
spotted by Corinna Vinschen; feedback & ok dtucker@
2022-02-17 21:15:16 +11:00
Darren Tucker
2e5cfed513 Improve compatibility of early exit trap handling.
Dash (as used by the github runners) has some differences in its trap
builtin:
 - it doesn't have -p (which is fine, that's not in posix).
 - it doesn't work in a subshell (which turns out to be in compliance
   with posix, which means bash isn't).
 - it doesn't work in a pipeline, ie "trap|cat" produces no output.
2022-01-20 13:43:54 +11:00
Darren Tucker
20da6ed136 Invoke EXIT handler early when using Valgrind.
When using Valgrind, we need to wait for all invoked programs to
complete before checking their valgrind logs.  Some tests, notably
agent-restrict, set an EXIT trap handler to clean up things like
ssh-agent, but those do not get invoked until test-exec.sh exits.
This causes the Valgrind wait to deadlock, so if present invoke
the EXIT handler before checking the Valgrind logs.
2022-01-19 15:37:39 +11:00
Darren Tucker
c171879374 Remove sort wrapper.
agent-restrict now takes care of this itself.
2022-01-13 16:01:41 +11:00
Darren Tucker
6bf2efa267 Add "rev" command replacement if needed. 2022-01-12 18:25:06 +11:00
Darren Tucker
3ef403f351 Add wrapper for "sort" to set LC_ALL=C.
Found by djm, this should make sorts stable and reduce test flakiness.
2022-01-10 21:07:38 +11:00
dtucker@openbsd.org
dc38236ab6 upstream: Don't explicitly set HostbasedAuthentication in
sshd_config. It defaults to "no", and not explicitly setting it allows us to
enable it for the (optional) hostbased test.

OpenBSD-Regress-ID: aa8e3548eb5793721641d26e56c29f363b767c0c
2022-01-07 09:50:07 +11:00
dtucker@openbsd.org
8f3b180305 upstream: Log command invocation while debugging.
This will aid in manually reproducing failing commands.

OpenBSD-Regress-ID: b4aba8d5ac5675ceebeeeefa3261ce344e67333a
2022-01-05 11:51:04 +11:00
Darren Tucker
9b2ee74e3a Move the fgrep replacement to hostkey-rotate.sh.
The fgrep replacement for buggy greps doesn't work in the sftp-glob test
so move it to just where we know it's needed.
2021-09-24 11:08:03 +10:00
Darren Tucker
f703954157 Replacement function for buggy fgrep.
GNU (f)grep <=2.18, as shipped by FreeBSD<=12 and NetBSD<=9 will
occasionally fail to find ssh host keys in the hostkey-rotate test.
If we have those versions, use awk instead.
2021-09-24 08:06:48 +10:00
dtucker@openbsd.org
8b02ef0f28 upstream: Add a function to skip remaining tests.
Many tests skip tests for various reasons but not in a consistent way and
don't always clean up, so add that and switch the tests that do that over.

OpenBSD-Regress-ID: 72d2ec90a3ee8849486956a808811734281af735
2021-09-01 11:40:43 +10:00