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 A54A4A0507; Wed, 6 Apr 2022 16:19:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71ECC40689; Wed, 6 Apr 2022 16:19:06 +0200 (CEST) Received: from mail-pf1-f227.google.com (mail-pf1-f227.google.com [209.85.210.227]) by mails.dpdk.org (Postfix) with ESMTP id 582654014F for ; Wed, 6 Apr 2022 16:19:05 +0200 (CEST) Received: by mail-pf1-f227.google.com with SMTP id j17so1122913pfi.9 for ; Wed, 06 Apr 2022 07:19:05 -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=ipBqL2y2RYOZF5mDhItDzvNsdsvraB/vo83ge95jDuAZ8lW+72wZvFO/ffei1AVB1/ sCxL08g4Q9LYZXu6c63v2SfrYznphxPIEFFf7xaTOx/wpxOpQ5vAXCjkA3GpUHg+FauL XTNwcQK1naFwebOcgu3GJ1uvHSrdz6O51WFu0= 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=GgGRfKSRZbdkkDMuSkyFoZPZRkveqwGdINTZYv5T2dPslMk/xtYndMRwnFQnnKM3fg Hk4iUKLEXUkF7sBR8X3yI3YsSj1f3kVrPbiqBDKw1WQqutT+D9lMZdqD/6kkTELkG8K+ IgvckfT5LTbENla6GYSAnF6tu+pnpWLtAJv16TVSG7qNfJ4BLDPNnQyap+TrrJFbVJpQ 4FhrcuuO6DKNVU5mu/EiLUbxBYBXcGUkBXzeZOHq2NHMO51KL0rj8RdZTr+hZVnEzM5Y PAhmInJoxHvLvcwAr/2/J/wL+yRzrIMoefKpE83r7lnTrm40uvC+cjq704Pmd3K0b+Ns A5yg== X-Gm-Message-State: AOAM533628LhoNJ9x2yoit7k+pxVgXP2YHukClNi5Uud8pqN3V2Kl+M1 JSn2QJgKW2FyDEUEI08LBYVc9ZHqiGXsXfQr79xPJHNPOVycvm4l+l5NVFtlzUZJdbOUKmX1K7i bKTGV/0a4fFpPuf6t3xXd21O+6h5r6RNwbxVAUNtEVvT94b7LxxT9u7SwZNKQizukPV7Y3FtoZ4 p0Px7Y+NzybSm8eA== X-Google-Smtp-Source: ABdhPJytisTuz5ToLup8FtEqiukMRy94aanMnvN61bsoeRxIcmwNm6SM9KA+YVyMuj0OsbrbuZHb5V8M68Vv X-Received: by 2002:a63:a555:0:b0:382:3ec:ee4f with SMTP id r21-20020a63a555000000b0038203ecee4fmr7175580pgu.79.1649254744477; Wed, 06 Apr 2022 07:19:04 -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 15-20020a17090a0ccf00b001c99eef07a4sm524626pjt.3.2022.04.06.07.19.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Apr 2022 07:19:04 -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 7BB4F605183A; Wed, 6 Apr 2022 10:19:03 -0400 (EDT) From: ohilyard@iol.unh.edu To: dts@dpdk.org Cc: lijuan.tu@intel.com, juraj.linkes@pantheon.tech, Owen Hilyard Subject: [PATCH v1] framework: Move test-specific files to test directory Date: Wed, 6 Apr 2022 10:19:02 -0400 Message-Id: <20220406141902.20334-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