Commit Graph

1081 Commits

Author SHA1 Message Date
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
dtucker@openbsd.org 9cc2654403 upstream: Set LC_ALL in both local and remote shells so that sorted
output matches regardless of what the user's shell sets it to.  ok djm@

OpenBSD-Regress-ID: 4e97dd69a68b05872033175a4c2315345d01837f
2022-01-13 16:01:41 +11:00
dtucker@openbsd.org 7a75f748cb upstream: Avoid %'s in commands (not used in OpenBSD, but used in
-portable's Valgrind test) being interpretted as printf format strings.

OpenBSD-Regress-ID: dc8655db27ac4acd2c386c4681bf42a10d80b043
2022-01-13 15:49:38 +11:00
dtucker@openbsd.org 4bc2ba6095 upstream: Use egrep when searching for an anchored string.
OpenBSD-Regress-ID: dd114a2ac27ac4b06f9e4a586d3f6320c54aeeb4
2022-01-12 18:31:45 +11:00
Darren Tucker 6bf2efa267 Add "rev" command replacement if needed. 2022-01-12 18:25:06 +11:00
djm@openbsd.org acabefe3f8 upstream: remove hardcoded domain and use window.location.host, so this
can be run anywhere

OpenBSD-Regress-ID: 2ac2ade3b6227d9c547351d3ccdfe671e62b7f92
2022-01-12 09:36:01 +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 bd69e29f57 upstream: Remove errant "set -x" left over from debugging.
OpenBSD-Regress-ID: cd989268e034264cec5df97be7581549032c87dc
2022-01-08 19:01:43 +11:00
dtucker@openbsd.org 1a7c88e26f upstream: Enable all supported hostkey algorithms (but no others).
Allows hostbased test to pass when built without OpenSSL.

OpenBSD-Regress-ID: 5ddd677a68b672517e1e78460dc6ca2ccc0a9562
2022-01-08 18:42:01 +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 e12d912ddf upstream: Add test for hostbased auth. It requires some external
setup (see comments at the top) and thus is disabled unless
TEST_SSH_HOSTBASED_AUTH and SUDO are set.

OpenBSD-Regress-ID: 3ec8ba3750c5b595fc63e7845d13483065a4827a
2022-01-07 09:50:07 +11:00
djm@openbsd.org 294c11b1c7 upstream: select all RSA hostkey algorithms for UpdateHostkeys tests,
not just RSA-SHA1

OpenBSD-Regress-ID: b40e62b65863f2702a0c10aca583b2fe76772bd8
2022-01-05 19:31:37 +11:00
djm@openbsd.org 2ea1108c30 upstream: regress test both sshsig message hash algorithms, possible
now because the algorithm is controllable via the CLI

OpenBSD-Regress-ID: 0196fa87acc3544b2b4fd98de844a571cb09a39f
2022-01-05 16:06:09 +11:00
djm@openbsd.org 37a14249ec upstream: regression test for find-principals NULL deref; from Fabian
Stelzer

OpenBSD-Regress-ID: f845a8632a5a7d5ae26978004c93e796270fd3e5
2022-01-05 15:12:46 +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
djm@openbsd.org c672f83a89 upstream: unbreak test: was picking up system ssh-add instead of the
one supposedly being tested. Spotted by dtucker and using his VM zoo (which
includes some systems old enough to lack ed25519 key support)

OpenBSD-Regress-ID: 7976eb3df11cc2ca3af91030a6a8c0cef1590bb5
2022-01-04 18:22:37 +11:00
Damien Miller 715c892f0a remove sys/param.h in -portable, after upstream 2021-12-22 09:02:50 +11:00
Damien Miller 7a7c69d8b4 add agent-restrict.sh file, missed in last commit 2021-12-20 13:05:20 +11:00
djm@openbsd.org f539136ca5 upstream: regression test for destination restrictions in ssh-agent
OpenBSD-Regress-ID: 3c799d91e736b1753b4a42d80c42fc40de5ad33d
2021-12-20 12:17:18 +11:00
anton@openbsd.org 6e4980eb8e upstream: Make use of ntests variable, pointed out by clang 13.
OpenBSD-Regress-ID: 4241a3d21bdfa1630ed429b6d4fee51038d1be72
2021-12-20 12:16:49 +11:00