Commit Graph

119 Commits

Author SHA1 Message Date
Marcelo Araujo
3287272dab Fix warning of implicit declaration of function 'mkdir'.
Differential Revision:	D2662
Reviewed by:		rodrigc, ngie
2015-05-31 02:21:35 +00:00
Ed Maste
16150352f5 memmem(3): empty little string matches the beginning of the big string
This function originated in glibc, and this matches their behaviour
(and NetBSD, OpenBSD, and musl).

An empty big string (arg "l") is handled by the existing
l_len < s_len test.

Reviewed by:	bapt, ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2657
2015-05-26 21:16:07 +00:00
Enji Cooper
66eb8885a0 The fmodl compat shims on arm/mips/powerpc aren't complete
Disable the test code for now on those architectures

MFC after: 1 week
PR: 199422
2015-04-27 06:46:33 +00:00
Enji Cooper
49a26c1f93 Add #include sys/types.h for register_t for mips
MFC after: 3 days
2015-04-25 04:30:01 +00:00
Jilles Tjoelker
c317cb51b2 nice(): Put back old return value, keeping [EPERM] error.
Commit r279154 changed the API and ABI significantly, and {NZERO} is still
wrong.

Also, preserve errno on success instead of setting it to 0.

PR:		189821
Reported by:	bde
Relnotes:	yes
2015-02-28 18:22:10 +00:00
Jilles Tjoelker
e220ce08ef nice(): Correct return value and [EPERM] error.
PR:		189821
Obtained from:	NetBSD
Relnotes:	yes
2015-02-22 13:36:44 +00:00
Colin Percival
11d9aa6707 Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive.  Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities.  I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by:	jmg
Discussed at:	EuroBSDCon
Approved by:	gjb (release-affecting changes)
2015-02-12 05:35:00 +00:00
Jilles Tjoelker
424c16b2ce ttyname_r(): Return actual error, not always [ENOTTY].
Adjust the test that used to fail because of this bug.

PR:		191936
MFC after:	1 week
2015-02-01 22:50:33 +00:00
Enji Cooper
0d972b25f6 Revert r277357 as expr has been enhanced to better detect overflow conditions,
and now the tests pass

PR: 196867
X-MFC with: r277798
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-01-28 11:38:12 +00:00
Jilles Tjoelker
8dd985befe Enable utimensat tests from NetBSD.
As with other tests from c063, a required #include <sys/stat.h> was missing.
2015-01-24 15:49:40 +00:00
Enji Cooper
2e5b60079b Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
overflow checks like NetBSD's expr does

MFC after: 3 days
PR: 196867
2015-01-19 06:10:01 +00:00
Enji Cooper
0c76184ced Fix lib/libthr/tests/detach_test
- Eliminate race with liberal use of sleep(3) [1]
- Fix NetBSD-specific implementation way of testing result from pthread_cancel
  by testing with `td` instead of `NULL` [2]

PR: 196738 [1]
PR: 191906 [2]

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-01-17 00:58:24 +00:00
Enji Cooper
a812392203 Expect :arithmetic_ops_body to fail with syntax errors on FreeBSD
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-01-04 23:41:17 +00:00
Jilles Tjoelker
d79f904ad2 Link lib/libc/c063 tests to the build.
Some files lack required #include <sys/stat.h>. The #ifdef is per ngie's
request; the includes are clearly necessary for struct stat.

The faccessat test fails because it tries to use AT_SYMLINK_NOFOLLOW with
faccessat(), which is not specified by POSIX.1-2008.

Differential Revision:	https://reviews.freebsd.org/D1411
Reviewed by:	ngie
2015-01-02 22:49:05 +00:00
Enji Cooper
97e4ab0905 Don't install h_raw if dealing with clang 3.5.0+ to unbreak the tests2 Jenkins
job

The h_raw application doesn't do proper bounds checking without the option
being supplied via the build, which means that it doesn't throw signals and
fail as expected

PR: 196430
X-MFC with: r276479
2015-01-02 05:40:02 +00:00
Enji Cooper
8fe9679fd6 Reset errno in :scalbnf_val and :scalbnl_val before running the tests so the
tested errno isn't stale

This was needed in order for the test to pass on amd64 with stable/10

MFC after: 3 days
2015-01-02 00:57:40 +00:00
Enji Cooper
3e4930b0a9 Expect access_test:access_inval to fail before __FreeBSD_version == 1100033
This will allow me to MFC the test, as jilles@ requested that I don't MFC the
access(2) KBI change to 10-STABLE in r271655
2014-12-30 22:32:29 +00:00
Enji Cooper
92e8bbfdfd Add __FreeBSD_version guards around hsearch_r to ease MFCing the code to
stable/10

