Commit Graph

1100 Commits

Author SHA1 Message Date
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
Darren Tucker 8a5e99a70f
Remove skipping test when scp not in path.
An upcoming change renders this obsolete by adding scp's path to the
test sshd's PATH, and removing this first will make the subsequent sync
easier.
2023-01-13 15:49:48 +11:00
djm@openbsd.org d888de06c5
upstream: rewrite this test to use a multiplexed ssh session so we can
control its lifecycle without risk of race conditions; fixes some of the
Github integration tests for openssh-portable

OpenBSD-Regress-ID: 5451cad59ba0d43ae9eeda48ec80f54405fee969
2023-01-11 11:54:13 +11:00
Damien Miller 4a5590a5ee
try to improve logging for dynamic-forward test
previously the logs from the ssh used to exercise the forwarding
channel would clobber the logs from the ssh actually doing the
forwarding
2023-01-09 16:33:56 +11:00
Damien Miller dd1249bd5c
don't test IPv6 addresses if platform lacks support 2023-01-08 12:11:25 +11:00
dtucker@openbsd.org d77fc611a6
upstream: When OpenSSL is not available, skip parts of percent test
that require it. Based on github pr#368 from ren mingshuai.

OpenBSD-Regress-ID: 49a375b2cf61ccb95b52e75e2e025cd10988ebb2
2023-01-08 12:11:03 +11:00
Darren Tucker 1cd2aac312
Use our own netcat for dynamic-forward test.
That way we can be surer about its behaviour rather than trying to
second-guess the behaviour of various netcat implementations.
2023-01-07 23:01:11 +11:00
dtucker@openbsd.org 344a0e8240
upstream: Save debug logs from ssh for debugging purposes.
OpenBSD-Regress-ID: 109e40b06de1c006a3b8e0d8745b790b2c5870a0
2023-01-06 21:37:40 +11:00
djm@openbsd.org e1ef172646
upstream: regression test for ChannelTimeout
OpenBSD-Regress-ID: 280bfbefcfa415428ad744e43f69a8dede8ad685
2023-01-06 21:37:40 +11:00
djm@openbsd.org 2393ea8daf
upstream: fix typo in verbose logging
OpenBSD-Regress-ID: 0497cdb66e003b2f50ed77291a9104fba2e017e9
2023-01-06 21:37:40 +11:00
djm@openbsd.org 161a5378a3
upstream: unit tests for misc.c:ptimeout_* API
OpenBSD-Regress-ID: 01f8fb12d08e5aaadd4bd4e71f456b6588be9a94
2023-01-06 21:37:40 +11:00
tb@openbsd.org 018d671d78
upstream: Copy bytes from the_banana[] rather than banana()
Fixes test failure due to segfault seen on arm64 with xonly snap.

ok djm

OpenBSD-Regress-ID: 86e2aa4bbd1dff1bc4ebb2969c0d6474485be046
2023-01-06 20:25:14 +11:00
djm@openbsd.org 845ceecea2
upstream: regression test for PermitRemoteOpen
OpenBSD-Regress-ID: 8271aafbf5c21950cd5bf966f08e585cebfe630c
2023-01-03 17:53:05 +11:00
dtucker@openbsd.org 9a067e8d28
upstream: Fix comment typo.
OpenBSD-Regress-ID: 3b04faced6511bb5e74648c6a4ef4bf2c4decf03
2022-12-09 11:24:14 +11:00
Darren Tucker 5796bf8ca9
Restore ssh-agent permissions on exit.
...enough that subsequent builds can overwrite ssh-agent if necessary.
2022-12-02 11:55:08 +11:00
dtucker@openbsd.org ccf5a13868
upstream: Clean up ssh-add and ssh-agent logs.
OpenBSD-Regress-ID: 9eda8e4c3714d7f943ab2e73ed58a233bd29cd2c
2022-12-02 11:51:18 +11:00
dtucker@openbsd.org 7a8b40cf6a
upstream: Log output of ssh-agent and ssh-add
This should  make debugging easier.

OpenBSD-Regress-ID: 5974b02651f428d7e1079b41304c498ca7e306c8
2022-12-02 11:51:02 +11:00
dtucker@openbsd.org a1febadf42
upstream: Use variable for diff options
instead of unconditionally specifying "-rN". This will make life easier
in -portable where not all diff's understand -N.

OpenBSD-Regress-ID: 8b8a407115546be1c6d72d350b1e4f1f960d3cd3
2022-11-01 11:10:48 +11:00
djm@openbsd.org 7190154de2
upstream: regress test for unmatched glob characters; fails before
previous commit but passes now. bz3488; prodded by dtucker@

OpenBSD-Regress-ID: 0cc5cc9ea4a6fd170dc61b9212f15badaafb3bbd
2022-10-25 08:56:38 +11:00
djm@openbsd.org b98a42afb6 upstream: add some tests for parse_absolute_time(), including cases
where it is forced to the UTC timezone. bz3468 ok dtucker

