test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH v1] framework: Move test-specific files to test directory
@ 2022-04-06 14:19 ohilyard
  2022-04-11  2:40 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: ohilyard @ 2022-04-06 14:19 UTC (permalink / raw)
  To: dts; +Cc: lijuan.tu, juraj.linkes, Owen Hilyard

From: Owen Hilyard <ohilyard@iol.unh.edu>

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 <ohilyard@iol.unh.edu>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-11  2:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 14:19 [PATCH v1] framework: Move test-specific files to test directory ohilyard
2022-04-11  2:40 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).