It was added when __FreeBSD_version was ~1100027
2014-12-21 23:47:30 +00:00
John Baldwin
521b1af4ea Only pass 6 arguments to the 'run' function on amd64. amd64's
makecontext on FreeBSD only supports a maximum of 6 arguments.  This
fixes the setcontext_link test on amd64.

PR:		194828
2014-11-25 12:44:18 +00:00
Enji Cooper
ff0ba87247 Mechanically replace #if defined(__FreeBSD__) and #if defined(__NetBSD__) with
their #ifdef equivalents for everything changed in contrib/netbsd-tests. There
are some items from the vendor tree that use #if defined(__FreeBSD__) or
#if defined(__NetBSD__) which are being left alone

Requested by: bde, rpaulo
Sponsored by: EMC / Isilon Storage Division
2014-11-17 13:39:00 +00:00
Enji Cooper
1268301a8d - Skip over the testcases that call cbrtl on platforms where LDBL_PREC == 53
(arm, mips, powerpc). This fixes the build on these platforms, based on some
ad hoc tinderbox runs I did a while ago
- Skip cast the arguments to powl as long double so powl properly interprets
those arugments at compile-time when picking the type

Sponsored by: EMC / Isilon Storage Division
2014-11-16 20:42:30 +00:00
Enji Cooper
84e369d8fc - Expect exp2_powers to fail on FreeBSD/i386
- Expect exp2_values to fail on FreeBSD due to the small epsilon

Sponsored by: EMC / Isilon Storage Division
2014-11-16 20:39:11 +00:00
Enji Cooper
12c91ea883 Alias isinff to isinf on FreeBSD
isinf on FreeBSD automatically picks the appropriate type per math.h

Sponsored by: EMC / Isilon Storage Division
2014-11-16 20:37:46 +00:00
Enji Cooper
790973021f Reset errno to 0 before running scalbn to be sure that the tested errno is
valid

Sponsored by: EMC / Isilon Storage Division
2014-11-16 20:35:32 +00:00
Enji Cooper
66152388f6 Skip the long-double epsilon checks on FreeBSD/i386
Sponsored by: EMC / Isilon Storage Division
2014-11-16 20:34:46 +00:00
Enji Cooper
e2b4fa14f9 Call sem_unlink on semaphores before attempting to create them
Due to the lack of uniqueness in the semaphore name, and the fact that the
tests don't have cleanup routines, an interrupted test can leave a semaphore
"laying around", causing all subsequent attempts to run the test to fail

I will file a NetBSD PR for this issue soon
2014-11-16 06:59:58 +00:00
Enji Cooper
a20294deef Add missing sys/time.h #include for timespecsub macro in lib/libnetbsd/sys/time.h 2014-11-16 05:13:39 +00:00
Enji Cooper
f1c54c1af6 Port helper program to FreeBSD, similar to ../../lib/libc/stdlib/h_atexit.c
Submitted by: pho
In collaboration with: kib
2014-11-16 05:13:10 +00:00
Enji Cooper
1741e5991e #ifdef out a printf on !NetBSD that causes the testcase to fail when comparing
the output from the helper program

Submitted by: pho
2014-11-16 05:11:07 +00:00
Enji Cooper
ea74a0a240 Add pthread_np.h #include and initialize the pthread attribute on FreeBSD
Submitted by: pho
2014-11-16 05:09:23 +00:00
Enji Cooper
ff9d081d78 Expect :pthread_detach to fail with EINVAL instead of ESRCH on FreeBSD
PR: 191906
In collaboration with: pho
2014-11-16 05:08:19 +00:00
Enji Cooper
190e1b1c9b Only expect timeouts on powerpc with NetBSD
Submitted by: pho
2014-11-16 05:06:35 +00:00
Enji Cooper
a81c27fd8c Use _exit instead of exit so the file descriptors aren't flushed twice in the
child processes

Submitted by: pho
2014-11-16 05:05:18 +00:00
Enji Cooper
0369b14474 Expect lib.libc.sys.getcontext_test.setcontext_link to fail on amd64; add
additional debugging to make the underlying problem more visible

Calling setcontext(2) on amd64 as shown in the test program is failing on
amd64, not i386, with a return code of -1 and an errno of EINVAL

Further investigation is being done in the PR to determine the root cause for
the failure

PR: 194828
Tested with the following configuration:
- amd64/i386
- 11.0-CURRENT @ r273153
- 100 times in a tight loop as root with the following commands...
-- kyua test lib/libc
-- kyua test lib/libc/sys
-- kyua test lib/libc/sys/getcontext_test
2014-11-05 16:38:57 +00:00
Enji Cooper
5ff32a6885 Remove expected failure from lib.libc.sys.t_mincore:mincore_resid
The failure was added based on observation seen on 11.0-CURRENT @ r273153, not
based on internal testing at EMC/Isilon

PR: 194829
Tested with the following configuration:
- amd64/i386
- 11.0-CURRENT @ r273153
- 100 times in a tight loop as root with the following commands...
-- kyua test lib/libc
-- kyua test lib/libc/sys
-- kyua test lib/libc/sys/mincore_test
2014-11-05 16:30:02 +00:00
Enji Cooper
aec1a09487 Fix the Jenkins test run by skipping the negative testcases earlier
The problem is that lib.libc.locale.t_io:bad_big5_wprintf was printing out
illegal Unicode characters, which causes XML parsers to bail immediately, e.g.

% kyua report-junit > ~/report.junit
% python2 -c 'import xml.dom.minidom as md; md.parse("/home/ngie/report.junit")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 27137, column 13
2014-11-04 16:02:46 +00:00
Enji Cooper
068ebf3274 Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after atf-c/config.h
was removed from the build

Pointyhat to: me (again, for not running make delete-old after running test builds)
2014-11-04 05:02:22 +00:00
Enji Cooper
4c8085db66 Finish off lib/libc/stdlib/t_strtod.c port by checking for "y" twice on
FreeBSD, and always assume long long double exists on FreeBSD

Submitted by: pho
2014-11-04 00:04:36 +00:00
Enji Cooper
3fe8969a74 rpc_control on FreeBSD is a public-ish API (not prefixed with __), not private
like NetBSD

Submitted by: pho
2014-11-03 23:37:51 +00:00
Enji Cooper
f001698bc1 Port lib/libc/ssp to FreeBSD
In most cases, the buffers and data were resized, but when dealing with the
helpers, some of the code was adjusted to fail more reliably

Submitted by: pho
2014-11-03 23:36:41 +00:00
Enji Cooper
5896aab328 inet_network on FreeBSD returns NULL when provided "0x" to inet_network
Submitted by: pho
2014-11-03 21:26:11 +00:00
Enji Cooper
43d5532540 Port t_db.sh to FreeBSD
- The blocksize on FreeBSD is 32kB, not 64kB
- Add some detection for MK_DICT == no; /nonexistent is echoed along with
  atf_skip to ensure that the test will fail if dict(..) is called in the
  non-final stage of the pipeline

Submitted by: pho
2014-11-03 21:21:08 +00:00
Enji Cooper
4c8d4de868 Port h_hash and t_sha2 to FreeBSD
t_sha2 contains dirty copy-paste hacks that need to be fixed with the openssh
OpenBSD compat layer

Submitted by: pho
2014-11-01 22:00:46 +00:00
Enji Cooper
6a4bfd1397 Expect :sscanf_whitespace to fail on !NetBSD OSes
Submitted by: pho
2014-11-01 21:30:18 +00:00
Enji Cooper
c069d69178 Skip :fopen_regular on !NetBSD because it's a NetBSD specific test
Submitted by: pho
2014-11-01 21:25:22 +00:00
Enji Cooper
708c5b014e Add new atf_tc_expect_fail to fflush_err; this is a new (within the past couple months) bug 2014-11-01 21:23:27 +00:00
Enji Cooper
c621fcdc50 Disable testcases 12 and 15-22 on FreeBSD
Submitted by: pho
2014-11-01 21:21:06 +00:00
Enji Cooper
952234df16 Expect :snprintf_posarg_error to blow up with a SIGSEGV on !NetBSD OSes 2014-11-01 21:00:40 +00:00
Enji Cooper
d57c6b5e4f Port h_atexit to FreeBSD
__cxa_atexit varies between FreeBSD and NetBSD, and thus we must use pointers
instead of static fields in the BSS. More extensive discussion is included in
the source code

In collaboration with: kib
Submitted by: pho
2014-11-01 20:50:39 +00:00
Enji Cooper
4925f4feec Port t_mincore to FreeBSD
Mark :mincore_resid as atf_tc_expect_fail on FreeBSD because of new bug
discovered in running the tests (it succeeded from earlier on in the year to
September/October on FreeBSD, at least)

Submitted by: pho
2014-11-01 20:45:45 +00:00