Commit Graph

2902 Commits

Author SHA1 Message Date
alnsn
911f4379f3 Add aes-cbc tests. 2016-11-09 22:01:15 +00:00
kamil
fac432862c Add new tests in t_wait_noproc and t_wait_noproc to test more options types
Add new tests:
 - waitpid_options
 - waitid_options
 - wait3_options
 - wait4_options
 - wait6_options

These tests are included in t_wait_noproc and t_wait_noproc_wnohang.

waitpid_options, wait3_options, wait4_options test combinations of options
of: bit for WALLSIG, WALTSIG, __WALL, __WCLONE and later a full combination
mask of WNOWAIT, WEXITED, WUNTRACED, WSTOPPED, WTRAPPED and WCONTINUED.

waitid and wait6 test full combination mask of WNOWAIT, WEXITED, WUNTRACED,
WSTOPPED, WTRAPPED and WCONTINUED -- excluded empty value and singular
WNOWAIT.

For compatibility reasons alter waitid and wait6 to test against options
WEXITED | WTRAPPED, as it's equivalent to waitpid, wait3, wait4.

The intention for these tests it to catch any possible issues with slighty
changed behavior of wait(2)-like functions in terms of valid options
values.

All tests pass successfully.

Sponsored by <The NetBSD Foundation>
2016-11-09 17:50:19 +00:00
kre
120ea00cee PR standards/51600
These tests are no longer expected to fail when called with WNOHANG
(which is actually the t_wait_noproc_wnohang test but the sources are here.)
2016-11-09 12:44:29 +00:00
kamil
258bb686f9 Switch ATF_REQUIRE() to more appropriate ATF_REQUIRE_ERRNO()
Simplify the code of t_wait_noproc

Sponsored by <The NetBSD Foundation>
2016-11-08 15:21:34 +00:00
kamil
452a799ce2 Add new test attach_chroot in t_ptrace
Assert that a debugger cannot trace another process unless the process's
root directory is at or below the tracing process's root.

Sponsored by <The NetBSD Foundation>.
2016-11-08 14:49:04 +00:00
kamil
405f1698e4 Add new test attach_self in t_ptrace
Assert that a debugger cannot attach to self (as it's nonsense).
NetBSD returs here EINVAL.

Clean up unused header includes.

Sponsored by <The NetBSD Foundation>.
2016-11-08 11:21:41 +00:00
pgoyette
eedda22892 Add PR number to the expected-fail message 2016-11-07 21:46:21 +00:00
kamil
5cc56ca0a8 Add new tests for combination of wait(2) interfaces with ptrace(2)
Move out wait(2) specific tests from t_ptrace and put them to t_ptrace_wait

Add generic code fragments to reuse the same source-code for every member
of the wait(2) family, namely:
 - wait(2)
 - waitpid(2)
 - waitid(2)
 - wait3(2)
 - wait4(2)
 - wait6(2)

Currently in the new test-suite there are the following tests:
 - traceme1
 - traceme2
 - traceme3
 - traceme4
 - attach1

Not all tests are possible to be executed against every wait(2)-like
interface, therefore they will be disabled in such case. Currently this
limits attach1 to waitpid(2), waitid(2), wait4(2), wait6(2), while the
other tests (traceme 1-4) run with all of the interfaces.

The construct of this file is dedicated for addition of new tests in the
close future.

As of now all of the tests pass correctly.

Thanks for Robert Elz for suggestions on improving the code (earlier draft
of this new form).

Sponsored by <The NetBSD Foundation>.
2016-11-07 21:09:03 +00:00
alnsn
54ef2b1942 Don't use mktemp. 2016-11-07 18:11:45 +00:00
scole
282adaf8f0 Only build t_cgd_aes if MKCRYPTO==yes and MKRUMP==yes. 2016-11-07 16:33:37 +00:00
ozaki-r
1f37c29ac2 Add tests for combination use of -g option and hops optional argument 2016-11-07 05:44:48 +00:00
ozaki-r
1c189061c4 Accept DEBUG environment variable
By doing so, we can easily turn DEBUG on/off without modifying
the ATF scripts.
2016-11-07 05:25:36 +00:00
ozaki-r
e948d33780 Add tests of ping6 hops optional argument (Type 0 Routing Headers)
Note that ping6 with the argument can send packets with routing headers
but the kernel doesn't support receiving the packets so that ping6 fails.
Nevertheless, we can test whether sent packets are correct or not.
2016-11-07 04:43:14 +00:00
pgoyette
4276333739 Mark this test as "expected failure" since rump doesn't include the
COMPAT_43 code.
2016-11-07 02:59:29 +00:00
kamil
96ab24d97f Enable the wait3 test in t_wait_noproc_wnohang (through t_wait_noproc)
This test has set expected failure like other functions in the wait(2)
family and is linked with PR standards/51606.

The PR is labeled as:
    wait4() (and friends) with WNOHANG and no children does not error

Originally, this test was accidently disabled in the WNOHANG checks. This
was noted by Robert Elz.

Sponsored by <The NetBSD Foundation>.
2016-11-07 02:23:43 +00:00
ozaki-r
4df1f132c4 Add basic tests for IPv6 Path MTU Discovery 2016-11-07 00:54:48 +00:00
kamil
eee4e242cc Run the attach_pid1 test (from t_ptrace) in unprivileged mode
Add in ATF_TC_HEAD() of attach_pid1 the following code to run it as
non-root: atf_tc_set_md_var(tc, "require.user", "unprivileged");

Solution pointed out by Nicolas Joly.

Sponsored by <The NetBSD Foundation>.
2016-11-06 21:47:53 +00:00
alnsn
acc218101f Don't build t_cgd_aes if ${MKCRYPTO} == "no". 2016-11-06 21:29:54 +00:00
kamil
4bb815e68e Add new tests attach_pid0 and attach_pid1 to t_ptrace
attach_pid0 asserts that it is not valid to attach PID 0 as it is a special
kernel process.

assert_pid1 asserts that non-root user cannot attach to PID 1 as it is the
/dev/init process. This tests is skipped if run as root.

Sponsored by <The NetBSD Foundation>.
2016-11-06 16:24:16 +00:00
kamil
2945e8c443 Add new tests: tests/lib/libc/sys/t_wait_noproc and t_wait_noproc_wnohang
The t_wait_noproc test checks whether wait(2)-family of functions return
error and set ECHILD for lack of childs.

The t_wait_noproc_wnohang adds to options (except wait(2), wait3(2)) new
parameter WNOHANG and verifies that error is still signaled and errno set
to ECHILD.

Currently t_wait_noproc_wnohang reports failures, these have been marked as
expected and referenced to PR standards/51606.

The problem report is authored by Robert Elz, and the initial regression
has been notified by Nicolas Joly.

Remove redundant test in tests/lib/libc/sys/t_wait for wait6(2) with no
WNOHANG specified.

Sponsored by <The NetBSD Foundation>.
2016-11-06 15:03:30 +00:00
alnsn
838eb24361 Add tests for not-yet-committed cgd algorithm AES-XTS.
The tests are marked as expected failures.
2016-11-06 10:54:42 +00:00
kamil
ed8b0a45b2 All tests in t_wait now pass
Christos Zoulas committed fixes to src/sys/sys/wait.h r.1.32.

Closes PR standards/51603

Sponsored by <The NetBSD Foundation>
2016-11-06 02:28:57 +00:00
kamil
04949b4194 Add new test wait6_stopgo_loop in t_wait
This test verifies that it is possible to emit multiple times SIGSTOP and
SIGCONT for a child.

Add checks that status does not return more than one valid state from the
following list: STOPPED, CONTINUED, EXITED and SIGNALED. This check fails
for WIFCONTINUED()==true as it currently and wrongly returns true for
WIFSTOPPED().

This verification is added to wait6_stopgo_loop and wait6_stop_and_go and
marked as expected failure and linked with PR standards/51603.

Remove trailing whitespace.

Sponsored by <The NetBSD Foundation>
2016-11-05 21:49:28 +00:00
kamil
41d2cf1b30 attach1 in t_ptrace no longer fails
Christos Zoulas fixed the issue that a parent sees termination of its child
before a tracer observing it for its tracee.

Many thanks to Christs for his help, he makes progress with tests so quick.

Closes PR kern/51600

Sponsored by <The NetBSD Foundation>.
2016-11-05 15:52:35 +00:00
kamil
b057fe9bfd Add new test attach1 in t_ptrace
This test asserts that tracer sees process termination before the parent

Currently this is not true for NetBSD.

The problem has been reported in gnats as kern/51600.

Originally an early version of this test triggered kernel panic, that
was fixed by Christos Zoulas -- thanks! Appropriate fixes are as follows:
http://mail-index.netbsd.org/source-changes/2016/11/04/msg078868.html
http://mail-index.netbsd.org/source-changes/2016/11/04/msg078869.html

Mark this test as expected failure and linked with proper PR.

As an interesting note, this test uses pipe(2) to perform IPC. Use for
messages uint8_t message to be sure that it will never by transmitted
partially from a caller to a callee, this assumption simplifies the code.

Add local function await_zombie() that takes process identifier (pid).
This function uses the sysctl(7) interface to probe p_stat of a requested
process and compares it with LSZOMB.

Try to keep closing all unneeded file descriptors for pipes in order to not
run out of fds later.

Sponsored by <The NetBSD Foundation>.
2016-11-05 01:49:53 +00:00
kamil
e70724aaaf The problem with WIFCONTINUED() and WIFSTOPPED() in traceme4 is resolved
Fixed by Christos Zoulas in:
cvs rdiff -u -r1.260 -r1.261 src/sys/kern/kern_exit.c
http://mail-index.netbsd.org/source-changes/2016/11/03/msg078852.html

This has been verified to work on NetBSD releng machines.

Closes PR kern/51596

Sponsored by <The NetBSD Foundation>.
2016-11-04 09:08:11 +00:00
kamil
f26cf4cb48 Prefer modern simple past tense and past participle of catch
The "catched" form is obsolete and nonstandard, prefer "caught".
2016-11-03 22:08:30 +00:00
kamil
a46fa40c88 Add FORKEE_ASSERTX()/FORKEE_ASSERT() for forkee; simplify code
A child process cannot call atf functions and expect them to magically
work like in the parent.
The printf(3) messaging from a child will not work out of the box as well
without estabilishing a communication protocol with its parent. To not
overcomplicate the tests - do not log from a child and use err(3)/errx(3)
wrapped with FORKEE_ASSERT()/FORKEE_ASSERTX() as that is guaranteed to work.

Simplify and cleanup code of the tests.

Sponsored by <The NetBSD Foundation>.
2016-11-03 20:24:18 +00:00
kamil
7e50848df6 Simplify code, prefer strerror(3) over sys_errlist(3)
No functional change intended.

strerror(3) change requested by <kre>.
Sponsored by <The NetBSD Foundation>.
2016-11-03 18:54:16 +00:00
kamil
8fa3e407e9 Mark ptraceme4 as expected failure, assume that Linux&FreeBSD are correct
Raising SIGCONT from a ptrace(2)d child should be catched with waidpid(2)
as WIFCONTINUED() false and WIFSTOPPED() true; not both true as it does not
make much sense.

PR kern/51596

Change requested by <kre>
Checked by <christos>

Sponsored by <The NetBSD Foundation>
2016-11-03 18:25:54 +00:00
kamil
9a8dc0b4a1 Add new test traceme4 in t_ptrace
This test verifies calling raise(2) with the SIGCONT argument in the child.
The parent is notified with it and asserts that WIFCONTINUED() and
WIFSTOPPED() are both set.

XXX: This behavior is surprising. Linux for the same code-path returns false
for WIFCONTINUED() and true for WIFSTOPPED().

Include <stdlib.h> for EXIT_FAILURE.

This code covers (uncovers issues?) WIFCONTINUED() and is the last planned
test in the ptraceme category.

Sponsored by <The NetBSD Foundation>.

For future reference and convenience, an out-of-ATF test is as follows:
#include <sys/param.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <assert.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#define ATF_REQUIRE(a) assert(a)

#if defined(linux)
#define WALLSIG __WALL
#define sys_signame sys_siglist
#endif

int main(int argc, char **argv)
{
        int status;
        const int exitval = 5;
        const int sigval = SIGSTOP, sigsent = SIGCONT;
        pid_t child, wpid;

        printf("1: Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
                /* printf(3) messages from a child aren't intercepted by ATF */
                /* "2: Child process PID=%d\n", getpid() */

                /* "2: Before calling ptrace(PT_TRACE_ME, ...)\n" */
                if (ptrace(PT_TRACE_ME, 0, NULL, 0) == -1) {
                        /* XXX: Is it safe to use ATF functions in a child? */
                        err(EXIT_FAILURE, "2: ptrace(2) call failed with "
                            "status %s", sys_errlist[errno]);
                }

                /* "2: Before raising SIGSTOP\n" */
                raise(sigval);

                /* "2: Before raising SIGCONT\n" */
                raise(sigsent);

                /* "2: Before calling _exit(%d)\n", exitval */
                _exit(exitval);
        } else {
                printf("1: Parent process PID=%d, child's PID=%d\n", getpid(),
                    child);

                printf("1: Before calling waitpid() for the child\n");
                wpid = waitpid(child, &status, 0);

                printf("1: Validating child's PID (expected %d, got %d)\n",
                    child, wpid);
                ATF_REQUIRE(child == wpid);

                printf("1: Ensuring that the child has not been exited\n");
                ATF_REQUIRE(!WIFEXITED(status));

                printf("1: Ensuring that the child has not been continued\n");
                ATF_REQUIRE(!WIFCONTINUED(status));

                printf("1: Ensuring that the child has not been terminated "
                    "with a signal\n");
                ATF_REQUIRE(!WIFSIGNALED(status));

                printf("1: Ensuring that the child has been stopped\n");
                ATF_REQUIRE(WIFSTOPPED(status));
                printf("1: Verifying that he child has been stopped with the"
                    " %s signal (received %s)\n", sys_signame[sigval],
                    sys_signame[WSTOPSIG(status)]);
                ATF_REQUIRE(WSTOPSIG(status) == sigval);

                printf("1: Before resuming the child process where it left "
                    "off and without signal to be sent\n");
                ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0)
                    != -1);

                printf("1: Before calling waitpid() for the child\n");
                wpid = waitpid(child, &status, WALLSIG);

                printf("1: Validating that child's PID is still there\n");
                ATF_REQUIRE(wpid == child);

                printf("1: Ensuring that the child has not been exited\n");
                ATF_REQUIRE(!WIFEXITED(status));

                printf("1: Ensuring that the child has been continued\n");
                ATF_REQUIRE(WIFCONTINUED(status));

                printf("1: Ensuring that the child has not been terminated "
                    "with a signal\n");
                ATF_REQUIRE(!WIFSIGNALED(status));

                printf("1: Ensuring that the child has not been stopped\n");
                ATF_REQUIRE(WIFSTOPPED(status));

                printf("1: Before resuming the child process where it left "
                    "off and without signal to be sent\n");
                ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
                printf("1: Before calling waitpid() for the child\n");
                wpid = waitpid(child, &status, 0);

                printf("1: Validating that child's PID is still there\n");
                ATF_REQUIRE(wpid == child);

                printf("1: Ensuring that the child has been exited\n");
                ATF_REQUIRE(WIFEXITED(status));

                printf("1: Ensuring that the child has not been continued\n");
                ATF_REQUIRE(!WIFCONTINUED(status));

                printf("1: Ensuring that the child has not been terminated "
                    "with a signal\n");
                ATF_REQUIRE(!WIFSIGNALED(status));

                printf("1: Ensuring that the child has not been stopped\n");
                ATF_REQUIRE(!WIFSTOPPED(status));

                printf("1: Verifying that he child has exited with the "
                    "%d status (received %d)\n", exitval, WEXITSTATUS(status));
                ATF_REQUIRE(WEXITSTATUS(status) == exitval);

                printf("1: Before calling waitpid() for the exited child\n");
                wpid = waitpid(child, &status, 0);

                printf("1: Validating that child's PID no longer exists\n");
                ATF_REQUIRE(wpid == -1);

                printf("1: Validating that errno is set to %s (got %s)\n",
                    sys_errlist[ECHILD], sys_errlist[errno]);
                ATF_REQUIRE(errno == ECHILD);
	}
}
2016-11-03 11:20:45 +00:00
kamil
0c55761e36 Add new test traceme3 in t_ptrace
This test is modeled after traceme1 and traceme2 with the goal to test if
the child was terminated with a received signal passed with PT_CONTINUE.

Currently the three traceme tests verifies three possible status values from
waitpid(2) called by the parent:
 - WIFEXITED(status),
 - WIFSIGNALED(status),
 - WIFSTOPPED(status)
with associated macros:
 - WEXITSTATUS(status),
 - WTERMSIG(status),
 - WCOREDUMP(status),
 - WSTOPSIG(status).

In traceme3 has been assumed that Ctrl-C (SIGINT) does not emit core(5).

Sponsored by <The NetBSD Foundation>.
2016-11-03 08:48:53 +00:00
kamil
830850eb4c Add new test-case "traceme2" in t_ptrace
This test is a clone of traceme2 with ptrace(2) calling PT_CONTINUE
with signal to be passed to the child: SIGINT. traceme1 sends no signals.

Sponsored by <The NetBSD Foundation>.
2016-11-02 22:18:04 +00:00
kamil
46910e0e26 Add new test t_ptrace with traceme1
This test is a placeholder for further checks of the native ptrace(2)
function calls.

XXX: Is it safe to call ATF functions from a child? FreeBSD seems to
     construct dedicated asserts for them.

XXX: printf(3) calls from a child are not intercepted by atf-run(1)

Sponsored by <The NetBSD Foundation>.
2016-11-02 12:51:22 +00:00
christos
b6bcbcb52f more tests from kamil 2016-10-31 23:51:20 +00:00
christos
73f2b871c9 fix typos 2016-10-31 16:23:03 +00:00
christos
179c7d3b31 Merge and fix the timed mutex tests to use absolute time.
NB: the new tests are broken?
2016-10-31 16:21:23 +00:00
ozaki-r
cd4a5f447b Add tests for ping6 options
- -S <sourceaddr>
- -I <interface>
- -g <gateway>
2016-10-31 10:38:25 +00:00
dholland
5358d0befc Add another case related to the ones from PR 49278: [A-\\]. 2016-10-31 05:08:53 +00:00
kamil
53e134ea9e Add new test t_timedmutex
This test is a clone on t_mutex with additional two tests for timed-mutex
specific block.

