From nobody Fri Oct 13 19:31:38 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 4S6c7t5r4Dz4wgMq; Fri, 13 Oct 2023 19:31:38 +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 4S6c7t4wpTz4Xl5; Fri, 13 Oct 2023 19:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697225498; 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=Aki6+2wh727z1h5zSlppSZ7RYJ4oseYVpf3yW0Q3puw=; b=TLtcxPaFqLh5WER27rnRQKr0uqGvsA0/GvGgwbZlaPHV2UqL3BOSyJ+cxoVSCZuOmWCr7N aI8fZLwZumVgEOI/bGrMD8yGEP5OxQCZxNU+nnC9gbxNEjcxpbAX5KAp80z9xWCs7PY8LO /Wggeq64nfMtd+sYu8zV5ubHKicFFQitQpxOE02TSX4rgGBrx4RajJyNlX+x90bRDpNBCc +1qExaf2w8JZTZjhkEWTgNQK7/sASPu40l4otFuW+iiO0SSfsf9H2w9/ExSaY/VABB0Id/ /RoDp2+Hts86dWjtbm60fnRtZa3M77gGtsVAmmon7ch4O21UdXqwzRGIH53dlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697225498; a=rsa-sha256; cv=none; b=YNVZQqrCCuMF5so7sq38H6/muUSdjxZImEKk3UXdCqA1/swt0x0kztKQG7GmleHpGx7L4O m/9knNRG2J/I5/pE1glHDBS38ovQojt9FEiETdVRtlp1H26clyUQCqoNhgec4AxxQ7rXw3 Yrt9frKE6EoTDiroExDlYvqX5tPb8pUQ5TmcWpVYbuO4y1Wc63ZB73txVcH0GoYiAR5Ed/ YErNAzvESTF8UWTZ+qCsyBSAq+JkESIipSKONTJEq/P0lzJ/KDiuQ2k7lzAvmx5RO0DDBt rWPxru1+QCdDsOYAk9C1muCQRtaCpbnKsNPCDajbM2y8+fJaRH/jdOe1fozvjQ== 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=1697225498; 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=Aki6+2wh727z1h5zSlppSZ7RYJ4oseYVpf3yW0Q3puw=; b=EAl5wor3AY7qlHKLDo5mucq3EkKH7m4+3KENUlk5sebA96HVp9UW4oMmHWjFLWUtk2KIN6 4vSJcvt7pdrH/n+qtWNZEFw8h7vloAVM0vuXd5Kp2gdkaBo3qagkC8nWwMT9Lcu0ti8S6Y TBDMB3QqyyrBVAG+2Pgpx5CZ4/wMvk8BgvGdVvQENjdr6r2Egt8dvEkiJcbcQ7xks/obRc zS3KNMJJo3miLHvmDjPqElFe5bf9dzkqxuYtgqCJktcM1NkCtvD/3TLefhLJBjzuZrVTKz rx/6lcFRiLSr92JpKGP6mvXlerRnXpMxlynsgCrlnmqLWleLjzhZJgFXeJHDmA== 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 4S6c7t3wwWz11Jp; Fri, 13 Oct 2023 19:31:38 +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 39DJVcLd097909; Fri, 13 Oct 2023 19:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DJVch3097906; Fri, 13 Oct 2023 19:31:38 GMT (envelope-from git) Date: Fri, 13 Oct 2023 19:31:38 GMT Message-Id: <202310131931.39DJVch3097906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a1eb150ce215 - main - atf_python: vnet: Use absolute paths within helpers 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1eb150ce215f51abbbb34aed0533bced93e5502 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a1eb150ce215f51abbbb34aed0533bced93e5502 commit a1eb150ce215f51abbbb34aed0533bced93e5502 Author: Jose Luis Duran AuthorDate: 2023-10-12 15:14:44 +0000 Commit: Mark Johnston CommitDate: 2023-10-13 19:31:30 +0000 atf_python: vnet: Use absolute paths within helpers Usually tests are run in sterile environments; however, there is a slight chance that the PATH overrides the utilities used for testing. Pedantically use absolute paths, even inside VNETs, to avoid ambiguity. Chiefly, jexec -> /usr/sbin/jexec, and ifconfig -> /sbin/ifconfig. Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/865 --- tests/atf_python/sys/net/vnet.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index bfe7984b440b..7c855b19f2c0 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -82,13 +82,9 @@ class VnetInterface(object): def set_jailed(self, jailed: bool): self.jailed = jailed - def run_cmd( - self, - cmd, - verbose=False, - ): + def run_cmd(self, cmd, verbose=False): if self.vnet_name and not self.jailed: - cmd = "jexec {} {}".format(self.vnet_name, cmd) + cmd = "/usr/sbin/jexec {} {}".format(self.vnet_name, cmd) return run_cmd(cmd, verbose) @classmethod @@ -189,7 +185,7 @@ class IfaceFactory(object): def cleanup_vnet_interfaces(self, vnet_name: str) -> List[str]: """Destroys""" ifaces_lst = ToolsHelper.get_output( - "/usr/sbin/jexec {} ifconfig -l".format(vnet_name) + "/usr/sbin/jexec {} /sbin/ifconfig -l".format(vnet_name) ) for iface_name in ifaces_lst.split(): if not self.is_autodeleted(iface_name): @@ -197,7 +193,7 @@ class IfaceFactory(object): print("Skipping interface {}:{}".format(vnet_name, iface_name)) continue run_cmd( - "/usr/sbin/jexec {} ifconfig {} destroy".format(vnet_name, iface_name) + "/usr/sbin/jexec {} /sbin/ifconfig {} destroy".format(vnet_name, iface_name) ) def cleanup(self): @@ -231,7 +227,7 @@ class VnetInstance(object): def run_vnet_cmd(self, cmd): if not self.attached: - cmd = "jexec {} {}".format(self.name, cmd) + cmd = "/usr/sbin/jexec {} {}".format(self.name, cmd) return run_cmd(cmd) def disable_dad(self): @@ -269,7 +265,7 @@ class VnetFactory(object): @staticmethod def _wait_interfaces(vnet_name: str, ifaces: List[str]) -> List[str]: - cmd = "jexec {} /sbin/ifconfig -l".format(vnet_name) + cmd = "/usr/sbin/jexec {} /sbin/ifconfig -l".format(vnet_name) not_matched: List[str] = [] for i in range(50): vnet_ifaces = run_cmd(cmd).strip().split(" ")