From 778588700845f434b1ae7872d5402791fa91bae3 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 9 Nov 2015 06:50:42 +0000 Subject: [PATCH] MFC r289487: Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as bin/dd/tests Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used in validating the characters read from /dev/zero Sponsored by: EMC / Isilon Storage Division git-svn-id: svn://svn.freebsd.org/base/stable/10@290574 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- bin/dd/Makefile | 6 ++++++ bin/dd/tests/Makefile | 12 ++++++++++++ contrib/netbsd-tests/bin/dd/t_dd.sh | 6 ++++++ etc/mtree/BSD.tests.dist | 2 ++ 4 files changed, 26 insertions(+) create mode 100644 bin/dd/tests/Makefile diff --git a/bin/dd/Makefile b/bin/dd/Makefile index eb8ec8527..db6e8544d 100644 --- a/bin/dd/Makefile +++ b/bin/dd/Makefile @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= dd SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c @@ -24,4 +26,8 @@ test: ${PROG} gen .endfor @rm -f gen +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/bin/dd/tests/Makefile b/bin/dd/tests/Makefile new file mode 100644 index 000000000..f87af6524 --- /dev/null +++ b/bin/dd/tests/Makefile @@ -0,0 +1,12 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/dd +TESTSDIR= ${TESTSBASE}/bin/dd + +NETBSD_ATF_TESTS_SH= dd_test + +.include + +.include diff --git a/contrib/netbsd-tests/bin/dd/t_dd.sh b/contrib/netbsd-tests/bin/dd/t_dd.sh index d713ad9cb..62379c241 100755 --- a/contrib/netbsd-tests/bin/dd/t_dd.sh +++ b/contrib/netbsd-tests/bin/dd/t_dd.sh @@ -44,6 +44,12 @@ length_head() { "the one expected to fail. (NetBSD PR bin/8521)" } length_body() { + # Begin FreeBSD + if ! df /dev/fd | grep -q '^fdescfs'; then + atf_skip "fdescfs is not mounted on /dev/fd" + fi + # End FreeBSD + test_dd_length 512 \ "dd if=/dev/zero of=/dev/fd/5 count=1 5>&1 >/dev/null 2>/dev/null" test_dd_length 512 \ diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 7fe2bd0cf..db307369c 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -10,6 +10,8 @@ .. date .. + dd + .. expr .. ls -- 2.42.0