From owner-svn-src-stable@freebsd.org Mon Oct 1 15:40:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF9610C1A46; Mon, 1 Oct 2018 15:40:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA267C0C7; Mon, 1 Oct 2018 15:40:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4103A22D80; Mon, 1 Oct 2018 15:40:07 +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 w91Fe74K096504; Mon, 1 Oct 2018 15:40:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w91Fe7js096503; Mon, 1 Oct 2018 15:40:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201810011540.w91Fe7js096503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 1 Oct 2018 15:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339048 - stable/11/usr.sbin/makefs/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/usr.sbin/makefs/tests X-SVN-Commit-Revision: 339048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2018 15:40:08 -0000 Author: asomers Date: Mon Oct 1 15:40:06 2018 New Revision: 339048 URL: https://svnweb.freebsd.org/changeset/base/339048 Log: MFC r336582: makefs(8): add test case for PR 229929 Fix two failing makefs test cases by adding "-M 1m", which was already used for every other FFS test case. Add a new test case for the underlying issue: with no -M, -m, or -s options, makefs can underestimate image size. PR: 229929 Reported by: Jenkins Modified: stable/11/usr.sbin/makefs/tests/makefs_ffs_tests.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- stable/11/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Oct 1 14:57:33 2018 (r339047) +++ stable/11/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Oct 1 15:40:06 2018 (r339048) @@ -53,6 +53,29 @@ check_ffs_image_contents() check_image_contents "$@" } +# With no -M, -m, or -s options, makefs should autocalculate the image size +atf_test_case autocalculate_image_size cleanup +autocalculate_image_size_body() +{ + atf_expect_fail "PR 229929 makefs(8) can underestimate image size" + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR + + cd $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE + cd - + + mount_image + check_ffs_image_contents +} +autocalculate_image_size_cleanup() +{ + common_cleanup +} + atf_test_case D_flag cleanup D_flag_body() { @@ -109,7 +132,7 @@ from_mtree_spec_file_body() cd $TEST_INPUTS_DIR atf_check -e empty -o not-empty -s exit:0 \ - $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE + $MAKEFS -M 1m $TEST_IMAGE $TEST_SPEC_FILE cd - mount_image @@ -132,7 +155,7 @@ from_multiple_dirs_body() touch $test_inputs_dir2/multiple_dirs_test_file atf_check -e empty -o not-empty -s exit:0 \ - $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 + $MAKEFS -M 1m $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 mount_image check_image_contents -d $test_inputs_dir2 @@ -224,6 +247,8 @@ o_flag_version_2_cleanup() atf_init_test_cases() { + + atf_add_test_case autocalculate_image_size atf_add_test_case D_flag atf_add_test_case F_flag