OpenBSD-Regress-ID: ea07ca31c2f3847a38df028ca632763ae44e8759
2022-08-11 12:01:50 +10: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
Darren Tucker ea7ecc2c3a Skip scp3 test if there's no scp on remote path.
scp -3 ends up using the scp that's in the remote path and will fail if
one is not available.  Based on a patch from rapier at psc.edu.
2022-07-23 14:36:38 +10:00
Damien Miller c46f6fed41 crank SSH_SK_VERSION_MAJOR in sk-dummy.so 2022-07-20 13:39:14 +10:00
Darren Tucker a061792a6e Remove unintended changes.
I inadvertently included a couple of local changes with the OpenSSL
3.0.4 change.  Revert, anything that should be there will be committed
separately.
2022-07-14 19:22:47 +10:00
Darren Tucker 76f4e48631 Only refuse to use OpenSSL 3.0.4 on x86_64.
The potential RCE only impacts x86_64, so only refuse to use it if we're
targetting a potentially impacted architecture.  ok djm@
2022-07-13 13:17:47 +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
djm@openbsd.org 3d9b0845f3 upstream: test setenv in both client and server, test first-match-wins
too

OpenBSD-Regress-ID: 4c8804f9db38a02db480b9923317457b377fe34b
2022-06-03 14:34:12 +10:00
Damien Miller dc7bc52372 fix some bugs in the fuzzer 2022-05-30 09:29:20 +10:00
Damien Miller 9b3ad432ad fuzzer for authorized_keys parsing
mostly redundant to authopt_fuzz, but it's sensitive code so IMO it
makes sense to test this layer too
2022-05-27 17:00:43 +10:00
djm@openbsd.org bedb93415b upstream: regress test for in-place transfers and clobbering larger
files with smaller ones; would have caught last regression in scp(1)

OpenBSD-Regress-ID: 19de4e88dd3a4f7e5c1618c9be3c32415bd93bc2
2022-05-16 22:59:11 +10:00
anton@openbsd.org b4f0d719c2 upstream: Only run agent-ptrace.sh if gdb is available as all
architectures do not ship with gdb.

OpenBSD-Regress-ID: ec53e928803e6b87f9ac142d38888ca79a45348d
2022-05-16 22:59:11 +10:00
dtucker@openbsd.org c31404426d upstream: It looks like we can't completely avoid
waiting for processes to exit so retrieve the pid via controlmaster and
use that.

OpenBSD-Regress-ID: 8246f00f22b14e49d2ff1744c94897ead33d457b
2022-04-21 12:05:26 +10:00
dtucker@openbsd.org d19b21afab upstream: Use ssh -f and ControlPersist ..
to start up test forwards and ssh -O stop to shut them down intead of
sleep loops.  This speeds up the test by an order of magnitude.

OpenBSD-Regress-ID: eb3db5f805100919b092a3b2579c611fba3e83e7
2022-04-20 23:45:24 +10:00
dtucker@openbsd.org 5f76286a12 upstream: Simplify forward-control test.
Since we no longer need to support SSH1 we don't need to run shell
commands on the other end of the connection and can use ssh -N instead.
This also makes the test less racy.

OpenBSD-Regress-ID: 32e94ce272820cc398f30b848b2b0f080d10302c
2022-04-20 15:36:53 +10:00
djm@openbsd.org 687bbf2357 upstream: regression test for sftp cp command
OpenBSD-Regress-ID: c96bea9edde3a384b254785e7f9b2b24a81cdf82
2022-04-20 15:31:55 +10:00
Darren Tucker 81d33d8e3c Skip agent-getpeereid when running as root. 2022-02-21 21:27:20 +11:00
dtucker@openbsd.org fbd772570a upstream: Aproximate realpath on the expected output by deduping
leading slashes. Fixes test failure when user's home dir is / which is
possible in some portable configurations.

OpenBSD-Regress-ID: 53b8c53734f8893806961475c7106397f98d9f63
2022-02-20 15:10:19 +11: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 6ee53064f4 Fix helper include path and remove excess code.
Looks like test_hpdelim.c was imported twice into the same file.
Spotted by kevin.brott at gmail com and chris at cataclysmal org.
2022-02-11 10:05:31 +11:00
dtucker@openbsd.org 25bd659cc7 upstream: Add test for empty hostname with port.
OpenBSD-Regress-ID: e19e89d3c432b68997667efea44cf015bbe2a7e3
2022-02-10 15:17:28 +11:00
dtucker@openbsd.org a29af853cf upstream: Add unit tests for hpdelim.
OpenBSD-Regress-ID: be97b85c19895e6a1ce13c639765a3b48fd95018
2022-02-10 15:17:28 +11:00
Damien Miller 253de42753 portable-specific string array constification
from Mike Frysinger
2022-02-02 16:52:07 +11:00
djm@openbsd.org dfdcc2220c upstream: test 'ssh-keygen -Y find-principals' with wildcard
principals; from Fabian Stelzer

OpenBSD-Regress-ID: fbe4da5f0032e7ab496527a5bf0010fd700f8f40
2022-02-02 16:51:04 +11:00
dtucker@openbsd.org 968e508967 upstream: Enable all supported ciphers and macs in the server
before trying to benchmark them.  Increase the data file size to get more
signal.

OpenBSD-Regress-ID: dc3697d9f7defdfc51c608782c8e750128e46eb6
2022-02-02 16:51:04 +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 976b9588b4 Wrap OpenSSL includes in unit tests in ifdef.
Fixes unit test on systems that do not have OpenSSL headers installed.
2022-01-14 13:47:27 +11:00
Darren Tucker c171879374 Remove sort wrapper.
agent-restrict now takes care of this itself.
2022-01-13 16:01:41 +11:00