From nobody Fri Oct 17 21:01:57 2025 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 4cpHLs29Thz6ChS1; Fri, 17 Oct 2025 21:01:57 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cpHLs1D4Xz3vCM; Fri, 17 Oct 2025 21:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760734917; 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=lho7+ifQHnUTP3NDe6avI/jnpopc4jNetVEcxpU731A=; b=CbaGm3ClZK64W+JhoO2qyiQB/stTaoSZsdV6ElKY7YDqN+jj5YR/uvGzOJvAoNpA9c4eDX V9oILCKI6CosljdKl4zNqnO4MEfseAKp2qh7XkR43ZWn23+L/bh9ZgrfiTqDhwGulAPqYg r4PbGSCd0KpDr0Xyq5PTis+csIwlhh7biyF5Z73coZE1HzcnXL0Q+mmdvGWqYthvw25F4B kIqRPoFOXeez9QhvXAXr73lqZsNrjnmsENPRqCY7WhJpnQvJEjtD6URwtD9MjBPA4Dgtay MJZjYj4m76VmBaHVydXXtr+7nG5r06VZpCv8PNnv1kfOOIqCKgg1UkZcDTCHUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760734917; 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=lho7+ifQHnUTP3NDe6avI/jnpopc4jNetVEcxpU731A=; b=QSGkIm4CW4ETX5SbNq2s4tPBJFSZwhG6nRJJfQHMYxvS/LzIUzvVG1u3VCQ1bELdU2lSTS KabjnIW70fihYFhcN8kI05GO8MIr3EOhYxvhgWDHIHnY/HtGQx8WYOjRrJGNPYVZ+92Fm8 8MD7jAZHuI2cCHbyIozzau+oycA6mhkdb0pGLrP1IOYw48jpVVbD9bDIL9MHZlakN/TnUE gxFpXGwO729YVbLwRtJpFPLXAMK2/XDkraVDc2GJestAyOtG50frTKsTNhTfoN9ryKmoBx 4hYCl6fDQS6WGEBebEV19IrfJBpzzQyNiMmH4j7u62kmFOYMKRG4zYiYA3o7uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760734917; a=rsa-sha256; cv=none; b=C9FK60+oLWmq0SyC2Q/QhYlp97nmzb8icHfbN/obNEgPQdG+6WkPAhMvq32bQf2R25zT/M L4osM7dYZlMa/a/5WYw9fC2eJUMOB3fNw6iI9LtPz+yn+1tdUSqs8mpD3eiyIsZBAGKTbc 8DFPIfPquS2cyZRP7n0/GNVyRCSY1TWxcx3U8Ox21uwZzZV0TCJWelakLZcr01s2vGO6Ds VcRutP741cKayrNdFB7kn0zv9AnGoPmMV5MJUdl50Z+XLnlo5e4cXBaV8JTxmTQ4vcH/rp 0zxD0fXgCOFzTQZowtHVn3T6r7QBKrlLyYu+YflcRR6YcLlTU14RAOeyKcQABg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cpHLs0pV6z19Wq; Fri, 17 Oct 2025 21:01:57 +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 59HL1vkV042442; Fri, 17 Oct 2025 21:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59HL1vXv042439; Fri, 17 Oct 2025 21:01:57 GMT (envelope-from git) Date: Fri, 17 Oct 2025 21:01:57 GMT Message-Id: <202510172101.59HL1vXv042439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: e868a2026635 - main - glabel: add a basic test 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e868a2026635c0e083bd6201645add811a7005ba Auto-Submitted: auto-generated The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=e868a2026635c0e083bd6201645add811a7005ba commit e868a2026635c0e083bd6201645add811a7005ba Author: Brad Davis AuthorDate: 2025-10-17 19:55:10 +0000 Commit: Brad Davis CommitDate: 2025-10-17 21:01:33 +0000 glabel: add a basic test Reviewed by: asomers MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D53178 --- tests/sys/geom/class/Makefile | 1 + tests/sys/geom/class/label/Makefile | 7 +++++ tests/sys/geom/class/label/basic.sh | 59 +++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/tests/sys/geom/class/Makefile b/tests/sys/geom/class/Makefile index 3cf3a15273ac..c58ebc0f72a0 100644 --- a/tests/sys/geom/class/Makefile +++ b/tests/sys/geom/class/Makefile @@ -9,6 +9,7 @@ TESTS_SUBDIRS+= concat TESTS_SUBDIRS+= eli .endif TESTS_SUBDIRS+= gate +TESTS_SUBDIRS+= label TESTS_SUBDIRS+= mirror TESTS_SUBDIRS+= multipath TESTS_SUBDIRS+= nop diff --git a/tests/sys/geom/class/label/Makefile b/tests/sys/geom/class/label/Makefile new file mode 100644 index 000000000000..d0072a52c47c --- /dev/null +++ b/tests/sys/geom/class/label/Makefile @@ -0,0 +1,7 @@ +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} + +ATF_TESTS_SH+= basic + +.include diff --git a/tests/sys/geom/class/label/basic.sh b/tests/sys/geom/class/label/basic.sh new file mode 100755 index 000000000000..b67b41567c02 --- /dev/null +++ b/tests/sys/geom/class/label/basic.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2025 Brad Davis +# +# 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. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. +# + +class=label +. $(atf_get_srcdir)/../geom_subr.sh + +atf_test_case create cleanup +create_head() +{ + atf_set "descr" "Create and verify GEOM labels" + atf_set "require.user" "root" +} +create_body() +{ + geom_atf_test_setup + + f1=$(mktemp ${class}.XXXXXX) + atf_check truncate -s 32M "$f1" + attach_md md -t vnode -f "$f1" + + atf_check -s exit:0 -o match:"^Done." glabel create -v test "/dev/$md" + atf_check -s exit:0 -o match:"^label/test N/A $md$" glabel status "/dev/$md" + atf_check -s exit:0 -o match:"^/dev/label/test$" ls /dev/label/test + atf_check -s exit:0 glabel stop test +} +create_cleanup() +{ + geom_test_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case create +}