From nobody Tue Sep 30 12:53:35 2025 X-Original-To: dev-commits-src-main@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 4cbdKC5DTXz693jH; Tue, 30 Sep 2025 12:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbdKC2rlWz41bC; Tue, 30 Sep 2025 12:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759236815; 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=TLLSgMYd5kIaJA/hubv3NqxWoOdZ2IR6bRa111snVYw=; b=q2rJuNcRR9AskHnjzP7Swf18QxQ3ec0wHHKYE2MnRegIjjXyH+3nkW/W1M5tb+SWE8p7HD SKdrj2kRWrNJIe9pifdtiJpaKZ4oPZjMCr++QF3h8RwHq6vh69GeyRuz8+dpTyoq3PCKTu /pA73iUvAQ7gOED6TsTnTGz0ue4QU27l+th4KMP3b9QbvPGtuX/xCtlTGcyZmG0dJ29Atd HkMyZd0BY/RHX9RpBdtzYNVWL7jik8lVoYnaU9R2ea6TTBZbTrRq5m8R/eQJVVknFu3Mda ypUz2z47Ng0HM879ObWcFKatkFAyT7QY4aKd2T20VgNuXDIjOqXF+P7wA33jcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759236815; 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=TLLSgMYd5kIaJA/hubv3NqxWoOdZ2IR6bRa111snVYw=; b=Z8y+wVMqwK3Sshvn1P4PEKaPaQc/Fg0GlkWVr7kCQDgtPaY9uQm8FMq1RbbrEHoQoCbgZB zLAk3HKez/p0yQyOZuWSWMcUqulPszL3T3tWTiZz5z83DBi7bF6Rcnt4cEs8RL+jjYeXTv xcI4CZh4CJBxvzWIdKstXcKoMJNhh7YvYqmWpSCwDfDFkzVhsBaXODTFh81sc7pRambViy NqQTEoC2wKarjjnM8jpWN4ZRf8y4Iawc8armGpBJjlxZSu+3ystTuqIHnp144EtN7trPjh tYOnDzZImbB7LHhZfJKT/96h0AFW7YT6U/noutVt3O6tSenhByFlNGdMKXPaOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759236815; a=rsa-sha256; cv=none; b=O5rQGxUNaaSR2EG89spgwW2l70HY3/MIcnyTvdCJYrKjmNFpOv8s0cWX08YVl1OoJQZzQB G0p/whxgio983BfAGJzhofHJZ7sajKRw+1decyp1n/8bscod9DKAQeYH/8I0YV10jcAvBE WfVsvoIONRdholtcYaHrbqjvr1FRKgbAjRrYGlEjgJmkkxDw1zEwaK2MVkxekBG7JpFTP7 6UsQLWTAYMJLS2MWaHlJtY1yuSkw/Veds1SwJq1jmKJFXnCG27MoUnPX6iWtj2anz0iqtu JLXFvXoal5udUGqkbUNOcJUlnUGtSTj683ac69NnaUxoeafHcVR+5duY1cXP3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cbdKC2CcmzdD8; Tue, 30 Sep 2025 12:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UCrZEc061726; Tue, 30 Sep 2025 12:53:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UCrZSw061723; Tue, 30 Sep 2025 12:53:35 GMT (envelope-from git) Date: Tue, 30 Sep 2025 12:53:35 GMT Message-Id: <202509301253.58UCrZSw061723@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: 2213e158886f - main - atf_python: allow test scripts to pass jail options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 2213e158886f72f45f288c94069a9a40c4f334ed Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2213e158886f72f45f288c94069a9a40c4f334ed commit 2213e158886f72f45f288c94069a9a40c4f334ed Author: Kristof Provost AuthorDate: 2025-09-27 14:38:19 +0000 Commit: Kristof Provost CommitDate: 2025-09-30 12:53:17 +0000 atf_python: allow test scripts to pass jail options Test scripts based on atf_python can now pass jail command options via the 'opts' key in the 'vnetX' key of TOPOLOGY. Reviewed by: melifaro MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52761 --- tests/atf_python/sys/net/vnet.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index c96eb5d671fc..f75a3eaa693e 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -283,14 +283,15 @@ class VnetFactory(object): time.sleep(0.1) return not_matched - def create_vnet(self, vnet_alias: str, ifaces: List[VnetInterface]): + def create_vnet(self, vnet_alias: str, ifaces: List[VnetInterface], opts: List[str]): vnet_name = "pytest:{}".format(convert_test_name(self.topology_id)) if self._vnets: # add number to distinguish jails vnet_name = "{}_{}".format(vnet_name, len(self._vnets) + 1) iface_cmds = " ".join(["vnet.interface={}".format(i.name) for i in ifaces]) - cmd = "/usr/sbin/jail -i -c name={} persist vnet {}".format( - vnet_name, iface_cmds + opt_cmds = " ".join(["{}".format(i) for i in opts]) + cmd = "/usr/sbin/jail -i -c name={} persist vnet {} {}".format( + vnet_name, iface_cmds, opt_cmds ) jid = 0 try: @@ -421,7 +422,10 @@ class VnetTestTemplate(BaseTest): idx = len(iface_map[iface_alias].vnet_aliases) iface_map[iface_alias].vnet_aliases.append(obj_name) vnet_ifaces.append(iface_map[iface_alias].ifaces[idx]) - vnet = vnet_factory.create_vnet(obj_name, vnet_ifaces) + opts = [] + if "opts" in obj_data: + opts = obj_data["opts"] + vnet = vnet_factory.create_vnet(obj_name, vnet_ifaces, opts) vnet_map[obj_name] = vnet # Allow reference to VNETs as attributes setattr(self, obj_name, vnet)