All simple-mutex (not with the timed property according to the C11 wording)
specific tests are covered by pthread_mutex_timedlock(3) with parameter
ts_lengthy of sufficiently large tv_sec value (right now UINT16_MAX). If,
a test will hang, it won't wait UINT16_MAX seconds, but will be terminated
within the default timeout for ATF tests (right now 300 [sec] in my
NetBSD/amd64 setup).

This test was inspired by a classic selflock test failure of
pthread_mutex_timedlock(3) of the following form:

#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <time.h>

int main(int argc, char **argv)
{
	pthread_mutex_t mtx;
        struct timespec ts;

        ts.tv_sec = 0;
        ts.tv_nsec = 1000;
        printf("ts{.tv_sec = %d, .tv_nsec=%ld}\n", ts.tv_sec, ts.tv_nsec);
        fflush(stdout);

        printf("mtx_init\n");
	assert(pthread_mutex_init(&mtx, NULL) == 0);

        printf("mtx_lock\n");
	assert(pthread_mutex_lock(&mtx) == 0);

        printf("mtx_timedlock\n");
	assert(pthread_mutex_timedlock(&mtx, &ts) == ETIMEDOUT);

        printf("mtx_unlock\n");
	assert(pthread_mutex_unlock(&mtx) == 0);

	printf("mtx_destroy\n");
        assert(pthread_mutex_destroy(&mtx) == 0);

	return 0;
}

Current NetBSD implementation wrongly hangs on this test.

The issue was detected during development of the C11 portable threads.

My local tests in chroot presents that the are further issues:

t_timedmutex (21/25): 10 test cases
    mutex1: [0.001142s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:75: *param != 20
    mutex2: [0.261499s] Passed.
    mutex3: [0.261496s] Passed.
    mutex4: [0.001204s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:265: pthread_mutex_timedlock(&mutex, &ts_lengthy): Connection timed out
    mutex5: [0.001235s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:337: pthread_mutex_timedlock(&mutex5, &ts_lengthy): Connection timed out
    mutex6: [21.218497s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:512: start != 1
    mutexattr1: [0.001328s] Passed.
    mutexattr2: [0.001175s] Passed.
    timedmutex1: [301.119397s] Failed: Test case timed out after 300 seconds
    timedmutex2: [301.123081s] Failed: Test case timed out after 300 seconds
[623.990659s]

I'm also receiveing the same failure in the mutex6 test in t_mutex, so
there might be a false positives due to local chroot(8) issues.

Commit approved by <christos>.
2016-10-30 16:17:16 +00:00
knakahara
4aa36fb22d fix rarely rump.ping6 failures by "UDP connect". and fix typo. 2016-10-27 09:59:17 +00:00
knakahara
56b9040c4f Fix error when wait_for_session_established() is called without argument.
From Shoichi YAMAGUCHI<s-yamaguchi@IIJ>, Thanks.
2016-10-26 03:55:56 +00:00
knakahara
38602079e1 Add new test cases(PAP and CHAP) for IPv6 PPPoE.
From Shoichi YAMAGUCHI<s-yamaguchi@IIJ>, Thanks.
2016-10-26 03:27:24 +00:00
abhinav
6cddff1a99 Add tests for uniq(1) based on the example test cases provided in the POSIX man page.
Ok christos
2016-10-22 14:13:39 +00:00
ozaki-r
51460776c2 Make test names self-descriptive 2016-10-20 09:51:15 +00:00
ozaki-r
9f81ad9409 Make sure to run cleanup
Should fix "tests: did not complete" failures.
2016-10-19 00:19:13 +00:00
ozaki-r
54d2407a67 Make test names self-descriptive 2016-10-18 04:10:24 +00:00
nat
333b297cf7 pad(4) must be open before corresponding audio device is opened.
OK christos@
2016-10-15 07:08:06 +00:00
spz
cff8db61e4 periphereal updates and generated files for the new openssl.
Expect at least one more commit until the tree builds again.
2016-10-14 16:09:43 +00:00
christos
b3566b595a Disable aslr too since we are playing address space range tricks. 2016-10-14 16:02:35 +00:00
martin
b38d15f64d Bump timeouts so they work on a 32bit sparc (poor Krups) 2016-10-13 09:25:37 +00:00
gson
2493fe037e Incrase timeout for the benefit of the walk_list_user test case which
sometimes times out under qemu under Linux, where the timing is more
accurate than under qemu under NetBSD where the the 60 second timeout
typically takes more than 60 seconds to trigger.
2016-10-08 13:23:53 +00:00
christos
6425002192 revert, fixing the real cause. 2016-10-06 20:14:11 +00:00
christos
40082debfe Add more indirect library dependencies 2016-10-06 19:52:36 +00:00
kre
de2c45dc26 PR bin/51532 - kill the test http server before terminating 2016-10-06 02:44:48 +00:00
ozaki-r
48cafa77c5 Add tests for sysctl net.inet.ip.mtudisc
From suzu-ken@IIJ
2016-10-04 04:15:25 +00:00
ozaki-r
85424d4772 Add tests for sysctl net.inet6.ip6.auto_linklocal
From suzu-ken@IIJ
2016-10-04 03:43:15 +00:00
ozaki-r
b6cf257731 Add tests for sysctl net.inet6.ip6.dad_count
From suzu-ken@IIJ
2016-10-04 03:41:33 +00:00
kre
fb4c39416a 80 column violation fixes, hopefully minor readability improvements.
No intended functional change.
2016-10-03 17:59:27 +00:00
kre
5c162fef83 This test works fine on real hardware, but due to PR kern/43997 (qemu
timing problems) fails when run under qemu.   Attempt to compensate
for that (by skipping the problematic test case) when running in qemu.

This should be reverted when the PR gets fixed (either in qemu or in
the NetBSD kernel).
2016-10-02 15:27:32 +00:00
kre
0e8fe63eab More adaptation to changed ifconfig output format. 2016-10-02 04:46:07 +00:00
kre
076ee4f8af More adaptation to new ifconfig output format - prefix length is now
appended to the address, rather than a second parameter, so needs to be
deleted if just the bare address is what we want (which it is here).
2016-10-02 04:29:25 +00:00
kre
1b0c0c88db Don't expect ping to complain about sending to a local address
assigned to an interface that's down - instead it just attempts
to send, and the interface never responds (as it would if it were
a remote address).
2016-10-01 22:15:04 +00:00
kre
dc63df36ca Compensate for the new world order of ifconfig output format,
and the new default netmask for point to point links.
2016-10-01 20:18:06 +00:00
roy
d1f35c1abb Adjust tests to new output. Wait for DaD to finish before pinging. 2016-10-01 15:35:22 +00:00
christos
2b55b3112e remove mpool_getf 2016-09-24 21:18:09 +00:00
christos
5703b437ba Add more of the torture tests from the mit kerberos tree. 2016-09-24 20:12:33 +00:00
christos
886ab6d08e print what went wrong. 2016-09-20 17:19:28 +00:00
ozaki-r
d94096e467 Ignore case in duplicated 2016-09-16 00:50:43 +00:00
ozaki-r
a59969fd67 Ignore case in deprecated 2016-09-16 00:44:14 +00:00
ozaki-r
2393c05ab0 Adjust for new ifconfig output
And use -o match to provide informative error messages.
2016-09-16 00:14:33 +00:00
christos
5642b8b65f Ignore case in deprecated/anycast 2016-09-14 16:18:31 +00:00
christos
12f0b47e19 adjust for new ifconfig output. 2016-09-14 16:00:10 +00:00
ozaki-r
cdc78b3fe9 Fill old_len which is required by sysctlbyname 2016-09-14 03:19:11 +00:00
knakahara
8db6a4e495 Disable rechallenge for chap test case.
NetBSD's PPPoE client doesn't support chap rechallenge yet.

From Shoichi YAMAGUCHI<s-yamaguchi@IIJ>, Thanks.
2016-09-14 01:48:08 +00:00
christos
a893ddcd72 add a chap test; need to investigate what's wrong with it... 2016-09-12 14:47:24 +00:00
christos
7366e78839 need bsd.init.mk 2016-09-10 11:04:24 +00:00
christos
781b35a2d5 PR/51461: Mateusz Poszwa: Processes hang when attempting to read from an empty file on psshfs mount, add unit test:
When a process attempts to read from an empty file originating from
psshfs mount, it waits indefinitely. Until the hanged process is
interrupted, the mounted filesystem appears to work as expected,
except for the directory containing the empty file. Processes trying
to list that directory also hang, and cause misbehaviour of the
containing directory.  It is possible to create a chain of hanged
processes trying to read directories up to the mount point. At the
same time, psshfs generates some network traffic (around 5KB/s, in
my case). Interrupting the first hanged process causes emission of
an error message by all other hanged processes, and psshfs ceases
to generate network traffic. Subsequent trials to list any affected
directory or if one of the affected directories is the mount point
to unmount the filesystem, fail with the same error.
2016-09-05 08:53:57 +00:00
ozaki-r
6217615c26 Add some tests
We need more realistic tests.
2016-09-05 04:35:46 +00:00
ozaki-r
9457c93fed Remove a unexpectedly committed file 2016-09-05 04:17:13 +00:00
ozaki-r
13445aedf0 Add very basic tests for tun devices 2016-09-05 02:26:48 +00:00
maya
c31c23a665 Add failing test for casinh 2016-08-31 14:05:09 +00:00
kre
7760e6f963 PR kern/49033
POSIX allows for the atime (or technically, any of the times) to be
updated as a side effect of searching a directory (allows, not requires).
The NetBSD UDF implementation apparently works that way, treating a
directory search as a read of the directory, and hence updating the
access time.   Compensate for that in the test (rather than just
expecting failure) by verifying that the atime after the directory
search is within a small margin of the atime before the search
(currently, "small" is 1 second).   We could fetch the time before
the mkdir and both stat() calls, do all of that, fetch the time after,
subtract, and require the after stat() atime to be bounded by the atime
set by the original mkdir and returned in the first stat() and that time
+ the difference in elapsed time - that would be more accurate, but is
a lot more work for little real benefit.

Should anyone be interested in doing that extra work, remember to use
monotonic time (clock_gettime(CLOCK_MOMNOTONIC, ...)) not the time of day
clock for measuring the elapsed time.

Along with this, remove the "if (udf) failure expected" and the
if (udf && we haven't failed yet) fail("random failure failed to happen")
stuff...  (the "random" would have been that sometimes the mkdir and
two lookups (stat() calls) would all occur within the same clock tick,
meaning that the atimes would all be the same.  Other times the clock
would tick somewhere between the mkdir() and the 2nd stat().)
2016-08-29 02:31:46 +00:00
christos
eb8cf8dd65 house-cleaning 2016-08-28 15:59:15 +00:00
christos
7e1ddeefad skip if we are not running rpcbind. 2016-08-27 14:36:22 +00:00
christos
b8c6512fdd don't disable PIE 2016-08-27 14:23:54 +00:00
christos
2cf6e96d2a needs mprotect disable since it loads kernel code and relocates it. 2016-08-27 14:21:07 +00:00
christos
dd0e0080d2 adjust to current config format 2016-08-27 12:08:14 +00:00
christos
4b0d182541 catch up with link printing. 2016-08-27 11:30:49 +00:00
christos
237ae380ee do the long double tests if we have long double. 2016-08-27 10:07:05 +00:00
christos
a530c482ac Fix static linking. 2016-08-27 08:38:58 +00:00
christos
6af98352e6 forgot to protect an ilogbl 2016-08-26 08:01:55 +00:00
darcy
36a840f64a Replace MKMAN with NOMAN as suggested by christos@. Allows
userland to build when building man pages.
2016-08-26 01:31:43 +00:00
maya
2b773534df Add a failing case for t_ldexp
ldexp(2.0, INT_MAX) should be HUGE_VAL, not 0
2016-08-25 00:32:31 +00:00
maya
d63d11005c don't skip the entire test iteration if exp2=SKIP, only the second
application of the function

this doesn't introduce new failures on amd64
2016-08-25 00:26:01 +00:00
christos
68ba093a6e fix test; clearing the exception does not return the old exception bitmask. 2016-08-24 10:04:53 +00:00
christos
b0fbbd46fc fix long double 2016-08-24 09:13:44 +00:00
christos
f1061bbd2c no functional change 2016-08-23 16:03:45 +00:00
christos
73ff5dffc3 portability fixes 2016-08-23 10:03:44 +00:00
maya
16cf37a656 Mistakes were made, compare correct values now. 2016-08-22 10:36:20 +00:00
maya
7e38ec308c add failing test for PR lib/51427
ilogb(INFINITY)=-INT_MAX, it should be INT_MAX

while here, test raised exceptions, other values.

XXX some platforms don't have exceptions
2016-08-22 08:49:33 +00:00
christos
03f6cc7066 fix wrong variable. 2016-08-21 13:23:36 +00:00
christos
b4ed6943ac add missing library dependencies. 2016-08-20 17:06:18 +00:00
christos
951bbb9df8 provide an RL variant that prints an extra argument 2016-08-20 15:49:08 +00:00
christos
0ca6f6b287 - use snprintf
- print the argument that caused the error
2016-08-20 15:48:18 +00:00
christos
080051aa7f Add union cast test 2016-08-19 10:21:50 +00:00
christos
fa75a57426 new test for struct that only has anon members, and that the size of struct
is computer right.
2016-08-18 14:45:56 +00:00
jakllsch
d7cdc3c29e t_usbhid/check_hid_get_data has been failing since it existed, mark as such 2016-08-17 12:10:42 +00:00
jakllsch
d0b2f20734 These clock_subr tests are no longer expected to fail. 2016-08-17 12:06:49 +00:00
roy
9fcb01a336 Fix test_lo6 because ::1 now has RTF_LOCAL assigned to it. 2016-08-16 10:34:12 +00:00
jakllsch
64d64ddcb3 tests for sys/dev/clock_subr.c 2016-08-14 14:55:41 +00:00
christos
db9b3c4eff order netinet6 properly. 2016-08-13 11:22:11 +00:00
christos
02d61e3495 order network libraries properly. 2016-08-13 11:21:06 +00:00
christos
c8a27b7a24 The required initialization order for net rump net services is:
rumpnet rumpnet_net [rumpnet_netinet6] rumpnet_netinet.
We need rumpnent_net first because of if_init1() and to initialize loopback.
2016-08-13 11:20:00 +00:00
kre
408b946945 Correct use of incorrect errno - should have no real practical effect. 2016-08-11 21:34:11 +00:00
kre
82205f76b1 One more -lrumpdev 2016-08-11 21:29:44 +00:00
kre
5bee7fb413 + -lrumpdev 2016-08-10 23:49:03 +00:00
kre
674d7cd1f8 + -lrumpdev 2016-08-10 23:47:14 +00:00
kre
976d7ab300 + -lrumpdev 2016-08-10 23:25:39 +00:00
kre
e9acd28970 + -lrumpdev 2016-08-10 23:07:57 +00:00
roy
e746a65f68 Add -lrumpdev so that tests work again. 2016-08-10 23:00:39 +00:00
kre
fa3392f086 + -lrumpdev 2016-08-10 22:45:39 +00:00
kre
d5417f3297 Move -lrumpdev so it is effective.
This test still fails (as does another using tap interfaces) ...

tc-se:rump.ifconfig: clone_command: Device not configured
tc-se:rump.ifconfig: exec_matches: Device not configured

Something is wrong with rumpnet_tap ...
2016-08-10 22:42:21 +00:00
kre
e416c313ce + -lrumpdev (and avoid doing stuff twice). 2016-08-10 22:37:07 +00:00
kre
113943956a + -lrumpdev 2016-08-10 22:30:02 +00:00
kre
c7f69180d5 + -lrumpdev 2016-08-10 22:17:44 +00:00
kre
71c9d3421c + -lrumpdev 2016-08-10 22:05:07 +00:00
kre
02ef134954 + -lrumpdev 2016-08-10 21:33:52 +00:00
kre
b95a77e39c Extra libs for rump. 2016-08-10 21:10:18 +00:00
ozaki-r
a0b47389e9 Add rumpdev library for config_cfdriver_attach 2016-08-10 07:50:37 +00:00
kre
28a5575028 This test should be testing how the kernel should behave, not how
it actually (used to) behave when it was incorrect...   Aside from
a possible EPERM (which is not tested) the only error possible from
mlock() is ENOMEM.   POSIX also allows EINVAL if the address is not
page aligned and the implementation does not round down to the previous
page boundary, but NetBSD does.

The kernel was recently fixed to return the correct errors for mlock()
so now we really need the test to be checking them, and not expecting
the incorrect errno values that the kernel used to return.

Same for munlock() - there ENOMEM is the only possible error, again,
EINVAL cannot happen as the kernel rounds to page boundaries.
For munlock() the kernel has not yet been corrected (that is coming
real soon...) and one of the munlock() tests will currently fail
(as of the time this commit is made, hopefully not for much longer)
as it should - it is indicating a kernel bug.

Note that NetBSD mlock(2) talks about EINVAL for cases where the length
parameter is negative ... but that is a size_t - good luck having that
ever occur (the man page will soon be corrected as well.)
2016-08-09 12:02:44 +00:00
pgoyette
e9b0487b4a This now needs librumpdev and librumpvfs to work. 2016-08-08 15:01:59 +00:00
pgoyette
9d0547e2ff Need librumpdev and librumpvfs 2016-08-08 14:58:40 +00:00
pgoyette
95d2314211 This one needs librump dev (and librumpvfs) too 2016-08-08 14:54:27 +00:00
pgoyette
b28fefb558 And this one also needs librumpvfs 2016-08-08 14:49:35 +00:00
pgoyette
00d0208049 More need for librumpdev 2016-08-08 14:46:35 +00:00
pgoyette
08db8f650e No underscore needed 2016-08-08 14:40:19 +00:00
pgoyette
64515c0f48 We also need librump_vfs
While here, remove duplicate entry for librump
2016-08-08 14:34:02 +00:00
pgoyette
c33a62fd17 And yet another one 2016-08-08 14:22:43 +00:00
pgoyette
03427d6925 Another place where we need librumpdev 2016-08-08 14:16:32 +00:00
pgoyette
e140ba111a We now need librumpdev to resolve rumpns_config_cfdriver_attach which
is now used in a bunch of network modules/components
2016-08-08 14:11:08 +00:00
pgoyette
2c49ff4a48 Add rumpdev library since we're now calling config_cfdriver_attach()
Should fix the newly-introduced test failure.
2016-08-07 23:34:31 +00:00
scole
d68880c4ee PR port-ia64/51261
Fix for ia64
2016-08-05 15:02:29 +00:00
scole
ea5cb0d634 PR port-ia64/51261
Make this compile for ia64
2016-08-05 15:01:39 +00:00
jakllsch
cfdb571b53 use __dead 2016-08-04 11:49:07 +00:00
christos
c10c4abe0f Realtime signal support from GSoC 2016, Charles Cui. 2016-08-04 06:43:43 +00:00
pgoyette
8d18247504 We don't have any FILES, so no need for a FILESDIR 2016-08-03 23:53:50 +00:00
christos
59c5c6b5ef we require root for sched_fifo, and more verbose messages. 2016-07-31 13:01:29 +00:00
njoly
d3e4dbe2f3 New getsockname(2) testcase for UNIX domain sockets. 2016-07-30 11:03:54 +00:00
pgoyette
64222d3a12 Mount the snapshot read-only; otherwise we get a nasty panic.
Re-order the clean-up steps to properly undo what we did.
2016-07-29 20:27:37 +00:00
pgoyette
0c0a621f71 Add a basic test for fss(4)
XXX For now, we just create required files (including mount-points)
XXX in the test's working directory.  Eventually someone with more
XXX rump-foo than I should create a fss rump-component and then update
XXX the test to run under rump.
2016-07-29 06:13:39 +00:00
pgoyette
7dc153cb5a Remove. Nothing here (or below) seems to refer to it, and it won't
work anyway due to the case of the 'l' in CPPFlAGS
2016-07-29 06:11:12 +00:00
pgoyette
3ff4e5ad94 Update the test - the "official" name of the vnd configuration utility
was changed in NetBSD 7 to vndconfig(8).
2016-07-29 05:23:24 +00:00
ozaki-r
3db8106383 Add some tests for route change 2016-07-21 02:02:30 +00:00
ozaki-r
852524ba75 Remove extra grep 2016-07-21 01:56:54 +00:00
ozaki-r
261b1cf92f Make the test name self-descriptive 2016-07-21 01:56:27 +00:00
christos
4d8445a4a7 Not designed for PIE 2016-07-18 12:17:39 +00:00
njoly
9c5f636bf3 Add testcase that ensure that stack hard limit is never smaller than
soft limit.
2016-07-13 09:53:16 +00:00
ozaki-r
bdcbfcd17f Fix test names 2016-07-08 08:27:07 +00:00
christos
82732dd294 fix uninitialized var. 2016-07-06 14:42:53 +00:00
christos
7cf7644fc7 GSoC 2016 Charles Cui: Implement thread priority protection based on work
by Andy Doran. Also document the get/set pshared thread calls as not
implemented, and add a skeleton implementation that is disabled.
XXX: document _sched_protect(2).
2016-07-03 14:24:58 +00:00
christos
ac52a1e696 Add an hmac test. 2016-07-02 14:52:09 +00:00
ozaki-r
743750f2e4 Destroy interfaces at the end of tests
It's useful to know if interface destructions work correctly or not
with complex internal states (e.g., caches).
2016-06-29 07:29:04 +00:00
pgoyette
b1b83700cd Do this more cleanly - put the do-we-have-crypto check inside the actual
do-the-test code rather than in a test's head() code.  This way, if we
ever add more tests, we simply need to invoke the common do-the-test code
with an appropriate flag argument rather than duplicating the test.
2016-06-27 05:29:32 +00:00
pgoyette
7f7ba5ce4b Split each test into its own test case.
For test case loop2, where there are multiple prime factors greater
than 65535, skip the test if the program was not built with crypto
support.  We need crypto/openssl for large factors.

Should address PR bin/23663
2016-06-27 05:08:18 +00:00
sevan
efb5f2c4e7 PR bin/4841 was filed regarding the handling of blank lines when cat was invoked
with -be, the test case however did not utilise any blank lines, only testing
that the text was aligned.
2016-06-26 22:50:46 +00:00
kre
bd9b00916f Remove tests of "dawn" and "sunset" in preparation for removing
them from parsedate() itself sometime soon.
2016-06-22 15:01:38 +00:00
ozaki-r
e8cb777b69 Tweak route get outputs to make tests work
"expire" value of route get output is unexpectedly a negative value
on rump kernel for some reasons and the tests almost always fail
on babylon5. So just ignore it to make tests work for now. Should
fix it in the future.
2016-06-21 10:18:27 +00:00
ozaki-r
f91dfc925e Make a bunch of test names self-descriptive 2016-06-21 05:04:16 +00:00
joerg
12f813b23d Link static test program with LDSTATIC to deal with PIE. 2016-06-18 12:12:09 +00:00
pgoyette
aec3683782 When deadbeef is treated as a 32-bit signed integer, it actually has a
negative value.  So, if the value gets written into a sysctl variable,
and then is read back, the twos-complement value is displayed.

So, when checking for the value having been written, make sure we check
for the correct value!
2016-06-17 03:55:35 +00:00
sevan
17a9d10433 Add a unit test for PR bin/51250 called se_output. se_output checks the output of cat
when invoked with '-se', to ensure that a '$' is printed on blank lines.
2016-06-16 01:04:58 +00:00
agc
83432fa6b8 remove some unused test cases 2016-06-01 14:52:56 +00:00
agc
6d27eeee35 Use human2atf to generate a t_netpgpverify.sh script which is half the
size of the previous one (using on-the-fly gzip compression), and includes
more cases (including a gpg-signed file for cross-testing purposes).

Add the appropriate Testspec file.
2016-06-01 06:39:11 +00:00
pgoyette
9458f2be2e Fix testing of returned entptr, and fix three affected tests.
From kamil@ via PR lib/49632
2016-06-01 01:12:02 +00:00
christos
5cca8a9eaf Fix mprotect for the helper. 2016-05-28 14:38:29 +00:00
christos
ec3db6b7b6 Skip the mprotect_exec test if PaX MPROTECT restrictions are enabled. 2016-05-28 14:34:49 +00:00
hannken
6fc7edbd65 Disable PAX mprotect to make just-in-time-compile tests work again.
Ok: Christos Zoulas
2016-05-24 10:16:34 +00:00
riastradh
8338092962 Test for PR kern/51135 is no longer failing. 2016-05-22 04:34:44 +00:00
ozaki-r
7fa1e6be86 Adjust the tests for temp option that works now
See PR kern/50127
2016-05-20 06:48:52 +00:00
kre
c80063823d Use valid (standard) shell syntax, in anticipation of /bin/sh enforcing
it sometime soon (perhaps.)
2016-05-17 09:05:14 +00:00
kre
b752c81378 Add a new test case to validate N>&N redirect disables close-on-exec.
OK christos@
2016-05-15 15:44:43 +00:00
kre
cd13213fdd Add another test for the 48875 fix fallout... 2016-05-14 00:33:02 +00:00
pooka
0a4930ca68 mark read_random xfail kern/51135 2016-05-13 13:22:28 +00:00
kre
e588572b24 Grunge. I know I fixed this typo before... must have been in a different
couy of the test.
2016-05-12 14:25:11 +00:00
kre
2f35ca415e Verify that questionable characters don't have bad associates.
ok christos@
2016-05-12 13:34:23 +00:00
pooka
2d2ae8f1cf Test that reading /dev/random returns within a reasonable time. 2016-05-12 11:41:43 +00:00
kre
5ab36d6022 Add a test for fd redirections on functions in loops (the etcupdate issue)
and also fix a quoting bug which was causing a test to fail, though
ATF was ignoring (an ATF bug to be investigated later.)

OK christos@
2016-05-11 17:43:17 +00:00
kre
07e424459c PR bin/48875 PR bin/51123 This adds tests more that verify fide descriptor
redirection works correctly (including that the bugs reported in those PRs
are fixed.)  Note that the tests for 48875 are slow, so one of the new
test cases ends up running > 25 seconds (just doing sleeps) - each individual
test is just a few seconds, but there are several of them.

OK christos@
2016-05-09 22:34:37 +00:00
kre
44b3998960 Remove the trap_zero__explicit_return test case - it was testing undefined
behaviour (and failed with the NetBSD shell, and was marked as expected to
fail.)   Other shells do different things.   The test was worthless, and is
now gone.

OK christos@
2016-05-07 23:51:30 +00:00
jakllsch
2d9fbba46c Use rump_schedule() before calling things in the rump context.
Hopefully fixes these tests on all ports.
2016-05-05 17:40:26 +00:00
jakllsch
5c7aaf765b t_hid doesn't use rump correctly, and thus consistently fails; mark as such 2016-05-05 16:55:56 +00:00
kre
25d58d24b2 Make the 9 months ago test, when reverting from late November to the
end of Feburary just a little less bogus (stupid cut & paste error).
2016-05-05 02:12:21 +00:00
gson
85c4af6b99 Reduce the step size, exposing another bug. 2016-05-04 18:36:46 +00:00
dholland
a0feec40ce Cite a relevant PR for msdos_renamerace instead of one that was fixed
several years ago.
2016-05-04 08:30:22 +00:00
kre
e4edd6e6c4 PR bin/50574 - make the tests conform to what parsedate() actually
does, so they should no longer fail.   This needs parsedate.y 1.28
in order to work properly.

OK christos@
2016-05-03 18:18:15 +00:00
kre
97c9ae31d2 Whitespace. No changes. OK christos@ 2016-05-03 18:10:38 +00:00
jakllsch
ffe5c1f16e Call rump_init() before using rump functionality.
This change should make these test cases consistently fail on all ports.

Related to PR kern/51096.
2016-05-02 17:24:06 +00:00
christos
28ac500a6d More redirect tests, in particular, tests for redirects to/from
file descriptors outside the 0..9 range, and complex fd
reassignments.  Also test that the shell can cope with the
value of ulimit -n changing (downwards, up is harmless)
(Freom kre@)
2016-05-02 01:47:14 +00:00
gson
73fec7e59e In the "relative" test case, run the tests multiple times relative to
various dates over a span of a few decades, instead of just once
relative to the current date.  This makes the test fail consistently
instead of sometimes failing and sometimes not depending on when
it is run.  Makes PR lib/50574 consistently reproducible.
2016-05-01 16:39:47 +00:00