From nobody Tue Jan 25 05:03:26 2022 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 D339C197B7F0; Tue, 25 Jan 2022 05:03:27 +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 4JjZW31Zstz3KbH; Tue, 25 Jan 2022 05:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643087007; 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=xa7rUo1DxSXqa7vwqg5k5gFFRiVBaPtPNuKuSr7nwHI=; b=hEz0RHAUXt1Op9YqbejW127359N1jovuWr4eLQsvafEpOoYO5Ww2wPeO0FnYLfLgSq/rJs 5zS7zK0l7laXGKVfkn3P6ZBnW/vN2h3hDH0DmFNOlLP1BIwsgS38sV4YmBX3WTlqIPcSjs jjcFnD2Z++jh1/iUQs7RrH4/LlbNlutrKMu5Az3j57OVc2e9DGOXGRNgFtzxCVrQplaRkr 09HlUf5QibKZClJQr+4uPD8oS7yYYyGGQOCMQoUPxFWSuzMq8yf2oXKuUhUbofufw/L+ML vt68kQHVhkyqO39PEcCVoOknQ3jyOdW+CZ7GBitYOpcOe5mFbeRHvTW/KXVdAw== 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 02A8923AD6; Tue, 25 Jan 2022 05:03:26 +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 20P53Q89023797; Tue, 25 Jan 2022 05:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20P53QSp023796; Tue, 25 Jan 2022 05:03:26 GMT (envelope-from git) Date: Tue, 25 Jan 2022 05:03:26 GMT Message-Id: <202201250503.20P53QSp023796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 4a178afb4aa9 - main - tests/netinet: add test for IPv6 NS and CARP 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a178afb4aa9876094c19faf6d3bf065a5ebe163 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643087007; 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=xa7rUo1DxSXqa7vwqg5k5gFFRiVBaPtPNuKuSr7nwHI=; b=T5Rprw5S4f8sBZg7FTqrfEf7a4g5KC++ombG/B+nG2/pwcNu7lU0C4xmBHtk8yTpDTtSxa cuGZD+4rfczvZt3ChPMzvjHI+AYzKUiw6BUsg8iSE134g4W6T50Lte5GAb1scHBfClTMdE KsQpT9d2Pcv16tN87k6FITId/AkcFe3FSirxtGsIUja5cwx5t0lMiQu0GWDcfO5E1+bv0K Rw7K6XhN+4mD9KqCiSZOza5dqExccpXZJTDGELtXzkHqQkHGpUwY1T0CRTb9DiRwlN4PzW v3ceke1ri3wxHnUEvMOfX59L+8SzWu2q5+oSnJRXEOQYoY4CAyQOqLzz8P5fjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643087007; a=rsa-sha256; cv=none; b=dkiGS4n3LqiWCabtsq750XBpVvZ3ODNfP6guVG9aRVTKOnJ9G8qq1f6bAFjP9wI6o3G5AC or8bj3bhUwtSxqKUxxrxPzxqXHmw5H5wRgCNj2S6XMcxs4OB3ySDmJzhWx3rtzAjIOxCZH 1QmXNikM6bR0DpksOzbd0cst7uMWzKQ5ucN3WmIaeIeyHhVyTZimOlyT1FKDCWqLRxXgv4 qIH/sFln57T5CWFJfnrMRkWySeQlMWxerRecysWf+fKhhfAbsfYId4GW0I9tvPnwlU6Dzl prKk1MlbJ6Wiin3nqd6OKRNIQ/9oH9DXpdL7R1xU7zaVa60hNGwli5GTiIQ4Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4a178afb4aa9876094c19faf6d3bf065a5ebe163 commit 4a178afb4aa9876094c19faf6d3bf065a5ebe163 Author: Thomas Steen Rasmussen AuthorDate: 2022-01-25 05:02:47 +0000 Commit: Gleb Smirnoff CommitDate: 2022-01-25 05:02:47 +0000 tests/netinet: add test for IPv6 NS and CARP PR: 193280 Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D33859 --- tests/sys/netinet/carp.sh | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index 267e70ebf0dc..95cb7847ae28 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -195,9 +195,73 @@ negative_demotion_cleanup() vnet_cleanup } + + +atf_test_case "nd6_ns_source_mac" "cleanup" +nd6_ns_source_mac_head() +{ + atf_set descr 'CARP ndp neighbor solicitation MAC source test (IPv6)' + atf_set require.user root +} + +nd6_ns_source_mac_body() +{ + carp_init + + bridge=$(vnet_mkbridge) + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + vnet_mkjail carp_ndp_v6_bridge ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_ndp_v6_master ${epair_one}b + vnet_mkjail carp_ndp_v6_slave ${epair_two}b + + jexec carp_ndp_v6_bridge ifconfig ${bridge} inet6 2001:db8::0:4/64 up \ + no_dad + jexec carp_ndp_v6_bridge ifconfig ${bridge} addm ${epair_one}a \ + addm ${epair_two}a + jexec carp_ndp_v6_bridge ifconfig ${epair_one}a up + jexec carp_ndp_v6_bridge ifconfig ${epair_two}a up + + jexec carp_ndp_v6_master ifconfig ${epair_one}b inet6 \ + 2001:db8::1:2/64 up no_dad + jexec carp_ndp_v6_master ifconfig ${epair_one}b inet6 add vhid 1 \ + advskew 0 2001:db8::0:1/64 + + jexec carp_ndp_v6_slave ifconfig ${epair_two}b inet6 \ + 2001:db8::1:3/64 up no_dad + jexec carp_ndp_v6_slave ifconfig ${epair_two}b inet6 add vhid 1 \ + advskew 100 2001:db8::0:1/64 + + wait_for_carp carp_ndp_v6_master ${epair_one}b \ + carp_ndp_v6_slave ${epair_two}b + + # carp_ndp_v6_master is MASTER + + # trigger a NS from the virtual IP from the BACKUP + atf_check -s exit:2 -o ignore jexec carp_ndp_v6_slave \ + ping -6 -c 3 -S 2001:db8::0:1 2001:db8::0:4 + + # trigger a NS from the virtual IP from the MASTER, + # this ping should work + atf_check -s exit:0 -o ignore jexec carp_ndp_v6_master \ + ping -6 -c 3 -S 2001:db8::0:1 2001:db8::0:4 + + # ndp entry should be for the virtual mac + atf_check -o match:'2001:db8::1 +00:00:5e:00:01:01' \ + jexec carp_ndp_v6_bridge ndp -an +} + +nd6_ns_source_mac_cleanup() +{ + vnet_cleanup +} + + atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" atf_add_test_case "negative_demotion" + atf_add_test_case "nd6_ns_source_mac" }