From nobody Tue Mar 04 22:06:16 2025 X-Original-To: dev-commits-src-branches@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 4Z6qWr3462z5qnFb; Tue, 04 Mar 2025 22:06:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z6qWr2RB4z3bhk; Tue, 04 Mar 2025 22:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741125976; 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=LE25L/HjHvb/89m2p29zUYzeomKV7XrFIZHaSYDoM+E=; b=AVwiVL5ovlN4bo4mls64L38dNZNgpzfunc+s2f5yeEblkJwjz3lSzeYNow5IR7NNw+CaiT BXLb0sdA0xFg4txi6x4EEvqi3b8on82s7sDlNuk6f7TpxTy+jXT8/NWNwId1DLCy0UeKBr rz8vXLEU+K1VxTnC3uLYxhfOhOJ54H255uomWvztZT+huNXAmluxv/By/zE6Zg0mlTfwiZ 93ZuoZHi+79PBzc7dJXKFtAgqrhrlBeDFEQgooVhGEbZ9H++n4pcd5ycAhm4brqdyy2HUc VvZErJ0cosX7xjTRYJMun04jaBuG5eBxy+RFdaiEV/Z1YFDHGLOalNPh14lvIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741125976; a=rsa-sha256; cv=none; b=UeKfr/8o1slyJv+sVBt79H+A0YCxqlkXcjv1zpy10dDwgLtsdxL/Pzd13KabxSaAfauzfM Yz8VKoEoeyd5iIf8QV/PYir3KulSoS84zs1xJlKZwuYoSwgzi+wVCSVxBWnD6a6d7mYqYc 8G0GZi9LGG43Cp5d55g8PmWvNmeYitsTSMgYvI45/nWugjzmJw84jajCCuRInf8hkSfYcX gOtXxPd9BdgLEZ9fg4eazkiCCqvqkLCpxmADeBYjniDGSkU0xHx4wE2IHfjrZn1oP3f8Ff ubB3nC0xF5c9ksqJKdgMAom4w1LSSOoHlK/86ZtlHa+hMyTk6LIBD+fyy56ZDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741125976; 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=LE25L/HjHvb/89m2p29zUYzeomKV7XrFIZHaSYDoM+E=; b=MQZUNSMvXv55PQEvmPSDhbzJOEsI9d6S7S+4jMQFHX/MkYNdn91ZMn2u9M2Vh1+vGtX7b9 hSwA1TdLbPvBm08Q4CuVXhLwP0iWxIHAKZ5BVj6MBY6dTKrYBooVi8IBtf5Ban/NHfixHF ySYbW3touqHkT+AWHykLSO9D2VhMPg2FQsbCbuPo1G/zuyNsFfrONEOj2AB6S+RpDuXEw4 RWP87SBSXleMY7PrwXjBwLCxBmJadJud4lu3pK7BJ6/DY6uso1WBI4OmTfvURFfPgiSoqx Tv/JQ5o9rNah2JIIjAK6IBZsZjRWCt98Wys1eDcvTUwMnMs86hRgwyAb6q46kA== 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 4Z6qWr1jqDzdCQ; Tue, 04 Mar 2025 22:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 524M6GDm061083; Tue, 4 Mar 2025 22:06:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 524M6G7X061080; Tue, 4 Mar 2025 22:06:16 GMT (envelope-from git) Date: Tue, 4 Mar 2025 22:06:16 GMT Message-Id: <202503042206.524M6G7X061080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Igor Ostapenko Subject: git: 9383629ffc92 - stable/14 - kyua: Support require.diskspace ATF metadata List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9383629ffc923fe12ae031820713f68b845af838 Auto-Submitted: auto-generated The branch stable/14 has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=9383629ffc923fe12ae031820713f68b845af838 commit 9383629ffc923fe12ae031820713f68b845af838 Author: Igor Ostapenko AuthorDate: 2025-02-02 19:14:55 +0000 Commit: Igor Ostapenko CommitDate: 2025-03-04 21:09:11 +0000 kyua: Support require.diskspace ATF metadata Reviewed by: ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48333 (cherry picked from commit 6befd3511105a17decdafbf9d3f55324c83aaea1) --- contrib/kyua/doc/kyuafile.5.in | 3 ++- contrib/kyua/engine/atf_list.cpp | 2 ++ contrib/kyua/engine/atf_list_test.cpp | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/contrib/kyua/doc/kyuafile.5.in b/contrib/kyua/doc/kyuafile.5.in index 4fe5f12fd9b1..ae1e4fe40e32 100644 --- a/contrib/kyua/doc/kyuafile.5.in +++ b/contrib/kyua/doc/kyuafile.5.in @@ -282,7 +282,8 @@ ATF: .It Va required_disk_space Amount of available disk space that the test needs to run successfully. .Pp -ATF: not mapped +ATF: +.Va require.diskspace .It Va required_files Whitespace-separated list of paths that the test requires to exist before it can run. diff --git a/contrib/kyua/engine/atf_list.cpp b/contrib/kyua/engine/atf_list.cpp index c4f348ada2f6..f6ec20d7709a 100644 --- a/contrib/kyua/engine/atf_list.cpp +++ b/contrib/kyua/engine/atf_list.cpp @@ -129,6 +129,8 @@ engine::parse_atf_metadata(const model::properties_map& props) mdbuilder.set_string("is_exclusive", value); } else if (name == "require.config") { mdbuilder.set_string("required_configs", value); + } else if (name == "require.diskspace") { + mdbuilder.set_string("required_disk_space", value); } else if (name == "require.files") { mdbuilder.set_string("required_files", value); } else if (name == "require.machine") { diff --git a/contrib/kyua/engine/atf_list_test.cpp b/contrib/kyua/engine/atf_list_test.cpp index 7648ee2c6a80..f3a36ab864f7 100644 --- a/contrib/kyua/engine/atf_list_test.cpp +++ b/contrib/kyua/engine/atf_list_test.cpp @@ -67,6 +67,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) properties["is.exclusive"] = "true"; properties["require.arch"] = "i386 x86_64"; properties["require.config"] = "var1 var2 var3"; + properties["require.diskspace"] = "10g"; properties["require.files"] = "/file1 /dir/file2"; properties["require.machine"] = "amd64"; properties["require.memory"] = "1m"; @@ -95,6 +96,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) .set_description("Some text") .set_has_cleanup(true) .set_is_exclusive(true) + .set_required_disk_space(units::bytes::parse("10g")) .set_required_memory(units::bytes::parse("1m")) .set_required_user("root") .set_timeout(datetime::delta(123, 0)) @@ -293,6 +295,26 @@ ATF_TEST_CASE_BODY(parse_atf_list__is_exclusive_support) } +ATF_TEST_CASE_WITHOUT_HEAD(parse_atf_list__disk_space_support); +ATF_TEST_CASE_BODY(parse_atf_list__disk_space_support) +{ + const std::string text = + "Content-Type: application/X-atf-tp; version=\"1\"\n" + "\n" + "ident: first\n" + "require.diskspace: 123M\n"; + std::istringstream input(text); + const model::test_cases_map tests = engine::parse_atf_list(input); + + const model::test_cases_map exp_tests = model::test_cases_map_builder() + .add("first", model::metadata_builder() + .set_required_disk_space(units::bytes::parse("123M")) + .build()) + .build(); + ATF_REQUIRE_EQ(exp_tests, tests); +} + + ATF_INIT_TEST_CASES(tcs) { ATF_ADD_TEST_CASE(tcs, parse_atf_metadata__defaults); @@ -308,4 +330,5 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, parse_atf_list__one_test_case_invalid_properties); ATF_ADD_TEST_CASE(tcs, parse_atf_list__many_test_cases); ATF_ADD_TEST_CASE(tcs, parse_atf_list__is_exclusive_support); + ATF_ADD_TEST_CASE(tcs, parse_atf_list__disk_space_support); }