From nobody Thu Sep 07 17:05:35 2023 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 4RhQbz3fp6z4s1yq; Thu, 7 Sep 2023 17:05:35 +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 4RhQbz2Prpz4Dyk; Thu, 7 Sep 2023 17:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694106335; 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=rCFcz1FycBdIVgqBwSvYfxKLvyKveWiqvHEhoCAeoOA=; b=HMKKeS63x7ZM801pxLQQfNajyiCUOPOKrTDDw+sRo45dAjPxAcXA4gkfS2LLJIrv7nq8Ht tJPB6BxPcZpeoC5OXrSmM03qxqFhGscj0BRVHmlbJ6EhFkTfc1aDMfYHFFpb7B0iA7XTVs v1LctfgaVdQoJLCHn5EG6S6aPOYVTWtUAVdugHOM+aFdkcNqYxxdkWUVbvxLBf1naAnxgC QL8z1vze0MzMce6LCwpsao667KERm01qUYdo9Y+R6GwMLP/8NFr+tPUB+aV4gyPu/kmbiX h//l9qFWDQRnGMjNkvGw7dsr2itDHnO2m9tgqk0QNHIkVwVDRgVh8I0zWteBpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694106335; a=rsa-sha256; cv=none; b=uku3kdxcp2O/cr7knwnvCQVoffSfCavCaDf14THUILROHHwSZ/WIp9Gu5fxyFnCSTWWbNU B6R3b9OYfxrWUpnMqNFkzzv/hjwRvzJUtIxVOwvHs8D9wxgyas7Pdk+RlTANixEEkfRXL9 oMSVU6vqUtq9OrGvzlbKXE+1hZ5xuxoPvGLXbYV69TfqN0BkbIGrqObsWy3+fwH0P8DAmq 3xNCrAtCGRxGkRRVmaKZp6syYRHvLiPJ3m2uaOUcxCNgM8YUoz/W/VyewnS98m7ThrwMYa gdYVePAyOyGRcnvCQb9MrU+zFrpqvYp1iftJgXCbUs52sZbe6CWT6Of/p5Y2bw== 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=1694106335; 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=rCFcz1FycBdIVgqBwSvYfxKLvyKveWiqvHEhoCAeoOA=; b=buDV8Zj4CfQpXz7Q7C6QqKiuZfRXjpOdYfedf46ZXrFHBIzSGWBLw/+t4X29ONQti7D2ML Sc0s9/oAFiU1h73nhfc0AE++52Q8MvLAUH0mtKdOJy6hivL1ngWwvhBF4pQ4yWKavpoVwB 5WwlabCf8zKqKo05qPqY+3WE46DM79Wi6tM+50pFvXrVknaOOGVHnUhVbcXyCVLOD5O4C4 o1T6R/hfQkh4iL17FTR2XQbmdiSxMzeZIFpND/wREqTiK4nFxuYeFwPqI/VjlQbwYJQu8j dMFhj0zdYcScdpJHbmvAXzg58LWoLRJ2D4scuFNKt5cy5oAiwAHDcpuNW5Wepg== 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 4RhQbz1WNyz169K; Thu, 7 Sep 2023 17:05:35 +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 387H5ZjU032647; Thu, 7 Sep 2023 17:05:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 387H5Zvr032644; Thu, 7 Sep 2023 17:05:35 GMT (envelope-from git) Date: Thu, 7 Sep 2023 17:05:35 GMT Message-Id: <202309071705.387H5Zvr032644@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: 97340b68d18b - main - pf tests: extend SCTP tests to test state removal through ASCONF 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97340b68d18bbbdebf0f73ed900c5a33894061dd Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=97340b68d18bbbdebf0f73ed900c5a33894061dd commit 97340b68d18bbbdebf0f73ed900c5a33894061dd Author: Kristof Provost AuthorDate: 2023-09-05 17:00:49 +0000 Commit: Kristof Provost CommitDate: 2023-09-07 17:05:01 +0000 pf tests: extend SCTP tests to test state removal through ASCONF pf can now mark shut down multihomed connections shutting down. Verify that pf does the right thing. MFC after: 3 weeks Sponsored by: Orange Business Services --- tests/sys/netpfil/pf/sctp.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.py b/tests/sys/netpfil/pf/sctp.py index b24d0c414ac8..5e6dca5dd64b 100644 --- a/tests/sys/netpfil/pf/sctp.py +++ b/tests/sys/netpfil/pf/sctp.py @@ -342,6 +342,24 @@ class TestSCTP(VnetTestTemplate): assert re.search(r"all sctp 192.0.2.1:.*192.0.2.3:1234", states) assert re.search(r"all sctp 192.0.2.10:.*192.0.2.3:1234", states) + # Now remove 192.0.2.1 as an address + client.bindx("192.0.2.1", False) + + # We can still communicate + try: + client.send(b"More data", 0) + rcvd = self.wait_object(srv_vnet.pipe, 5) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] =="More data" + finally: + # Debug output + ToolsHelper.print_output("/sbin/pfctl -ss -vv") + + # Verify that state is closing + states = ToolsHelper.get_output("/sbin/pfctl -ss") + assert re.search(r"all sctp 192.0.2.1:.*192.0.2.3:1234.*SHUTDOWN", states) + class TestSCTPv6(VnetTestTemplate): REQUIRED_MODULES = ["sctp", "pf"] TOPOLOGY = { @@ -440,3 +458,21 @@ class TestSCTPv6(VnetTestTemplate): states = ToolsHelper.get_output("/sbin/pfctl -ss") assert re.search(r"all sctp 2001:db8::1\[.*2001:db8::3\[1234\]", states) assert re.search(r"all sctp 2001:db8::10\[.*2001:db8::3\[1234\]", states) + + # Now remove 2001:db8::1 as an address + client.bindx("2001:db8::1", False) + + # Wecan still communicate + try: + client.send(b"More data", 0) + rcvd = self.wait_object(srv_vnet.pipe, 5) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] == "More data" + finally: + # Debug output + ToolsHelper.print_output("/sbin/pfctl -ss -vv") + + # Verify that the state is closing + states = ToolsHelper.get_output("/sbin/pfctl -ss") + assert re.search(r"all sctp 2001:db8::1\[.*2001:db8::3\[1234\].*SHUTDOWN", states)