From nobody Fri Oct 06 16:40:22 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 4S2DgV2BkGz4x2jV; Fri, 6 Oct 2023 16:40:22 +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 4S2DgV1jt1z4Q3q; Fri, 6 Oct 2023 16:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696610422; 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=mEt3l7/EpXOarg5/VthYedOktwGrzv1CC6N0fV7zooQ=; b=VCTJTpqd2Aba7FhMxUsYmVL5Rxrp7vjEomLzTBzRdnI+6VZ7EN7v7548IIbE2c8mSJd/yB HcsuKhwprxFvJKJ2Zy5lFyMsVViUkr1m7jKcZIcxRnclpcThrnfMe51DCc0uI/nd5Bf6RC X6+IFaobl0fnrVPICK1x3F6YN9S0JmY0YibNFOsRNXCxV5eDEJ9ATS1GiztTp7EjLbkG3y y9F0ITxMPWr4nV3A2MWPpXWJnaXJrmWqXB1epXKUf02Lrlrq9z+efkivUOaxnq1HZ8GFUG KOpeya7KO1qGh3ZXCIUxJNwXbD62vu+kMuUBukAD8y6Zj5JO2wWbRuEBZxuU/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696610422; a=rsa-sha256; cv=none; b=aoJ026ac7XNcbQHgLNAeif66VTVLclyCSEwQ3z3ClIE1zcsxjs8gCZWgyGMEAOl1vmbDom +P1S5vtEe9gG5q9mguq+EC4fVJ2F45c1y6a/4bvl7VIhJr9EiJZBKxKfOsF/r51SYhZinS eIqDsjCLpwliexXolz88XM67gc4UtgDJbc5W42sRlKn9bG8vK/gXU+gAC8GIYv7iM8y2LM ZPrcQhk3JUP/ja07XP+k4tmZXhVf9E5gxmuYlyS5CYyu7J8SbGxnbowkkApI+Q8j6lv8gu VwwkyGlYTGIsucjF+VRCuy385a/hxnSQXhSDQM+rVutUnr5/DJoBIlNWjelQmA== 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=1696610422; 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=mEt3l7/EpXOarg5/VthYedOktwGrzv1CC6N0fV7zooQ=; b=H9OJhcgFjkOnlVLy1tR7AQOnEjl7SSxsG06Sr/QsN7PtPh2lKb6QNaYSlBfZzOV6NB0Mc6 Pap40tE8MMXIPD0rBv1hImq5TSoURvOCmURSLU0tA3JYor1PioTgrJL4+bVJmtX8Mj22tK HeFLdfIZFGy9YrGx+bq6XUlh287idkn/DPivBXIPVmz0XUMysD5EJXR/xg0WuzdHBhV/16 d4rrQK1uuUmzu7Oddnpdse9/c9XJjFwCQe+UIJ+zX8+PG1fMzKmD9MShFSkZqZ+jn48WZD TkAPsd3WadW9VtsBQyp0ap+NCo0roOHP3TSFAW1OEOSJ3yAxMCIJhApNTV23Fw== 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 4S2DgV0dDTzvwY; Fri, 6 Oct 2023 16:40:22 +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 396GeMhD019250; Fri, 6 Oct 2023 16:40:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 396GeMZ9019247; Fri, 6 Oct 2023 16:40:22 GMT (envelope-from git) Date: Fri, 6 Oct 2023 16:40:22 GMT Message-Id: <202310061640.396GeMZ9019247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: aad8fb3e2be2 - main - tests: Add a test case for arp host lookups. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aad8fb3e2be27ed3a04531aa01913ab4b7616244 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=aad8fb3e2be27ed3a04531aa01913ab4b7616244 commit aad8fb3e2be27ed3a04531aa01913ab4b7616244 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-06 16:39:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-10-06 16:39:59 +0000 tests: Add a test case for arp host lookups. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D42108 --- tests/sys/netinet/arp.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/sys/netinet/arp.sh b/tests/sys/netinet/arp.sh index 045ccd1dc7a7..9181d38b10b0 100755 --- a/tests/sys/netinet/arp.sh +++ b/tests/sys/netinet/arp.sh @@ -120,12 +120,61 @@ pending_delete_if_cleanup() { } +atf_test_case "arp_lookup_host" "cleanup" +arp_lookup_host_head() { + atf_set descr 'Test looking up a specific host' + atf_set require.user root +} + +arp_lookup_host_body() { + + vnet_init + + jname="v4t-arp_lookup_host" + + epair0=$(vnet_mkepair) + + vnet_mkjail ${jname}a ${epair0}a + vnet_mkjail ${jname}b ${epair0}b + + ipa=198.51.100.1 + ipb=198.51.100.2 + + atf_check -o ignore \ + ifconfig -j ${jname}a ${epair0}a inet ${ipa}/24 + atf_check -o ignore \ + ifconfig -j ${jname}b ${epair0}b inet ${ipb}/24 + + # get jail b's MAC address + eth="$(ifconfig -j ${jname}b ${epair0}b | + sed -nE "s/^\tether ([0-9a-f:]*)$/\1/p")" + + # no entry yet + atf_check -s exit:1 -o match:"\(${ipb}\) -- no entry" \ + jexec ${jname}a arp -n ${ipb} + + # now ping jail b from jail a + atf_check -o ignore \ + jexec ${jname}a ping -c1 ${ipb} + + # should be populated + atf_check -o match:"\(${ipb}\) at $eth on ${epair0}a" \ + jexec ${jname}a arp -n ${ipb} + +} + +arp_lookup_host_cleanup() { + vnet_cleanup +} + + atf_init_test_cases() { atf_add_test_case "arp_add_success" atf_add_test_case "arp_del_success" atf_add_test_case "pending_delete_if" + atf_add_test_case "arp_lookup_host" } # end