From nobody Wed Aug 17 21:29:03 2022 X-Original-To: dev-commits-src-all@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 4M7Lk80Jh4z4ZKMp; Wed, 17 Aug 2022 21:29:04 +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 4M7Lk76Z5wz3Mfg; Wed, 17 Aug 2022 21:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660771744; 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=GWffOUSWSvPcsnSgvqzbXitYJrS88F66+jmCaMmtsHw=; b=xpdzuQ4hvi05L+JIUDd3QJXS9ETUCUQHIQG0h/N4cnYypu0mFWJPX+Dw13xpcAHjtA/V9J wsJ2dOLSb0dff2M67X8Nhk0OPF0TfpwFXpbwTOJhpI/wi0Ae/Fd75vyLqS8THHYXewUDBT RL4+e+JhvC3avry4azMdRY2xVour0FTVyarNXCalcKDSROltiTxLguN+I8SYFj6sEsxonT QVeAjmQGuIhs1eRrKtq+Okcvhod8zDRF9Hf5fDwCc/D8iRRKDblFf/gngsNaB9AMwy0bAd O/9yixnvXaxNag0rNG6CRVdEB+6AEYzPm2IfdtohuhsfHqSEVLd2Y3PUEvA2PQ== 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 4M7Lk75gr9z14HR; Wed, 17 Aug 2022 21:29:03 +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 27HLT37s028054; Wed, 17 Aug 2022 21:29:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27HLT3HO028053; Wed, 17 Aug 2022 21:29:03 GMT (envelope-from git) Date: Wed, 17 Aug 2022 21:29:03 GMT Message-Id: <202208172129.27HLT3HO028053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8502144d7a09 - main - makefs tests: Add test cases for handling of multiple staging dirs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8502144d7a09c503b3b438924bfc0fd7cad19885 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660771744; 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=GWffOUSWSvPcsnSgvqzbXitYJrS88F66+jmCaMmtsHw=; b=MhXnM/oVNPcxmkEXFHdIyQxNEnjzefsUPK574hi5Yad9BM1u8WF++lI5vgq7vzS/uv7UL+ iXAWb22GBxCUbwD436H3GHkrqvO87zRbmScirOTjtl6bMfFHN47GQQGXO6QooiqRowPJp4 F52FK2HMnkC2Z1PACOxQhXdVMDXlRbHvUcHxtC6N/VUUHF8ZC85toJnLTrWfaFLhY/I2oB CT9fgUky2wN8HceGnYhscuzH90C/9ungMxF8vd4BIgjdQOC/W3IvIxZ6DKq2hzYPqMOr2B O5Keyh/Icv6Qq90531h4jVfg4cbxqYR7EUJN/kCP+5GtZqtrkXhT+aYswLhYCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660771744; a=rsa-sha256; cv=none; b=jvL/pdT4Emr+v13AIy/aCea19JY7F5q/erTohhl/uJe1wrXnP86TCO00Ruh8dg8ryt3QRF KjB6EzU54gUq2iJE7UMYvo2tUD4LMqzxqbBloFnlaGsPkmQdtxLOUb1nqN6xWUBhlOs1oD oquAAhQZlAHJ3yeQqxN2mv1WMaik3QMlnH2iDlp6+m1SxSjuUfdvpBCNTvFY9foKATDj/5 MGY0W856Qf96YIi1PllyiaIOdrw1e2s1y16xPgHGMoaduZ1Of3qizSM5yhAZ3N1wH3vIvb WyZiZNKkAC3PaFheCQSdxTrSkR7gv4BAUiyrBwflaYzkU32ysXbAk9meBfQeFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8502144d7a09c503b3b438924bfc0fd7cad19885 commit 8502144d7a09c503b3b438924bfc0fd7cad19885 Author: Mark Johnston AuthorDate: 2022-08-17 21:27:06 +0000 Commit: Mark Johnston CommitDate: 2022-08-17 21:28:01 +0000 makefs tests: Add test cases for handling of multiple staging dirs Sponsored by: The FreeBSD Foundation --- usr.sbin/makefs/tests/makefs_zfs_tests.sh | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/usr.sbin/makefs/tests/makefs_zfs_tests.sh b/usr.sbin/makefs/tests/makefs_zfs_tests.sh index cefeed637ac7..a0e81bbd9a52 100644 --- a/usr.sbin/makefs/tests/makefs_zfs_tests.sh +++ b/usr.sbin/makefs/tests/makefs_zfs_tests.sh @@ -497,6 +497,88 @@ multi_dataset_4_cleanup() common_cleanup } +# +# Validate handling of multiple staging directories. +# +atf_test_case multi_staging_1 cleanup +multi_staging_1_body() +{ + local tmpdir + + create_test_dirs + cd $TEST_INPUTS_DIR + + mkdir dir1 + echo a > a + echo a > dir1/a + echo z > z + + cd - + + tmpdir=$(mktemp -d) + cd $tmpdir + + mkdir dir2 dir2/dir3 + echo b > dir2/b + echo c > dir2/dir3/c + ln -s dir2/dir3c s + + cd - + + atf_check $MAKEFS -s 1g -o rootpath=/ -o poolname=$ZFS_POOL_NAME \ + $TEST_IMAGE ${TEST_INPUTS_DIR} $tmpdir + + import_image + + check_image_contents -d $tmpdir +} +multi_staging_1_cleanup() +{ + common_cleanup +} + +atf_test_case multi_staging_2 cleanup +multi_staging_2_body() +{ + local tmpdir + + create_test_dirs + cd $TEST_INPUTS_DIR + + mkdir dir + echo a > dir/foo + echo b > dir/bar + + cd - + + tmpdir=$(mktemp -d) + cd $tmpdir + + mkdir dir + echo c > dir/baz + + cd - + + atf_check $MAKEFS -s 1g -o rootpath=/ -o poolname=$ZFS_POOL_NAME \ + $TEST_IMAGE ${TEST_INPUTS_DIR} $tmpdir + + import_image + + # check_image_contents can't easily handle merged directories, so + # just check that the merged directory contains the files we expect. + atf_check -o not-empty stat ${TEST_MOUNT_DIR}/dir/foo + atf_check -o not-empty stat ${TEST_MOUNT_DIR}/dir/bar + atf_check -o not-empty stat ${TEST_MOUNT_DIR}/dir/baz + + if [ "$(ls ${TEST_MOUNT_DIR}/dir | wc -l)" -ne 3 ]; then + atf_fail "Expected 3 files in ${TEST_MOUNT_DIR}/dir" + fi +} +multi_staging_2_cleanup() +{ + common_cleanup +} + # # Rudimentary test to verify that two ZFS images created using the same # parameters and input hierarchy are byte-identical. In particular, makefs(1) @@ -623,6 +705,8 @@ atf_init_test_cases() atf_add_test_case multi_dataset_2 atf_add_test_case multi_dataset_3 atf_add_test_case multi_dataset_4 + atf_add_test_case multi_staging_1 + atf_add_test_case multi_staging_2 atf_add_test_case reproducible atf_add_test_case snapshot atf_add_test_case soft_links