From owner-svn-src-head@freebsd.org Sat Jun 3 18:29:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B68ABF6E5F; Sat, 3 Jun 2017 18:29:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4913479BBC; Sat, 3 Jun 2017 18:29:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53ITILa058753; Sat, 3 Jun 2017 18:29:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53ITIwT058752; Sat, 3 Jun 2017 18:29:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201706031829.v53ITIwT058752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 3 Jun 2017 18:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319551 - head/bin/dd/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 18:29:19 -0000 Author: asomers Date: Sat Jun 3 18:29:18 2017 New Revision: 319551 URL: https://svnweb.freebsd.org/changeset/base/319551 Log: Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS Split the postive and negative parts into separate test cases. The positive test case can only run on ZFS, because only ZFS supports files that large. PR: 219757 Reported by: ngie MFC after: 18 days X-MFC-with: 319339 Modified: head/bin/dd/tests/dd2_test.sh Modified: head/bin/dd/tests/dd2_test.sh ============================================================================== --- head/bin/dd/tests/dd2_test.sh Sat Jun 3 18:25:36 2017 (r319550) +++ head/bin/dd/tests/dd2_test.sh Sat Jun 3 18:29:18 2017 (r319551) @@ -26,21 +26,35 @@ # $FreeBSD$ -atf_test_case seek_overflow -seek_overflow_head() +atf_test_case max_seek +max_seek_head() { - atf_set "descr" "dd(1) should reject too-large seek values" + atf_set "descr" "dd(1) can seek by the maximum amount" } -seek_overflow_body() +max_seek_body() { - atf_expect_fail "fails with 'dd: truncating f.out: File too large' - bug 219757" + case `df -T . | tail -n 1 | cut -wf 2` in + "ufs") + atf_skip "UFS's maximum file size is too small";; + "zfs") ;; # ZFS is fine + "tmpfs") + atf_skip "tmpfs can't create arbitrarily large spare files";; + *) atf_skip "Unknown file system";; + esac touch f.in - # Positive tests seek=`echo "2^63 / 4096 - 1" | bc` atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek +} - # Negative tests +atf_test_case seek_overflow +seek_overflow_head() +{ + atf_set "descr" "dd(1) should reject too-large seek values" +} +seek_overflow_body() +{ + touch f.in seek=`echo "2^63 / 4096" | bc` atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \ dd if=f.in of=f.out bs=4096 seek=$seek @@ -50,5 +64,6 @@ seek_overflow_body() atf_init_test_cases() { - atf_add_test_case seek_overflow + atf_add_test_case max_seek + atf_add_test_case seek_overflow }