From nobody Fri May 05 12:45:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCVlS57bHz49HpL; Fri, 5 May 2023 12:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QCVlS2lgyz3KrK; Fri, 5 May 2023 12:45:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683290724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bVfhkvPdBfU/hBhMZwhHICbWnOTI8o11eyR4+u6de8=; b=ruIjG/m/eijGFHwcOb4qotacNTSS3PvLyEQu2C6wsRKOkrU+lzU/wMc+9I42nSXLuGkzVu 1vk9x4hHmrMdtkow++NIBkaeJsEd5SqL7CU1wyCjSEF/qg8VTm1uwRzeXFMNmRdrOwL5Me u2BFFytZoA/bIkUTWKVApOG8L5hoH2Io9grnzy4DaZKWMSLF2UPCd/r6sZNaL4QVzCdQhI +NNGEKce02o1ahMSzfFyrE/4lq7arOSQebbUGQk68ArAFK17knHflhs3ykmCASTy9T8ZJV 7kIZBfQ4hAn5di2K4aGcYTLRpC/9pLm5Q8pmEFiDqi/czrifqjTt1bXCnLk/2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683290724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bVfhkvPdBfU/hBhMZwhHICbWnOTI8o11eyR4+u6de8=; b=WLAbPoi1ZldJsK2T1pxoSQggEGKa9/M1vx4IsB0OyJszjE32zLAWN9zeMkFR8jHEkEutyp BmwJsUIwTAkCR1IZ55PI6p14sciqZCS322tfNFcVu6MkGmbWB621IcTUIsOy4FgdeOLDgg Vl0acCVXHHH9l8zY+kElnzw9yrJSSQLLbq5pbjI0e5S2yHXR488qUJiHJcvRwcOK/V1ZaB m008GZ03esSZ6CQcXx1Dq2xcZi8VcjdRIAsPPNjAx6SVLsYT0/NDvlx6C9mDMthVDmkzpp 1Vq3/AfntPxKk6n/Gx25n8FMe6jN6aLBAlkOZR02w/bWmxSIPRR+CyYoqa40HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683290724; a=rsa-sha256; cv=none; b=FPTta/hQGHAq/7D+ky/nvEDs8hzDkg2qowq9KO7M5Z74tG07C5NU9htJfc1fJJRld6qaSF 1JoAf1lI9sq96Lhfx9lcHrbil92I4gfl+9en0+y4TGG+YTGB5PNpmA/oHwF8tfhg/Q1vnN uvXZ1G0Ojc9jxPZ99qU5OT2ncLdRi6UgwJKeytMsJWT66oApR+g4PLvvATZjKeQRDgqBZP kXbAAH5n6G0Tbs1lYZB4d7AMfd5qvGI8dmMjS/GJFZoSqC5NICsul3pdOScZBdquRrg+Yy oGeMWzJLZihQgzRfK5hgcLRpPPAjRFD6rRhAkP9iyvZ4Ys0xz7MP8OPrqUkv+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCVlQ2FBfzvq4; Fri, 5 May 2023 12:45:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 345CjMWH048252; Fri, 5 May 2023 12:45:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 345CjMRU048251; Fri, 5 May 2023 12:45:22 GMT (envelope-from git) Date: Fri, 5 May 2023 12:45:22 GMT Message-Id: <202305051245.345CjMRU048251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: dabef9818f32 - main - dd: Tidy up the tests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dabef9818f324a8b3cba2a361aff1d74e97be45e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dabef9818f324a8b3cba2a361aff1d74e97be45e commit dabef9818f324a8b3cba2a361aff1d74e97be45e Author: Dag-Erling Smørgrav AuthorDate: 2023-05-05 11:17:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-05 12:42:32 +0000 dd: Tidy up the tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D39711 --- bin/dd/tests/dd2_test.sh | 48 ++++++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/bin/dd/tests/dd2_test.sh b/bin/dd/tests/dd2_test.sh index c0b33fc17226..7632de3bde22 100755 --- a/bin/dd/tests/dd2_test.sh +++ b/bin/dd/tests/dd2_test.sh @@ -1,30 +1,8 @@ # # Copyright (c) 2017 Spectra Logic Corporation -# All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. +# SPDX-License-Identifier: BSD-2-Clause # -# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ - atf_test_case max_seek max_seek_head() @@ -33,17 +11,23 @@ max_seek_head() } max_seek_body() { - 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";; + 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 sparse files" + ;; + *) + atf_skip "Unknown file system" + ;; esac touch f.in - seek=`echo "2^63 / 4096 - 1" | bc` + seek=$(bc -e "2^63 / 4096 - 1") atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek } @@ -55,7 +39,7 @@ seek_overflow_head() seek_overflow_body() { touch f.in - seek=`echo "2^63 / 4096" | bc` + seek=$(bc -e "2^63 / 4096") 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 atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \