From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 617C945E5F; Mon, 9 Dec 2024 20:58:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BCE4402E8; Mon, 9 Dec 2024 20:58:06 +0100 (CET) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by mails.dpdk.org (Postfix) with ESMTP id 53367402E5 for ; Mon, 9 Dec 2024 20:58:05 +0100 (CET) Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6d8f65ef5abso19481196d6.3 for ; Mon, 09 Dec 2024 11:58:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1733774284; x=1734379084; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rJglXYv4AP5syHcJbLGWrO2XsidpTcoSKb2tLH0/hr0=; b=KnjW0j2iSewzf0kVqBWM5/TXTjxlRSWul+DTuNsakXiHzIGdKbvObhrnRhZl620R+2 7zOBEvTJUZ5gxIM9pNAxKgmp0Qp6BJIAeK0C2v8B+tdmSL5xp9za9CL4cy2ArxkewmM3 uN5dMPw5BYN5Ka4MzRWBoR0lN+wLgjCWjkuVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733774284; x=1734379084; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rJglXYv4AP5syHcJbLGWrO2XsidpTcoSKb2tLH0/hr0=; b=pLYvX6LE4rcyiyjGebdgyNeU+PPC1Z+NGTR7JYc63bSphFGanvUPVEi5E3Z1NuhKHr dpA/yQ5rDcAr271PfeXh3C+/JSCFs4pZeYK7s7+18pOLhAs2anI95LqxP/KHesRhLa6l 466NrpnSVy286fPNBkNQA6fGsjKdCAL5XcRGdeB7IMf07U4a9ZyrWKPwBEZ0JiO6DWMq 4aThL0eKuzQ1/D97L7aB2BHof0N2e9+rObd/Ot/0HmoUFl1vdGoDWGj5Au+yyiIFPV4W kRMPVNWX4fqL7XOuU6EwXVeUL/dBTP9XJEzLtNkh3VtXjsvrEp0tIX6RubrfQnoACAZK Zxvg== X-Gm-Message-State: AOJu0Yy3xomI53MtDXgbmAOUayCsjbVaFfB5lCwvApmT95jSntaGahLi 8XLTXWsA1oxODw1zg6y7fdsq4iw2WM6wJePu7FT1c5hxopSoOqqmsCIfhmoyT3o= X-Gm-Gg: ASbGncsqMsoxlcK+PwtJqg3lSs0hD62a6m8hCX98Pi7NkOebMl78Hrgzxryem2waKMJ yo/4da6DWMrCgSuY1QyO5qXt9wxBqRvnbOWqapnLHag5OCFjare9Aq3msYynPX1HSOL2G+VWig1 cdl5llfBWUGdQJuS/B0rk1mkSP5YsVyDdpnEbYX8UjcqfuA9hkUJFyKjrTXoI4TJQe9oycgN4ft Y9FjgtJZpS4MVN5OZlRhYvYYUj3+of0q49iRn/FahA08j91GcklQG0Ttqs8jfqkYw2/1J5qvpLI uO2m+gUU X-Google-Smtp-Source: AGHT+IF6qm0VVDQHc7zXykTg267KclCZpqw2BA3NANxg9nzEsxRVbHzF+Jcwxmv8Tdp/eHKQTQ6m7Q== X-Received: by 2002:ad4:5e86:0:b0:6d8:d84d:d938 with SMTP id 6a1803df08f44-6d91e3aa324mr35271866d6.28.1733774284694; Mon, 09 Dec 2024 11:58:04 -0800 (PST) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1271:f9bd:24da:464d:6294]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d8da66eecbsm52037576d6.15.2024.12.09.11.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:58:04 -0800 (PST) From: Dean Marx To: probb@iol.unh.edu, npratte@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com Cc: dev@dpdk.org, Dean Marx Subject: [RFC PATCH 1/1] dts: add SUT cleanup to framework Date: Mon, 9 Dec 2024 15:59:02 -0500 Message-ID: <20241209205902.18321-2-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241209205902.18321-1-dmarx@iol.unh.edu> References: <20241209205902.18321-1-dmarx@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add method cleanup_sut to framework that removes a DPDK source from a SUT node at the conclusion of a testrun. This will only run when the DPDK source is being copied from the DTS engine node during the testrun (when remote=false in the conf.yaml). Signed-off-by: Dean Marx --- dts/framework/runner.py | 2 +- dts/framework/testbed_model/sut_node.py | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/dts/framework/runner.py b/dts/framework/runner.py index f91c462ce5..7f58cd01ce 100644 --- a/dts/framework/runner.py +++ b/dts/framework/runner.py @@ -340,7 +340,7 @@ def _run_test_run( finally: try: self._logger.set_stage(DtsStage.test_run_teardown) - sut_node.tear_down_test_run() + sut_node.tear_down_test_run(test_run_config.dpdk_config) tg_node.tear_down_test_run() test_run_result.update_teardown(Result.PASS) except Exception as e: diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 14d77c50a6..d39c1bd632 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -175,6 +175,21 @@ def path_to_devbind_script(self) -> PurePath | str: ) return self._path_to_devbind_script + def cleanup_sut( + self, dpdk_build_config: DPDKBuildConfiguration, remote_tree: str | PurePath | None + ) -> None: + """Removes the DPDK tree and/or build directory/tarball depending on the configuration.""" + match dpdk_build_config.dpdk_location: + case LocalDPDKTreeLocation(dpdk_tree=dpdk_tree): + tree_path = self.main_session.join_remote_path(self._remote_tmp_dir, dpdk_tree.name) + self.main_session.remove_remote_dir(tree_path) + case LocalDPDKTarballLocation(tarball=tarball): + self.main_session.remove_remote_dir(str(remote_tree)) + tarball_path = self.main_session.join_remote_path( + self._remote_tmp_dir, tarball.name + ) + self.main_session.remove_remote_file(tarball_path) + def get_dpdk_build_info(self) -> DPDKBuildInfo: """Get additional DPDK build information. @@ -203,11 +218,11 @@ def set_up_test_run( self.virtual_devices.append(VirtualDevice(vdev)) self._set_up_dpdk(dpdk_build_config) - def tear_down_test_run(self) -> None: + def tear_down_test_run(self, dpdk_build_config: DPDKBuildConfiguration) -> None: """Extend the test run teardown with virtual device teardown and DPDK teardown.""" super().tear_down_test_run() self.virtual_devices = [] - self._tear_down_dpdk() + self._tear_down_dpdk(dpdk_build_config) def _set_up_dpdk( self, @@ -243,14 +258,16 @@ def _set_up_dpdk( self.bind_ports_to_driver() - def _tear_down_dpdk(self) -> None: + def _tear_down_dpdk(self, dpdk_build_config: DPDKBuildConfiguration) -> None: """Reset DPDK variables and bind port driver to the OS driver.""" self._env_vars = {} + remote_tree = self.__remote_dpdk_tree_path self.__remote_dpdk_tree_path = None self._remote_dpdk_build_dir = None self._dpdk_version = None self.compiler_version = None self.bind_ports_to_driver(for_dpdk=False) + self.cleanup_sut(dpdk_build_config, remote_tree) def _set_remote_dpdk_tree_path(self, dpdk_tree: PurePath): """Set the path to the remote DPDK source tree based on the provided DPDK location. -- 2.44.0