Commit Graph

409 Commits

Author SHA1 Message Date
Enji Cooper
cd033efc14 - Mark signo __unused in the signal handler function
- Effectively #if 0 out some code that does not fail on FreeBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-24 06:57:16 +00:00
Enji Cooper
bc3c590b4d - Add inttypes.h and stdint.h in lieu of int_limits.h from NetBSD
- Use #include "h_macros.h" instead of relative path analog

Sponsored by: EMC / Isilon Storage Division
2014-10-24 06:53:06 +00:00
Enji Cooper
dfbf472ad8 - Test for EINVAL requirement when passing an invalid flag in to msync(2)
- Expect ENOMEM instead of EFAULT when msync'ing a previously munmap'ed region
  on FreeBSD

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-24 03:53:49 +00:00
Enji Cooper
3638ce9c38 - Ignore EINVAL check with mknod(path, S_IFCHR, -1) as the testcase is always
executed on a non-devfs filesystem
- Expect mknod(path, S_IFREG, 0) to fail on FreeBSD

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-24 03:42:37 +00:00
Enji Cooper
078fc315f1 Omit the mprotect_exec testcase on FreeBSD
Sponsored by: EMC / Isilon Storage Division
2014-10-23 08:29:09 +00:00
Enji Cooper
eef4a6990d Mark signum __unused
Sponsored by: EMC / Isilon Storage Division
2014-10-23 08:13:07 +00:00
Enji Cooper
70d69ef1d0 Fix a typo (__FreeBSD__ -> __NetBSD__ when omitting setrlimit_nthr) 2014-10-23 08:12:31 +00:00
Enji Cooper
fcb748b9b3 Add limits.h #include for SSIZE_MAX
Sponsored by: EMC / Isilon Storage Division
2014-10-23 08:06:34 +00:00
Enji Cooper
7128b2846a Add limits.h #include for SSIZE_MAX
Sponsored by: EMC / Isilon Storage Division
2014-10-23 08:05:47 +00:00
Enji Cooper
928eb3af13 - Omit setrlimit_nthr testcase on FreeBSD (requires lwp.h, et al)
- Expect overflow with rlim_max at INT64_MAX, not UINT64_MAX (rlim_t is int64_t
on FreeBSD)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 08:05:03 +00:00
Enji Cooper
3524bdaf9c - Mark sig/signo __unused
- Do not provide a relative path via #include "h_macros.h"

Sponsored by: EMC / Isilon Storage Division
2014-10-23 07:59:59 +00:00
Enji Cooper
922231762c Use <atf_srcdir>/truncate_test.root_owned instead of /usr/bin/fpr as fpr does
not exist on FreeBSD

truncate_test.root_owned will be generated at build time and owned by root

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 07:54:46 +00:00
Enji Cooper
b0c0b671f8 Add limits.h #include for INT_MAX
Sponsored by: EMC / Isilon Storage Division
2014-10-23 07:22:18 +00:00
Enji Cooper
6ffeed4575 - Omit the poll testcases on FreeBSD (they require pollts)
- Add necessary headers for the testcases

Sponsored by: EMC / Isilon Storage Division
2014-10-23 07:20:35 +00:00
Enji Cooper
eb780be7bb Mark signo __unused in handler(..)
Sponsored by: EMC / Isilon Storage Division
2014-10-23 07:11:58 +00:00
Enji Cooper
e996bb8945 Omit all of the testcases as revoke(2) is only implemented on devfs(5)
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 07:07:35 +00:00
Enji Cooper
1837d228fc Omit the pollts testcases on FreeBSD
Sponsored by: EMC / Isilon Storage Division
2014-10-23 07:05:14 +00:00
Enji Cooper
41acfd752f Port t_mmap.c to FreeBSD
- Add needed headers for the testcases
- Omit mmap_block on non-NetBSD OSes
- Use "security.bsd.map_at_zero" instead of "vm.user_va0_disable"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 06:42:53 +00:00
Enji Cooper
16f04beb8c Add sys/socket.h #include for struct sockaddr_in
Sponsored by: EMC / Isilon Storage Division
2014-10-23 06:35:19 +00:00
Enji Cooper
3816d068c8 Add limits.h #include for LINE_MAX
Sponsored by: EMC / Isilon Storage Division
2014-10-23 06:25:52 +00:00
Enji Cooper
deafa70780 - Mark unused parameters __unused in handler
- Call sigqueue with getpid() instead of 0 -- the latter idiom appears to only
be valid on NetBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 06:24:36 +00:00
Enji Cooper
e90f6cb573 Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)"
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 06:21:10 +00:00
Enji Cooper
10ee748942 Port t_pipe2.c to FreeBSD
- Omit the pipe2_nosigpipe testcase on FreeBSD (FreeBSD doesn't have
  O_NOSIGPIPE).
- Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)".
- Save and restore the resource limit on the number of files (RLIMIT_NOFILE).

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 06:18:28 +00:00
Enji Cooper
edeea1460a Expect getgroups_err to fail on FreeBSD
PR: 189941
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-23 05:58:02 +00:00
Enji Cooper
a39196afea Add netinet/in.h for struct sockaddr_in
Sponsored by: EMC / Isilon Storage Division
2014-10-23 05:46:10 +00:00
Enji Cooper
f8974fefdb Add sys/socket.h #include for bind(2), et al
Sponsored by: EMC / Isilon Storage Division
2014-10-21 20:17:05 +00:00
Enji Cooper
203a8409a0 Port t_chroot to FreeBSD
- Add missing #include sys/stat.h for mkdir(2)
- Omit the fchroot(2) tests because the support is not present on FreeBSD

Sponsored by: EMC / Isilon Storage Division
2014-10-21 18:10:05 +00:00
Enji Cooper
67654a1af5 unlink("/") fails with EISDIR instead of EBUSY on FreeBSD; test for that
instead

Sponsored by: EMC / Isilon Storage Division
2014-10-21 18:06:04 +00:00
Enji Cooper
30f7722958 Mark osi __unused so this compiles cleanly on FreeBSD
Sponsored by: EMC / Isilon Storage Division
2014-10-21 18:01:37 +00:00
Enji Cooper
84763702c5 Port t_write to FreeBSD
- Mark the signo variable for the signal handle __unused
- Use limits.h instead of sys/syslimits.h (the latter does not
exist on FreeBSD)

Sponsored by: EMC / Isilon Storage Division
2014-10-21 18:00:55 +00:00
Enji Cooper
6da1ceb210 Add missing #include for sys/stat.h for fchmod
Sponsored by: EMC / Isilon Storage Division
2014-10-21 17:58:53 +00:00
Enji Cooper
2a0388e163 libutil.h is required for fparseln on FreeBSD
Sponsored by: EMC / Isilon Storage Division
2014-10-21 17:57:12 +00:00
Enji Cooper
192a7b5f9e Port lib/libc/gen/t_siginfo to FreeBSD
- mcontext_t on FreeBSD doesn't have a __gregs field (it's split out on FreeBSD
into separate fields). In order to avoid muddying the test code with MD code,
the debugging trace info has not been implemented
- FreeBSD does not implement the si_stime and si_utime fields in siginfo_t, so
omit the debugging code that dumps the values
- sys/inttypes.h doesn't exist on FreeBSD

Sponsored by: EMC / Isilon Storage Division
2014-10-21 17:56:06 +00:00
Enji Cooper
e58fb51fc7 Change ATF_REQUIRE_MSG calls to ATF_CHECK_MSG to get as many errors as possible
t_strptime:common..
- Expect the testcase body as a whole to fail. Multiple PRs will be filed to
track the issues (there are 18 check failures)

t_strptime:day..
- %EA and %OA seem to be case insensitive on FreeBSD
2014-10-13 03:55:47 +00:00
Enji Cooper
13727fa5e8 Only test the return value in mktime_negyear
Testing for the errno is an optional requirement according to POSIX, and
FreeBSD doesn't document that errno would be set on failure with mktime

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-13 02:44:35 +00:00
Enji Cooper
8a05dd8595 __isnanl is automatically picked according to data type in <math.h>. There
isn't a need for the explicit __isnanl test

Sponsored by: EMC / Isilon Storage Division
2014-10-13 02:32:37 +00:00
Enji Cooper
267693b269 Add #include <stdio.h> to get sys_nerr definition
Sponsored by: EMC / Isilon Storage Division
2014-10-13 02:29:58 +00:00
Enji Cooper
ea441bc061 Use 1 as a random seed, as recommended in srandom(3). Adjust the random values
accordingly

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-13 02:27:59 +00:00
Enji Cooper
21a9353bfd memmem with NUL length "needle" (aka small) strings on FreeBSD/OSX returns
NULL instead of the "haystack" value (aka big)

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-13 02:23:24 +00:00
Enji Cooper
effc369887 Do initial port of contrib/netbsd-tests/lib/libc/locale
t_io:
- Expect failures potentially related to implementation-specific knowledge of
the zh_TW.Big5 locale [*]

t_mbrtowc:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)
- Expect failure with mbrtowc_internal dealing with Japanese locales
(potentially related to implementation detail knowledge of the ja_* locales) [*].

t_mbstowcs, t_mbtowc, t_wctomb:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)

t_wcstod:
- Treat FreeBSD like NetBSD and Linux in the XXX: FIXME section

