From nobody Mon Dec 13 14:54:26 2021 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 42B3218E0A2A; Mon, 13 Dec 2021 14:54: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 4JCPfp5frKz3hM6; Mon, 13 Dec 2021 14:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A28ED1672E; Mon, 13 Dec 2021 14:54: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 1BDEsQhu022234; Mon, 13 Dec 2021 14:54:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BDEsQeB022233; Mon, 13 Dec 2021 14:54:26 GMT (envelope-from git) Date: Mon, 13 Dec 2021 14:54:26 GMT Message-Id: <202112131454.1BDEsQeB022233@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: 4826406b30f9 - main - pf tests: log additional information when a test ends 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: 4826406b30f9756102a1443273aeb9d7dd5d80c7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639407266; 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=guL3Q8sH5Q/O4xxO9SRY91Si+Hrq8lhZxCYoNIGeb+c=; b=Cw8JIanb2e/Sq1b91dZnrkwiIPbU+zWW4g6+0cW1pPg/KdVACf1aRkU1iK6LMOP76XtS6A W+aVcu+ZXNtPbIXG1lfTM32wJyocGPINY/NPQXYfhjDUVg2YtZNJ0GajQAG7qwhVUh4uIS 0tO+2oXdC7CQKXpKDmM8k9MdVFvjHuIlE0kHaQbD0qKpIixbm5pFSv6Qh74AcdK+MNs1JH D5VUMqt0EbVxHWMLIPW0Ofl6ozYI5MfDb5cqb1ydE9VVB7Woj4zvFGqkMPmZSecrixfg6v HCHFQsJyb4k8QEqvmbad3DzfB5HU7LKGIb0AQ8e1beAuJ/zRnSDE4NrnzNbWLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639407266; a=rsa-sha256; cv=none; b=YoKivHVe6jK2ALlLmJkkIlIfgYcnuHw70TVPlYhaDgwTu0+tcJ/JJHPIFlX8sS12p3hASc KuLvApR0odVwQDnBCQ4idOtyBNE5Dm31ADo1NbsrU/vtTyjeyVp3kvm8loXkrzgiYfhkIf 16RZ4pwWGjOl8ye4EIeQrTvhisas5Do9MOm29Kgnq2IpJ9MudGV02J1GJJNzUPVVprBWVP kyQvTbW67+qy7/nqnfQqrvmEXmaKeFMPcxEb7EYqnw8VP/QhQ1y9upHSo5W5Z1dN2yjvG5 bBpEARdJdyzmL4czsMf85l7QYfYXel8lu1sYybNx96FwUgQFgnGGRw1povZg3w== 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=4826406b30f9756102a1443273aeb9d7dd5d80c7 commit 4826406b30f9756102a1443273aeb9d7dd5d80c7 Author: Kristof Provost AuthorDate: 2021-12-13 12:01:27 +0000 Commit: Kristof Provost CommitDate: 2021-12-13 14:54:03 +0000 pf tests: log additional information when a test ends Log information from the running jails (routing, interfaces and pf) as well as interfaces on the host. This information is expected to be useful in debugging test failures. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/utils.subr | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index c9a404c8012e..9afd6280707e 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -28,8 +28,39 @@ . $(atf_get_srcdir)/../../common/vnet.subr +pft_onerror() +{ + status=$? + + echo "Debug log." + echo "==========" + echo "Test exit status: $?" + echo + + if [ -f created_jails.lst ]; then + for jailname in `cat created_jails.lst` + do + echo "Jail ${jailname}" + echo "----------------" + jexec ${jailname} ifconfig + jexec ${jailname} netstat -rn + jexec ${jailname} pfctl -sa -v + done + fi + + echo "Created interfaces:" + echo "-------------------" + cat created_interfaces.lst + + echo "Host interfaces:" + echo "----------------" + ifconfig +} + pft_init() { + trap pft_onerror EXIT + vnet_init if [ ! -c /dev/pf ]; then