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 7231DA0503; Mon, 11 Apr 2022 19:55:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C0CC427F3; Mon, 11 Apr 2022 19:55:54 +0200 (CEST) Received: from mail-pf1-f225.google.com (mail-pf1-f225.google.com [209.85.210.225]) by mails.dpdk.org (Postfix) with ESMTP id 33CF8427EF for ; Mon, 11 Apr 2022 19:55:53 +0200 (CEST) Received: by mail-pf1-f225.google.com with SMTP id f3so15265080pfe.2 for ; Mon, 11 Apr 2022 10:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Np05GdD6JVglPvlVFj18vK8JVCPIh9P47lM4lhRoL14=; b=WhlouG90fIabgLXgb6/XVJZ1QZ52BVD9YX6FlAeoyu0hqnhK27BcNTsv/6AY14DIm8 4pbpssIydb4j6Gx40MnBtK0BQDwQ7Arr8bGjSYBe8KKKhQZnXswt9iYN+DC/uveVbury fd/2jPnHpvn5F5WkIzvARgD9w4tOKSqqK82lQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Np05GdD6JVglPvlVFj18vK8JVCPIh9P47lM4lhRoL14=; b=eM2Et+G5hzeMYOtr5wso/jtvw0wKqqLrbkL4QtfYCq0zNzoC50qFUmLkmRhyQTyCOI /R9FSRDmTj7woqXCQmhf4goneagiz0rCXMtjch6/WahOgVhOMmBbBGxsWvNsaEcyJygp K7GTA518cBaiP8YWWbr1YXgpREohFrkKMYv3DAktZEbYlt7uQC2fbKI8SRHbSoOXFUR/ +MyLq/r3oy1AzItk8QyeaSe4CnnHbIfFebjxecKEPFsm2TpghMHjlqTaBdy42TxLVlbK jspa7tXc7BnZz7Lt1ulAD5mnCNswHCD5qf+2fB2w+15q4zaoTs/oO1Fw/rpuMUCna/6n GSMg== X-Gm-Message-State: AOAM533RKLGM7z7nzWUAqIhtNPDuX4J8VLyBMCvr1/UA9ksr6P5rC+j6 MHP7deWM4O68ab/KF0Fego8CEfc1FVY0AhKe/DHrWj+d9wS7SNHPJrFV4v+peHxS9FKAEBfX+Kv ZZF3HrqAxSPGQvrF0vLyMtzs3S52bgpZDDq/vNKmVO2FGz+HyqYDv/3lmbn2zNk+z+JcCNUUQ/2 7WNJlFDn+RDJimTw== X-Google-Smtp-Source: ABdhPJzuVw2O96cqMrTHUxrW/Yt6ZtWcn4VSaYXbQx4fhKNXdBYf22Pgn4otP7pt6FG//2PIRcrHj+PXmcbk X-Received: by 2002:a05:6a00:1341:b0:4fa:a3af:6ba3 with SMTP id k1-20020a056a00134100b004faa3af6ba3mr33712742pfu.51.1649699752293; Mon, 11 Apr 2022 10:55:52 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id c13-20020a17090a1d0d00b001c9b8393325sm17399pjd.2.2022.04.11.10.55.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2022 10:55:52 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::105d]) by postal.iol.unh.edu (Postfix) with ESMTP id 42993605251D; Mon, 11 Apr 2022 13:55:51 -0400 (EDT) From: ohilyard@iol.unh.edu To: dts@dpdk.org Cc: lijuan.tu@intel.com, juraj.linkes@pantheon.tech, Owen Hilyard Subject: [PATCH v2 1/2] framework: Move test-specific files to test directory Date: Mon, 11 Apr 2022 13:55:48 -0400 Message-Id: <20220411175549.14680-1-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org From: Owen Hilyard The DTS Improvement Working Group decided to move files specific to a single test or a small group of tests into tests/util. This is done in order to aid in the organization of DTS. Signed-off-by: Owen Hilyard --- framework/flow/__init__.py | 0 framework/virt_resource.py | 2 +- tests/data/__init__.py | 2 ++ tests/util/__init__.py | 2 ++ tests/util/flow/__init__.py | 2 ++ {framework => tests/util}/flow/enums.py | 0 {framework => tests/util}/flow/exceptions.py | 0 {framework => tests/util}/flow/flow.py | 0 {framework => tests/util}/flow/flow_action_items.py | 0 {framework => tests/util}/flow/flow_items.py | 8 +++----- {framework => tests/util}/flow/flow_pattern_items.py | 0 {framework => tests/util}/flow/flow_rule.py | 2 +- {framework => tests/util}/flow/generator.py | 0 tests/util/virt/__init__.py | 2 ++ {framework => tests/util/virt}/virt_base.py | 8 ++++---- {framework => tests/util/virt}/virt_common.py | 8 ++++---- {framework => tests/util/virt}/virt_dut.py | 10 +++++----- {framework => tests/util/virt}/virt_scene.py | 12 ++++++------ 18 files changed, 32 insertions(+), 26 deletions(-) delete mode 100644 framework/flow/__init__.py create mode 100644 tests/data/__init__.py create mode 100644 tests/util/__init__.py create mode 100644 tests/util/flow/__init__.py rename {framework => tests/util}/flow/enums.py (100%) rename {framework => tests/util}/flow/exceptions.py (100%) rename {framework => tests/util}/flow/flow.py (100%) rename {framework => tests/util}/flow/flow_action_items.py (100%) rename {framework => tests/util}/flow/flow_items.py (94%) rename {framework => tests/util}/flow/flow_pattern_items.py (100%) rename {framework => tests/util}/flow/flow_rule.py (97%) rename {framework => tests/util}/flow/generator.py (100%) create mode 100644 tests/util/virt/__init__.py rename {framework => tests/util/virt}/virt_base.py (99%) rename {framework => tests/util/virt}/virt_common.py (92%) rename {framework => tests/util/virt}/virt_dut.py (98%) rename {framework => tests/util/virt}/virt_scene.py (98%) diff --git a/framework/flow/__init__.py b/framework/flow/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/framework/virt_resource.py b/framework/virt_resource.py index 36b6fe9c..0e012511 100644 --- a/framework/virt_resource.py +++ b/framework/virt_resource.py @@ -30,7 +30,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from random import randint -from .utils import RED, get_obj_funcs, parallel_lock +from framework.utils import RED, get_obj_funcs, parallel_lock INIT_FREE_PORT = 6000 INIT_SERIAL_PORT = 7000 diff --git a/tests/data/__init__.py b/tests/data/__init__.py new file mode 100644 index 00000000..4ad62931 --- /dev/null +++ b/tests/data/__init__.py @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 University of New Hampshire diff --git a/tests/util/__init__.py b/tests/util/__init__.py new file mode 100644 index 00000000..93e83aee --- /dev/null +++ b/tests/util/__init__.py @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 University of New Hampshire \ No newline at end of file diff --git a/tests/util/flow/__init__.py b/tests/util/flow/__init__.py new file mode 100644 index 00000000..93e83aee --- /dev/null +++ b/tests/util/flow/__init__.py @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 University of New Hampshire \ No newline at end of file diff --git a/framework/flow/enums.py b/tests/util/flow/enums.py similarity index 100% rename from framework/flow/enums.py rename to tests/util/flow/enums.py diff --git a/framework/flow/exceptions.py b/tests/util/flow/exceptions.py similarity index 100% rename from framework/flow/exceptions.py rename to tests/util/flow/exceptions.py diff --git a/framework/flow/flow.py b/tests/util/flow/flow.py similarity index 100% rename from framework/flow/flow.py rename to tests/util/flow/flow.py diff --git a/framework/flow/flow_action_items.py b/tests/util/flow/flow_action_items.py similarity index 100% rename from framework/flow/flow_action_items.py rename to tests/util/flow/flow_action_items.py diff --git a/framework/flow/flow_items.py b/tests/util/flow/flow_items.py similarity index 94% rename from framework/flow/flow_items.py rename to tests/util/flow/flow_items.py index e43614c5..35d07008 100644 --- a/framework/flow/flow_items.py +++ b/tests/util/flow/flow_items.py @@ -33,9 +33,7 @@ from __future__ import annotations import copy -import itertools -from functools import reduce -from typing import Any, Dict, FrozenSet, Hashable, Iterable, Set, Tuple, Union +from typing import Dict, FrozenSet, Iterable, Tuple, Union from .enums import FlowActionType, FlowItemType from .exceptions import InvalidFlowItemException @@ -95,8 +93,8 @@ class FlowItem(object): raise InvalidFlowItemException(self, other) elif other.type in self.valid_next_items: # These imports are in here so there is no circular import - from framework.flow.flow_action_items import ActionFlowItem - from framework.flow.flow_pattern_items import PatternFlowItem + from tests.util.flow.flow_action_items import ActionFlowItem + from tests.util.flow.flow_pattern_items import PatternFlowItem from .flow import Flow diff --git a/framework/flow/flow_pattern_items.py b/tests/util/flow/flow_pattern_items.py similarity index 100% rename from framework/flow/flow_pattern_items.py rename to tests/util/flow/flow_pattern_items.py diff --git a/framework/flow/flow_rule.py b/tests/util/flow/flow_rule.py similarity index 97% rename from framework/flow/flow_rule.py rename to tests/util/flow/flow_rule.py index 6687bffe..4d4cf487 100644 --- a/framework/flow/flow_rule.py +++ b/tests/util/flow/flow_rule.py @@ -32,7 +32,7 @@ from typing import Union -import framework.flow.flow_action_items as flow_action_items +import tests.util.flow.flow_action_items as flow_action_items from .enums import * from .flow import Flow diff --git a/framework/flow/generator.py b/tests/util/flow/generator.py similarity index 100% rename from framework/flow/generator.py rename to tests/util/flow/generator.py diff --git a/tests/util/virt/__init__.py b/tests/util/virt/__init__.py new file mode 100644 index 00000000..93e83aee --- /dev/null +++ b/tests/util/virt/__init__.py @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 University of New Hampshire \ No newline at end of file diff --git a/framework/virt_base.py b/tests/util/virt/virt_base.py similarity index 99% rename from framework/virt_base.py rename to tests/util/virt/virt_base.py index d4af8b98..4cc64565 100644 --- a/framework/virt_base.py +++ b/tests/util/virt/virt_base.py @@ -37,10 +37,10 @@ from random import randint import framework.exception as exception import framework.utils as utils -from .config import VIRTCONF, VirtConf -from .dut import Dut -from .logger import getLogger -from .settings import CONFIG_ROOT_PATH +from framework.config import VIRTCONF, VirtConf +from framework.dut import Dut +from framework.logger import getLogger +from framework.settings import CONFIG_ROOT_PATH from .virt_dut import VirtDut ST_NOTSTART = "NOTSTART" diff --git a/framework/virt_common.py b/tests/util/virt/virt_common.py similarity index 92% rename from framework/virt_common.py rename to tests/util/virt/virt_common.py index eb5ee066..36ea540e 100644 --- a/framework/virt_common.py +++ b/tests/util/virt/virt_common.py @@ -30,10 +30,10 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os -from .config import VirtConf -from .qemu_kvm import QEMUKvm -from .qemu_libvirt import LibvirtKvm -from .settings import CONFIG_ROOT_PATH +from framework.config import VirtConf +from framework.qemu_kvm import QEMUKvm +from framework.qemu_libvirt import LibvirtKvm +from framework.settings import CONFIG_ROOT_PATH def VM(dut, vm_name, suite_name): diff --git a/framework/virt_dut.py b/tests/util/virt/virt_dut.py similarity index 98% rename from framework/virt_dut.py rename to tests/util/virt/virt_dut.py index 369abacf..8bbec12c 100644 --- a/framework/virt_dut.py +++ b/tests/util/virt/virt_dut.py @@ -36,11 +36,11 @@ import time import framework.settings as settings from nics.net_device import GetNicObj, RemoveNicObj -from .config import AppNameConf, PortConf -from .dut import Dut -from .project_dpdk import DPDKdut -from .settings import LOG_NAME_SEP, NICS, get_netdev, load_global_setting -from .utils import RED, parallel_lock +from framework.config import AppNameConf, PortConf +from framework.dut import Dut +from framework.project_dpdk import DPDKdut +from framework.settings import LOG_NAME_SEP, NICS, get_netdev, load_global_setting +from framework.utils import RED, parallel_lock class VirtDut(DPDKdut): diff --git a/framework/virt_scene.py b/tests/util/virt/virt_scene.py similarity index 98% rename from framework/virt_scene.py rename to tests/util/virt/virt_scene.py index 63760192..694f84b9 100644 --- a/framework/virt_scene.py +++ b/tests/util/virt/virt_scene.py @@ -32,12 +32,12 @@ import time import framework.utils as utils -from .config import VIRTCONF, VirtConf -from .exception import * -from .pmd_output import PmdOutput -from .qemu_kvm import QEMUKvm -from .settings import CONFIG_ROOT_PATH, get_netdev -from .utils import create_mask +from framework.config import VIRTCONF, VirtConf +from framework.exception import * +from framework.pmd_output import PmdOutput +from framework.qemu_kvm import QEMUKvm +from framework.settings import CONFIG_ROOT_PATH, get_netdev +from framework.utils import create_mask # scenario module for handling scenario # 1. load configurations -- 2.30.2