[*] More investigation is required to determine the root cause of the failures

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-13 01:14:01 +00:00
Enji Cooper
b081e68c53 Add #include <stdio.h> for printf
Sponsored by: EMC / Isilon Storage Division
2014-10-13 00:33:59 +00:00
Enji Cooper
62141a34e7 Expect nice_err to fail on FreeBSD with unprivileged users
PR: 189821
Sponsored by: EMC / Isilon Storage Division
2014-10-12 23:46:24 +00:00
Enji Cooper
27d2e83dc4 - Add libutil #include for fparseln
- Change ATF_REQUIRE_EQ_MSG to ATF_CHECK_EQ_MSG to gather all failing results
  possible (currently 12 with leftassoc)
- Mark leftassoc "atf_tc_expect_fail" on FreeBSD (PR coming soon after further
  analysis is done on the code)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-12 21:59:23 +00:00
Enji Cooper
40187119b6 Fix compilation errors with missing wide-type headers and fix compilation
warnings with -Wformat

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-12 21:54:55 +00:00
Enji Cooper
f12a8d0b05 Implement 64MB memory limit for test to ensure that it fails reliably in
600 seconds; it would previously fail inconsistently when run in some virtual
machine configurations

This patch might need to be reverted or revisited later (see the attached PR
for more details)

PR: 169302

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-12 21:53:13 +00:00
Enji Cooper
387dcafe06 #include libutil.h for fparseln on FreeBSD
Sponsored by: EMC / Isilon Storage Division
2014-10-12 10:07:26 +00:00
Enji Cooper
5bd73b5107 Only #include <sys/tls.h> on NetBSD
Sponsored by: EMC / Isilon Storage Division
2014-10-12 10:04:59 +00:00
Enji Cooper
8b8647bf30 Port the testcase to FreeBSD
- Make #include path to h_macros.h a non-relative path
- __gl_stat_t is synonymous with struct stat on FreeBSD
- FreeBSD doesn't have _DIRENT_RECLEN
- Skip over glob_star on FreeBSD (testcase doesn't pass)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-10 21:22:25 +00:00
Enji Cooper
1068aa4201 Skip over t_spawn_open_nonexistent_diag because it requires NetBSD specific
additions to posix_spawn

Sponsored by: EMC / Isilon Storage Division
2014-10-10 21:19:17 +00:00
Enji Cooper
e33dfddd03 SIGPWR does not exist on FreeBSD
Sponsored by: EMC / Isilon Storage Division
2014-10-10 19:34:19 +00:00
Enji Cooper
6fc3b00f80 Handle getting/setting niceness/priority correctly on FreeBSD vs NetBSD
This might be fallout from PR: 189821

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-10 19:32:53 +00:00
Enji Cooper
9ae31714cf Disable the invalid pointer test on FreeBSD
FreeBSD segfaults on invalid pointers passed to getcwd because it throbs the
address passed in in libc, whereas NetBSD just passes the information off to
the syscall, which allows the kernel to return EFAULT on bad pointers.

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-10 19:28:57 +00:00
Enji Cooper
4cf97cc9d2 FreeBSD doesn't support strings greater than MAXHOSTNAMELEN-1 in
{get,set}{domain,host}name. Adjust the tests to not exceed that
value when testing out the code

Add a positive and negative test for MAXHOSTNAMELEN-1 and
MAXHOSTNAMELEN, respectively

PR: 181127
In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-10 19:18:52 +00:00
Enji Cooper
bd735ec199 FreeBSD returns ENOTTY instead of EBADF in ttyname_r; mark it as an expected
failure

PR: 191936

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-10 19:02:02 +00:00
Enji Cooper
e6a6a5c5d3 Add missing #include <sys/time.h> for gettimeofday
Sponsored by: EMC / Isilon Storage Division
2014-10-10 18:59:18 +00:00
Enji Cooper
6cf117d780 Disable tests that don't pass on FreeBSD due to missing support in
humanize_number(3). Bringing in additional revisions from NetBSD's
humanize_number(3) will fix the tests

Account for the fact that util.h on NetBSD is libutil.h on FreeBSD

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-10 18:57:39 +00:00
Enji Cooper
ac2a1d3d71 Expect SIGSEGV in lib/libc/stdlib/t_getenv:setenv_basic
See bin/189805 for more details

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
2014-10-10 08:57:55 +00:00
Enji Cooper
b3a6b001d0 Only build/run hsearch_basic and hsearch_r_basic on NetBSD
hdestroy1 is not present on FreeBSD

Sponsored by: EMC / Isilon Storage Division
2014-10-10 08:35:16 +00:00
Enji Cooper
57718be8fa Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
minus the vendor Makefiles

Provide directions for how to bootstrap the vendor sources in
FREEBSD-upgrade

MFC after 2 weeks
Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division
2014-10-02 23:26:49 +00:00