From nobody Tue Jun 4 14:59:37 2024 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 4VttzY49tHz5Lc8d; Tue, 04 Jun 2024 14:59:37 +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 4VttzY3Jdvz4rLr; Tue, 4 Jun 2024 14:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717513177; 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=ODgfYjCSbNg1UdqK9Y2Y/Yal30JyV3aXKb07VSmKY1o=; b=fXGb9WDfTj7XplZk7p6KxbRTsgZutJwNJ6g1ijkQjHShuMgSkUuIkV599QT7qqB7LkP6sK mucWe8jrObSot1SePV80C8ldHYtzmzWmnAnNsQo/U6ZqFVo+DS4VVcksqdUp7guXbs0hwx QYRcOoaC+nHIHa3cjIVrp45d1hMZrutZfLOlU48l1sFZGwGf1MJNAjNoRVc2TJ0oMGiSHa Xuu7OWyRd8bjKUf7UCBNhTsxzq5ZdJiROHqVxBnrgP6e2eZ3arrDJS6UT+T20e0IzEMWB0 GaR7G+kjCWiGoYsPdMJz9mz8kcA1D7+sLuRUDG41OtRSrzZwXM7yMrht2HNvsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717513177; a=rsa-sha256; cv=none; b=hGoSmd3cZIDReDZ53T6Ki8A9r4Luyf83cBcx348jYjsgMTOFPRulLwhWueAYWs1Bv8M+YG fBRplPW2JhjMSw4oXbxySi8nb+nscgkitklhM223rybAs/pDS/u+tph7j5TFBMUYH4VHx5 CUgBXhm+Me30Nki0u9Y/1VAKjapL1wEFEkrLr10JUdNNq8OF9OxuLFWTFKFgxQ7VGAWFS+ iN/kL7DEy0C4+CtNB3QWm85TCw896VZNipbG88mMkpblYM/IxABXljA2FJsUqkolig5Y7u SQBAkKrr1AlU/eHD5XUSwqgcIEfVdLE1VHi96v0jr0M3R+MmvMrmYMEKnqUCfw== 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=1717513177; 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=ODgfYjCSbNg1UdqK9Y2Y/Yal30JyV3aXKb07VSmKY1o=; b=WGBX051zaYMmcr6xEpmptxtMeY5QeUsmpZqsg0EyOBY/nhyKTgjW8wBgRD3HM0nXA2QAQe Uv3zzh1aJ0ViJcr1SchU9sfWZi149SS/SEhD8nntAWRjdTc84RhfTIve6PtJ/KLrTaWUS7 5FtAjMcV5Z+I8fKjJG5jdvisnZ6CE8oTyFrCBATSzLDT1rdjVuCR0nU052jjRae7omgYdq hN4D84Vqq/Pq97RqxppitDLMw0Q/haS42HTHARI8Utqe7kgGw/2vHed+ZiO8FwXYp83JOm yaUWcEgbgDK8ZCkTTMZM7hnZUXY+ZIM7nFtHC56SWVyZXn3SkJ6l5K07uW+fxg== 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 4VttzY2xDlzNZK; Tue, 4 Jun 2024 14:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 454Exb02050234; Tue, 4 Jun 2024 14:59:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 454ExbV0050231; Tue, 4 Jun 2024 14:59:37 GMT (envelope-from git) Date: Tue, 4 Jun 2024 14:59:37 GMT Message-Id: <202406041459.454ExbV0050231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: cce69517551d - main - pf tests: basic debug level test 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cce69517551d954105aeb72d083af55d901103bf Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cce69517551d954105aeb72d083af55d901103bf commit cce69517551d954105aeb72d083af55d901103bf Author: Kristof Provost AuthorDate: 2024-06-01 18:07:56 +0000 Commit: Kristof Provost CommitDate: 2024-06-04 12:59:59 +0000 pf tests: basic debug level test Set & retrieve the debug level. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/debug.sh | 56 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 5c0e43cbbf23..089db2f19766 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -7,6 +7,7 @@ TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= altq \ anchor \ + debug \ divert-to \ dup \ ether \ diff --git a/tests/sys/netpfil/pf/debug.sh b/tests/sys/netpfil/pf/debug.sh new file mode 100644 index 000000000000..18a7febfbb5b --- /dev/null +++ b/tests/sys/netpfil/pf/debug.sh @@ -0,0 +1,56 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Test setting and retrieving debug level' + atf_set require.user root +} + +basic_body() +{ + pft_init + + vnet_mkjail debug + atf_check -s exit:0 -e ignore \ + jexec debug pfctl -x loud + + atf_check -s exit:0 -o match:'Debug: Loud' \ + jexec debug pfctl -si +} + +basic_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +}