Commit Graph

4321 Commits

Author SHA1 Message Date
yamaguchi
643fff90fa update test cases for AC-Name and Service-Name 2020-09-25 06:15:30 +00:00
yamaguchi
52817f12eb Add test cases for AC-Name and Service-Name 2020-09-25 06:07:31 +00:00
yamaguchi
3b0bfceb86 Add a limit for auth at a test for invalid account 2020-09-23 06:18:20 +00:00
yamaguchi
55cf8635ae Fix typo 2020-09-23 05:56:55 +00:00
kamil
8f03799314 Add new RTLD test file for r_debug
New tests:
 - self
 - dlopen

Both check whether the r_debug structure seems to be well-formed, without
and with a dlopen(3) call.
2020-09-22 01:09:32 +00:00
roy
65e7bf86f8 arp tests: Delete ARP entry after failed ping test
As it might hang around in WAITDELETE for a few seconds.
2020-09-18 16:33:49 +00:00
roy
fc25529d69 ndp_rtm: Only ping once
Pointless doing 3 pings.
On a slow system, it's possible that many RTM_MISS messages could
overflow into the next test.
2020-09-17 11:56:35 +00:00
roy
6a4c2721f4 arp_rtm: Only ping once
Pointless doing 10 pings.
On a slow system, it's possible that many RTM_MISS messages could
overflow into the next test.
2020-09-17 11:51:01 +00:00
roy
7a353eb78e Don't check lifetime when testing published 2020-09-15 11:19:10 +00:00
martin
af1644547e Simplify test requirements: we only build tsan for amd64 currently. 2020-09-15 09:33:12 +00:00
kamil
2062795b28 Enable TSan tests for GCC and >32bit address space environments 2020-09-14 15:17:53 +00:00
roy
caed3cda55 arp test: Use the ndp cache expiration test in place of the old one
As the logic is the same.
While here, GC some variables and comment out a redundant sleep.
2020-09-13 14:36:32 +00:00
kre
f1b3a283f6 Whitespace. NFC. 2020-09-10 17:40:34 +00:00
kre
b1ea2bb886 Replace use of tr to translate '-' in test names into '_' to satisfy ATF
requirements (correct sh variable/function name syntax).  Use a sh
loop instead, and save one fork() one vfork() and one exec of tr for
each test case (many of which don't need anything done to them at all).

This might partially mitigate PR misc/55595
2020-09-10 17:33:16 +00:00
christos
c2bd2f1f7f PR/55648: Kyle Evans: Minor warnings in compilation of libexecinfo test2 2020-09-09 20:04:10 +00:00
gson
2d97242511 Disable reverse DNS lookups in ping to avoid spurious test failures
due to unresponsive DNS servers.
2020-09-09 09:17:14 +00:00
jakllsch
3eade4a405 Acknowledge clang warning for NEON cipher code on aarch64eb
We've already made the nonportable vector initializations portable; the
code works on aarch64eb.
2020-09-08 17:35:27 +00:00
christos
ecd0250189 Add tests for IP_BINDANY, IPV6_BINDANY 2020-09-08 14:13:50 +00:00
mrg
a29667efc0 disable these tests unless ATF_SBIN_IFCONFIG_WIFI_ENABLE=yes is
in the environment.  they change wifi configuration, restart
wpa_supplicant and hostapd, and, on broken wifi chipsets, may
hang the test run.
2020-09-08 06:11:32 +00:00
mrg
c2082ece61 remove GCC_NO_ADDR_OF_PACKED_MEMBER for several subdir builds
that are now handled by lfs_accessors.h internally.
2020-09-07 03:09:53 +00:00
mrg
8820a04cbb avoid new GCC 9 warnings. 2020-09-07 00:29:14 +00:00
mrg
45092b0582 don't pass NULL to printf(), but use "<memory>" to signify this
test is operating on an in-memory only database.
2020-09-07 00:28:44 +00:00
mrg
cb93b81028 add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
2020-09-06 07:20:26 +00:00
maxv
4a2e4dc388 nvmm: update copyright headers 2020-09-05 07:22:25 +00:00
riastradh
13a2b7334d Revert "ufs: Prevent mkdir from choking on deleted directories."
This change made no sense and should not have been committed.
2020-09-05 02:55:38 +00:00
riastradh
4b73975959 ufs: Prevent mkdir from choking on deleted directories.
Fix some missing uvm_vnp_setsize in screw cases while here.
2020-09-05 02:47:48 +00:00
riastradh
44afc3b3f9 genfs_rename: Fix deadlocks in cross-directory cyclic rename.
Reproducer:

A: for (;;) { mkdir("c", 0600); mkdir("c/d", 0600); mkdir("c/d/e", 0600);
    rmdir("c/d/e"); rmdir("c/d"); }
B: for (;;) { mkdir("c", 0600); mkdir("c/d", 0600); mkdir("c/d/e", 0600);
    rename("c", "c/d/e"); }
C: for (;;) { mkdir("c", 0600); mkdir("c/d", 0600); mkdir("c/d/e", 0600);
    rename("c/d/e", "c"); }

Deadlock:

- A holds c and wants to lock d; and either
- B holds . and d and wants to lock c, or
- C holds . and d and wants to lock c.

The problem with these is that genfs_rename_enter_separate in B or C
tried lock order .->d->c->e (in A/B, fdvp->tdvp->fvp->tvp; in A/C,
tdvp->fdvp->tvp->fvp) which violates the ancestor->descendant order
.->c->d->e.

The resolution is to change B to do fdvp->fvp->tdvp->tvp and C to do
tdvp->tvp->fdvp->fvp.  But there's an edge case: tvp and fvp might be
the same (hard links), and we can't detect that until after we've
looked them both up -- and in some file systems (I'm looking at you,
ufs), there is no mere lookup operation, only lookup-and-lock, so we
can't even hold the lock on one of tvp or fvp when we look up the
other one if there's a chance they might be the same.

Fortunately the cases
(a) tvp = fvp
(b) tvp or fvp is a directory
are mutually exclusive as long as directories cannot be hard-linked.
In case (a) we can just defer locking {tvp, fvp} until the end, because
it can't possibly have {fdvp or fvp, tdvp or tvp} as descendants.  In
case (b) we can just lock them in the order fdvp->fvp->tdvp->tvp or
tdvp->tvp->fdvp->fvp if the first one of {fvp, tvp} is a directory,
because it can't possibly coincide with the second one of {fvp, tvp}.

With this change, we can now prove that the locking order is consistent
with the ancestor->descendant partial ordering.  Where two nodes are
incommensurate under that partial ordering, they are only ever locked
by rename and there is only ever one rename at a time.

Proof:

- For same-directory renames, genfs_rename_enter_common locks the
  directory first and then the children.  The order
  directory->child[i] is consistent with ancestor->descendant and
  child[0]/child[1] are incommensurate.

- For cross-directory renames:

  . While a rename is in progress and the fs-wide rename lock is held,
    directories can be created or removed but not changed, so the
    outcome of gro_genealogy -- which, given fdvp and tdvp, returns
    the node N relating fdvp/N/.../tdvp or null if there is none --
    can only transition from finding N to not finding N, if one of
    the directories is removed while any of the vnodes are unlocked.
    Merely creating directories cannot change the ancestry of tdvp,
    and concurrent renames are not possible.

    Thus, if a gro_genealogy determined the operation to have the
    form fdvp/N/.../tdvp, then it might cease to have that form, but
    only because tdvp was removed which will harmlessly cause the
    rename to fail later on.  Similarly, if gro_genealogy determined
    the operation _not_ to have the form fdvp/N/.../tdvp then it
    can't begin to have that form until after the rename has
    completed.

    The lock order is,

    => for fdvp/.../tdvp:
       1. lock fdvp
       2. lookup(/lock/unlock) fvp (consistent with fdvp->fvp)
       3. lock fvp if a directory (consistent with fdvp->fvp)
       4. lock tdvp (consistent with fdvp->tdvp and possibly fvp->tdvp)
       5. lookup(/lock/unlock) tvp (consistent with tdvp->tvp)
       6. lock fvp if a nondirectory (fvp->t* or fvp->fdvp is impossible)
       7. lock tvp if not fvp (tvp->f* is impossible unless tvp=fvp)

    => for incommensurate fdvp & tdvp, or for tdvp/.../fdvp:
       1. lock tdvp
       2. lookup(/lock/unlock) tvp (consistent with tdvp->tvp)
       3. lock tvp if a directory (consistent with tdvp->tvp)
       4. lock fdvp (either incommensurate with tdvp and/or tvp, or
          consistent with tdvp(->tvp)->fdvp)
       5. lookup(/lock/unlock) fvp (consistent with fdvp->fvp)
       6. lock tvp if a nondirectory (tvp->f* or tvp->tdvp is impossible)
       7. lock fvp if not tvp (fvp->t* is impossible unless fvp=tvp)

Deadlocks found by hannken@; resolution worked out with dholland@.

XXX I think we could improve concurrency somewhat -- with a likely
big win for applications like tar and rsync that create many files
with temporary names and then rename them to the permanent one in the
same directory -- by making vfs_renamelock a reader/writer lock: any
number of same-directory renames, or exactly one cross-directory
rename, at any one time.
2020-09-05 02:47:03 +00:00
riastradh
60f4a93e19 tests/fs/vfs/t_renamerace: Test a screw case hannken@ found. 2020-09-05 02:45:22 +00:00
gson
9c5137ef5c Format PR references consistently so that they can be automatically
turned into links in HTML reports.
2020-09-01 18:40:09 +00:00
riastradh
4131d8f567 tests/net/if_wg: Allow one second of leeway for rekey. 2020-08-31 20:32:58 +00:00
martin
fb1355a7bc Skip timeout tests, pointing to PR 55632. 2020-08-31 14:03:56 +00:00
tih
e76a1fdd82 Update the if_wg tests for the human readable 'latest-handshake'
output of wgconfig.
2020-08-29 07:22:49 +00:00
martin
f834934d77 Skip threxec test pointing at PR 55338, this kills some test beds. 2020-08-29 05:46:34 +00:00
martin
e1e4474c3c Also skip the stress_short test - it just needs way too long to timeout
and fail.
2020-08-28 19:35:07 +00:00
martin
18c37829c4 lockme_DOUBLEINIT:
The failure message differs slightly when using LOCKDEBUG, modify the
expected pattern to cover both variants.
2020-08-28 19:29:58 +00:00
martin
6cd60e7467 Skip a few tests with reference to already existing PRs as after "recent"
scheduler changes these tests now leave rump_server processes around that
eat CPU and disturb later tests.
2020-08-28 19:14:17 +00:00
christos
7865465b60 PR/55612: Martin Husemann: libarchive tests pollute /tmp w/o cleanup
Set $TMPDIR to where we are.
2020-08-28 18:46:05 +00:00
riastradh
4a9d230258 Nix trailing whitespace. 2020-08-28 14:18:29 +00:00
christos
fb880abaf0 When running the tests with atf-run the directory we are running in is
drwx------ so when we change to a different user, we can't find the socket
we created.

Make a directory and put the socket in there. Of course now atf can't
record its results as a different user, but that is not fatal.

tc-se:FATAL ERROR: Cannot create results file '/tmp/atf-run.9vOjFd/tcr': \
Permission denied
2020-08-28 13:56:29 +00:00
christos
33a3e8378d Remove unneeded sete{u,g}id pointed out by kre.
Remove dup unlink.
2020-08-28 11:46:05 +00:00
christos
52d4f80613 - when running as root, create the socket under a different uid/gid to verify
that it works properly with different users opening the socket.
- verify that linux works the same for both getpeereid() and fstat()
2020-08-27 14:00:01 +00:00
riastradh
03c60d1bc0 wg: Check mbuf chain length before m_copydata. 2020-08-27 02:52:33 +00:00
riastradh
5ec0ae9a4b Use wgconfig as intended to show diagnostics, not a usage message. 2020-08-27 02:51:49 +00:00
christos
ac4837d560 Check that fstat returns the correct socket owner 2020-08-26 22:52:58 +00:00
riastradh
25154f5f0c Clarify wg(4)'s relation to WireGuard, pending further discussion.
Still planning to replace wgconfig(8) and wg-keygen(8) by one wg(8)
tool compatible with wireguard-tools; update wg(4) for the minor
changes from the 2018-06-30 spec to the 2020-06-01 spec; &c.  This just
clarifies the current state of affairs as it exists in the development
tree for now.

Mark the man page EXPERIMENTAL for extra clarity.
2020-08-26 16:03:40 +00:00
gson
9d42296eb9 Only expect the fmod test case to fail when using qemu's TCG CPU emulation,
and not under hardware virtualization such as qemu -accel nvmm.
2020-08-25 13:39:16 +00:00
riastradh
c9aa4f445f Fix getrandom() tests.
Use sigaction() without SA_RESTART -- signal() implies SA_RESTART so
we never got the EINTR.

While here, reduce the timeout to something more reasonable so we
don't waste 20min of testbed time if anything goes wrong and the
one-second alarm doesn't fire.
2020-08-25 01:37:38 +00:00
gson
59b669221c Expect a failure to trap unaligned acesses only when running under
qemu's TCG CPU emulation, not when running under hardware virtualization
such as qemu -accel nvmm.
2020-08-24 06:55:16 +00:00
riastradh
284084a72c Nix trailing whitespace. 2020-08-23 22:34:29 +00:00
riastradh
bbfb23c92a Split getrandom tests into several cases to find out which ones hang. 2020-08-23 17:50:19 +00:00