From nobody Thu May 12 19:58:15 2022 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 8C2531ADEBA1; Thu, 12 May 2022 19:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KzjJ7602tz4YGx; Thu, 12 May 2022 19:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652385496; 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=onm4BXCMPYfcHEMrbyCk6Xm03GN1/CZhf31B+gaUlCA=; b=iavrnm4cDOH35xhDMNxsmG2YxsTGBc80a6DVCZSyJstS36zgKz/+TYyJJIMwRrUxwTdZ/C 8fhpX+rQTD4ZxBs5jl6+Gmv/JXYr/0W0fdbEAsnNoE86elXcGJjKpCiGp5rqQyY72rTqqh cc9HsYO6nAmoBSCAUdh1IztxS9uO9pJj4HFKwK2oVTMd4NFh/Cz6OYy3WvnCR1Q+S2R7A0 L7EFYaYUqekBE5j5mgKCPXgvas4RrmN+/w18mmYRnY82GEjoIg4SkZDJ4UZyQszZyy/GEQ GVU2W+PtE46JVrZsNQ37fcvAbDL7Zb/nrdUYipFV9OZ+NCQ6ylgYjvirUvlcuQ== 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 4DDA514651; Thu, 12 May 2022 19:58:15 +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 24CJwFqa075611; Thu, 12 May 2022 19:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24CJwFgv075610; Thu, 12 May 2022 19:58:15 GMT (envelope-from git) Date: Thu, 12 May 2022 19:58:15 GMT Message-Id: <202205121958.24CJwFgv075610@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: 1977d9a37b88 - main - pf tests: factor out common dummynet check 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 1977d9a37b880657512f16bd46e0656c02d19b29 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652385496; 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=onm4BXCMPYfcHEMrbyCk6Xm03GN1/CZhf31B+gaUlCA=; b=Aw8Cz+A32GVdhb274Rl+nnhI57OthPxPbyDosjubd3uv98SbkXfE9g/+U4QJeZOpaqZFm0 ey5rdEqZgE4AiWucj24Mf3nWWod6Doc6oM+sDpLUmTphaMBqI00386BZr6LIz3hGDFlABW j+ViTlSK/Y3PA5/YR7tn7UyEOjHiuQVrLResK3ovceIpHv97DnSMXuCZB7PD+bJT53tWV5 oi6U5xx/ZJNvi3IdOSrcN3TUjCkpIQuHTZZPyqJB8frDZpdOThoHTre+4s5abEiTPa+MTH CMG9FZpskLlyTPr3YuI5A22cCHodcFntOZYTFx/rmD1SKngQr3m05wTR6PuSpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652385496; a=rsa-sha256; cv=none; b=fwIJAlnhCnuMbgPMUAOh1RcDAoi6VTOJsN6Lem/GJTE66uqUvp07IukeidDWNVI/u6NNAe bWRkngj/AhTAOwyivNotNe1bd+erWjLyV7B7vnmctlNvpGJXAosU35P/DRFaOSdIB9pnfb s46yiepWddGu2uJhq4Vnz26Y26vFRh4yb0bjn67POG+42mHLL7E00bOG/4QbWzkJUQ3+Ss 79rvIO6/2vbUfspbfo3PeDa+hUO+I3S3p2iL+K29LnNoGzN9HiYTG5vcPeTwGIuzMnpmug Bma6mNn65MAmghO/v8x2v2WZVHQ1+gWqDOdbxVkb4/40FMyT8dgwPXKwngY8Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1977d9a37b880657512f16bd46e0656c02d19b29 commit 1977d9a37b880657512f16bd46e0656c02d19b29 Author: Kristof Provost AuthorDate: 2022-05-09 10:14:00 +0000 Commit: Kristof Provost CommitDate: 2022-05-12 19:50:10 +0000 pf tests: factor out common dummynet check Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D35160 --- tests/sys/netpfil/pf/ether.sh | 6 +----- tests/sys/netpfil/pf/match.sh | 5 +---- tests/sys/netpfil/pf/utils.subr | 9 +++++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh index da936c9cfaeb..975438dc3438 100644 --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -326,11 +326,7 @@ captive_long_body() # Host is client, jail 'gw' is the captive portal gateway, jail 'srv' # is a random (web)server. We use the echo protocol rather than http # for the test, because that's easier. - pft_init - - if ! kldstat -q -m dummynet; then - atf_skip "This test requires dummynet" - fi + dummynet_init epair_gw=$(vnet_mkepair) epair_srv=$(vnet_mkepair) diff --git a/tests/sys/netpfil/pf/match.sh b/tests/sys/netpfil/pf/match.sh index 304c4e01ea71..d6bcf7aeb1bf 100644 --- a/tests/sys/netpfil/pf/match.sh +++ b/tests/sys/netpfil/pf/match.sh @@ -36,10 +36,7 @@ dummynet_head() dummynet_body() { - pft_init - if ! kldstat -q -m dummynet; then - atf_skip "This test requires dummynet" - fi + dummynet_init epair=$(vnet_mkepair) vnet_mkjail alcatraz ${epair}b diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index a010374993ff..f4f7f4fe4d83 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -87,6 +87,15 @@ pflog_init() fi } +dummynet_init() +{ + pft_init + + if ! kldstat -q -m dummynet; then + atf_skip "This test requires dummynet" + fi +} + pft_set_rules() { jname=$1