From 216688e99cdb5b9ac57a01b703d48d03c78b8962 Mon Sep 17 00:00:00 2001 From: lguohan Date: Sun, 2 Aug 2020 23:33:06 -0700 Subject: [PATCH] [tests]: rename sonic-utilitie-tests to tests (#1022) --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- scripts/dropconfig | 2 +- scripts/dropstat | 2 +- scripts/gearboxutil | 2 +- scripts/intfstat | 2 +- scripts/intfutil | 2 +- scripts/psushow | 2 +- scripts/sfpshow | 2 +- setup.py | 4 ++-- {sonic-utilities-tests => tests}/__init__.py | 0 .../acl_input/acl1.json | 0 .../acl_input/acl2.json | 0 .../acl_input/empty_acl.json | 0 .../acl_loader_test.py | 0 {sonic-utilities-tests => tests}/aclshow_test.py | 0 .../config_mgmt_test.py | 0 .../drops_group_test.py | 0 .../filter_fdb_entries_test.py | 0 .../filter_fdb_input/__init__.py | 0 .../filter_fdb_input/arp.json | 0 .../filter_fdb_input/config_db.json | 0 .../filter_fdb_input/expected_fdb.json | 0 .../filter_fdb_input/fdb.json | 0 .../filter_fdb_input/test_vectors.py | 16 ++++++++-------- {sonic-utilities-tests => tests}/gearbox_test.py | 2 +- .../intfstat_test.py | 0 .../intfutil_test.py | 0 .../mock_tables/__init__.py | 0 .../mock_tables/appl_db.json | 0 .../mock_tables/asic_db.json | 0 .../mock_tables/config_db.json | 0 .../mock_tables/counters_db.json | 0 .../mock_tables/dbconnector.py | 0 .../mock_tables/state_db.json | 0 .../port2alias_test.py | 0 {sonic-utilities-tests => tests}/psu_test.py | 0 {sonic-utilities-tests => tests}/pytest.ini | 0 {sonic-utilities-tests => tests}/sfp_test.py | 0 .../show_breakout_test.py | 0 39 files changed, 19 insertions(+), 19 deletions(-) rename {sonic-utilities-tests => tests}/__init__.py (100%) rename {sonic-utilities-tests => tests}/acl_input/acl1.json (100%) rename {sonic-utilities-tests => tests}/acl_input/acl2.json (100%) rename {sonic-utilities-tests => tests}/acl_input/empty_acl.json (100%) rename {sonic-utilities-tests => tests}/acl_loader_test.py (100%) rename {sonic-utilities-tests => tests}/aclshow_test.py (100%) rename {sonic-utilities-tests => tests}/config_mgmt_test.py (100%) rename {sonic-utilities-tests => tests}/drops_group_test.py (100%) rename {sonic-utilities-tests => tests}/filter_fdb_entries_test.py (100%) rename {sonic-utilities-tests => tests}/filter_fdb_input/__init__.py (100%) rename {sonic-utilities-tests => tests}/filter_fdb_input/arp.json (100%) rename {sonic-utilities-tests => tests}/filter_fdb_input/config_db.json (100%) rename {sonic-utilities-tests => tests}/filter_fdb_input/expected_fdb.json (100%) rename {sonic-utilities-tests => tests}/filter_fdb_input/fdb.json (100%) rename {sonic-utilities-tests => tests}/filter_fdb_input/test_vectors.py (92%) rename {sonic-utilities-tests => tests}/gearbox_test.py (96%) rename {sonic-utilities-tests => tests}/intfstat_test.py (100%) rename {sonic-utilities-tests => tests}/intfutil_test.py (100%) rename {sonic-utilities-tests => tests}/mock_tables/__init__.py (100%) rename {sonic-utilities-tests => tests}/mock_tables/appl_db.json (100%) rename {sonic-utilities-tests => tests}/mock_tables/asic_db.json (100%) rename {sonic-utilities-tests => tests}/mock_tables/config_db.json (100%) rename {sonic-utilities-tests => tests}/mock_tables/counters_db.json (100%) rename {sonic-utilities-tests => tests}/mock_tables/dbconnector.py (100%) rename {sonic-utilities-tests => tests}/mock_tables/state_db.json (100%) rename {sonic-utilities-tests => tests}/port2alias_test.py (100%) rename {sonic-utilities-tests => tests}/psu_test.py (100%) rename {sonic-utilities-tests => tests}/pytest.ini (100%) rename {sonic-utilities-tests => tests}/sfp_test.py (100%) rename {sonic-utilities-tests => tests}/show_breakout_test.py (100%) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 15ea2f31b5c0..8dbc11e0a037 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,7 +9,7 @@ If this is a bug fix, make sure your description includes "closes #xxxx", issue when the PR is merged. If you are adding/modifying/removing any command or utility script, please also -make sure to add/modify/remove any unit tests from the sonic-utilities-tests +make sure to add/modify/remove any unit tests from the tests directory as appropriate. If you are modifying or removing an existing 'show', 'config' or 'sonic-clear' diff --git a/scripts/dropconfig b/scripts/dropconfig index c9bbd3441872..292214a31f4c 100755 --- a/scripts/dropconfig +++ b/scripts/dropconfig @@ -21,7 +21,7 @@ from tabulate import tabulate try: if os.environ["UTILITIES_UNIT_TESTING"] == "1": modules_path = os.path.join(os.path.dirname(__file__), "..") - test_path = os.path.join(modules_path, "sonic-utilities-tests") + test_path = os.path.join(modules_path, "tests") sys.path.insert(0, modules_path) sys.path.insert(0, test_path) import mock_tables.dbconnector diff --git a/scripts/dropstat b/scripts/dropstat index 7baedd6fd5e1..808913805dae 100755 --- a/scripts/dropstat +++ b/scripts/dropstat @@ -26,7 +26,7 @@ from natsort import natsorted try: if os.environ["UTILITIES_UNIT_TESTING"] == "1": modules_path = os.path.join(os.path.dirname(__file__), "..") - test_path = os.path.join(modules_path, "sonic-utilities-tests") + test_path = os.path.join(modules_path, "tests") sys.path.insert(0, modules_path) sys.path.insert(0, test_path) import mock_tables.dbconnector diff --git a/scripts/gearboxutil b/scripts/gearboxutil index b6b2818deecb..c143ff744d75 100755 --- a/scripts/gearboxutil +++ b/scripts/gearboxutil @@ -11,7 +11,7 @@ import os try: if os.environ["UTILITIES_UNIT_TESTING"] == "1": modules_path = os.path.join(os.path.dirname(__file__), "..") - tests_path = os.path.join(modules_path, "sonic-utilities-tests") + tests_path = os.path.join(modules_path, "tests") sys.path.insert(0, modules_path) sys.path.insert(0, tests_path) import mock_tables.dbconnector diff --git a/scripts/intfstat b/scripts/intfstat index 86e628f8e53d..3591016b7e49 100755 --- a/scripts/intfstat +++ b/scripts/intfstat @@ -19,7 +19,7 @@ import time try: if os.environ["UTILITIES_UNIT_TESTING"] == "1": modules_path = os.path.join(os.path.dirname(__file__), "..") - test_path = os.path.join(modules_path, "sonic-utilities-tests") + test_path = os.path.join(modules_path, "tests") sys.path.insert(0, modules_path) sys.path.insert(0, test_path) import mock_tables.dbconnector diff --git a/scripts/intfutil b/scripts/intfutil index c37a68e96264..f35702aa0c0a 100755 --- a/scripts/intfutil +++ b/scripts/intfutil @@ -16,7 +16,7 @@ import os try: if os.environ["UTILITIES_UNIT_TESTING"] == "1": modules_path = os.path.join(os.path.dirname(__file__), "..") - tests_path = os.path.join(modules_path, "sonic-utilities-tests") + tests_path = os.path.join(modules_path, "tests") sys.path.insert(0, modules_path) sys.path.insert(0, tests_path) import mock_tables.dbconnector diff --git a/scripts/psushow b/scripts/psushow index 60d712334627..f61d8b405f56 100755 --- a/scripts/psushow +++ b/scripts/psushow @@ -10,7 +10,7 @@ from tabulate import tabulate try: if os.environ["UTILITIES_UNIT_TESTING"] == "1": modules_path = os.path.join(os.path.dirname(__file__), "..") - test_path = os.path.join(modules_path, "sonic-utilities-tests") + test_path = os.path.join(modules_path, "tests") sys.path.insert(0, modules_path) sys.path.insert(0, test_path) import mock_tables.dbconnector diff --git a/scripts/sfpshow b/scripts/sfpshow index a4a5e78c0290..875b64d8df6a 100755 --- a/scripts/sfpshow +++ b/scripts/sfpshow @@ -17,7 +17,7 @@ from tabulate import tabulate try: if os.environ["UTILITIES_UNIT_TESTING"] == "1": modules_path = os.path.join(os.path.dirname(__file__), "..") - test_path = os.path.join(modules_path, "sonic-utilities-tests") + test_path = os.path.join(modules_path, "tests") sys.path.insert(0, modules_path) sys.path.insert(0, test_path) import mock_tables.dbconnector diff --git a/setup.py b/setup.py index b593eedd48c6..bece679708ad 100644 --- a/setup.py +++ b/setup.py @@ -50,14 +50,14 @@ 'show', 'sonic_installer', 'sonic_installer.bootloader', - 'sonic-utilities-tests', + 'tests', 'undebug', 'utilities_common', 'watchdogutil', ], package_data={ 'show': ['aliases.ini'], - 'sonic-utilities-tests': ['acl_input/*', 'mock_tables/*.py', 'mock_tables/*.json', 'filter_fdb_input/*'] + 'tests': ['acl_input/*', 'mock_tables/*.py', 'mock_tables/*.json', 'filter_fdb_input/*'] }, scripts=[ 'scripts/aclshow', diff --git a/sonic-utilities-tests/__init__.py b/tests/__init__.py similarity index 100% rename from sonic-utilities-tests/__init__.py rename to tests/__init__.py diff --git a/sonic-utilities-tests/acl_input/acl1.json b/tests/acl_input/acl1.json similarity index 100% rename from sonic-utilities-tests/acl_input/acl1.json rename to tests/acl_input/acl1.json diff --git a/sonic-utilities-tests/acl_input/acl2.json b/tests/acl_input/acl2.json similarity index 100% rename from sonic-utilities-tests/acl_input/acl2.json rename to tests/acl_input/acl2.json diff --git a/sonic-utilities-tests/acl_input/empty_acl.json b/tests/acl_input/empty_acl.json similarity index 100% rename from sonic-utilities-tests/acl_input/empty_acl.json rename to tests/acl_input/empty_acl.json diff --git a/sonic-utilities-tests/acl_loader_test.py b/tests/acl_loader_test.py similarity index 100% rename from sonic-utilities-tests/acl_loader_test.py rename to tests/acl_loader_test.py diff --git a/sonic-utilities-tests/aclshow_test.py b/tests/aclshow_test.py similarity index 100% rename from sonic-utilities-tests/aclshow_test.py rename to tests/aclshow_test.py diff --git a/sonic-utilities-tests/config_mgmt_test.py b/tests/config_mgmt_test.py similarity index 100% rename from sonic-utilities-tests/config_mgmt_test.py rename to tests/config_mgmt_test.py diff --git a/sonic-utilities-tests/drops_group_test.py b/tests/drops_group_test.py similarity index 100% rename from sonic-utilities-tests/drops_group_test.py rename to tests/drops_group_test.py diff --git a/sonic-utilities-tests/filter_fdb_entries_test.py b/tests/filter_fdb_entries_test.py similarity index 100% rename from sonic-utilities-tests/filter_fdb_entries_test.py rename to tests/filter_fdb_entries_test.py diff --git a/sonic-utilities-tests/filter_fdb_input/__init__.py b/tests/filter_fdb_input/__init__.py similarity index 100% rename from sonic-utilities-tests/filter_fdb_input/__init__.py rename to tests/filter_fdb_input/__init__.py diff --git a/sonic-utilities-tests/filter_fdb_input/arp.json b/tests/filter_fdb_input/arp.json similarity index 100% rename from sonic-utilities-tests/filter_fdb_input/arp.json rename to tests/filter_fdb_input/arp.json diff --git a/sonic-utilities-tests/filter_fdb_input/config_db.json b/tests/filter_fdb_input/config_db.json similarity index 100% rename from sonic-utilities-tests/filter_fdb_input/config_db.json rename to tests/filter_fdb_input/config_db.json diff --git a/sonic-utilities-tests/filter_fdb_input/expected_fdb.json b/tests/filter_fdb_input/expected_fdb.json similarity index 100% rename from sonic-utilities-tests/filter_fdb_input/expected_fdb.json rename to tests/filter_fdb_input/expected_fdb.json diff --git a/sonic-utilities-tests/filter_fdb_input/fdb.json b/tests/filter_fdb_input/fdb.json similarity index 100% rename from sonic-utilities-tests/filter_fdb_input/fdb.json rename to tests/filter_fdb_input/fdb.json diff --git a/sonic-utilities-tests/filter_fdb_input/test_vectors.py b/tests/filter_fdb_input/test_vectors.py similarity index 92% rename from sonic-utilities-tests/filter_fdb_input/test_vectors.py rename to tests/filter_fdb_input/test_vectors.py index 2321da47af40..01d92240e04e 100644 --- a/sonic-utilities-tests/filter_fdb_input/test_vectors.py +++ b/tests/filter_fdb_input/test_vectors.py @@ -243,14 +243,14 @@ ], }, { - "arp": "sonic-utilities-tests/filter_fdb_input/arp.json", - "fdb": "sonic-utilities-tests/filter_fdb_input/fdb.json", - "config_db": "sonic-utilities-tests/filter_fdb_input/config_db.json", - "expected_fdb": "sonic-utilities-tests/filter_fdb_input/expected_fdb.json" + "arp": "tests/filter_fdb_input/arp.json", + "fdb": "tests/filter_fdb_input/fdb.json", + "config_db": "tests/filter_fdb_input/config_db.json", + "expected_fdb": "tests/filter_fdb_input/expected_fdb.json" }, { - "arp": "sonic-utilities-tests/filter_fdb_input/arp.json", - "fdb": "sonic-utilities-tests/filter_fdb_input/fdb.json", + "arp": "tests/filter_fdb_input/arp.json", + "fdb": "tests/filter_fdb_input/fdb.json", "config_db": { "VLAN": { "Vlan1": {} @@ -263,8 +263,8 @@ ], }, { - "arp": "sonic-utilities-tests/filter_fdb_input/arp.json", - "fdb": "sonic-utilities-tests/filter_fdb_input/fdb.json", + "arp": "tests/filter_fdb_input/arp.json", + "fdb": "tests/filter_fdb_input/fdb.json", "config_db": { }, "expected_fdb": [ diff --git a/sonic-utilities-tests/gearbox_test.py b/tests/gearbox_test.py similarity index 96% rename from sonic-utilities-tests/gearbox_test.py rename to tests/gearbox_test.py index 2d0cef041e78..ba7975fed378 100644 --- a/sonic-utilities-tests/gearbox_test.py +++ b/tests/gearbox_test.py @@ -9,7 +9,7 @@ sys.path.insert(0, test_path) sys.path.insert(0, modules_path) -import mock_tables.dbconnector # required by sonic-utilities-tests +import mock_tables.dbconnector # required by tests import show.main as show diff --git a/sonic-utilities-tests/intfstat_test.py b/tests/intfstat_test.py similarity index 100% rename from sonic-utilities-tests/intfstat_test.py rename to tests/intfstat_test.py diff --git a/sonic-utilities-tests/intfutil_test.py b/tests/intfutil_test.py similarity index 100% rename from sonic-utilities-tests/intfutil_test.py rename to tests/intfutil_test.py diff --git a/sonic-utilities-tests/mock_tables/__init__.py b/tests/mock_tables/__init__.py similarity index 100% rename from sonic-utilities-tests/mock_tables/__init__.py rename to tests/mock_tables/__init__.py diff --git a/sonic-utilities-tests/mock_tables/appl_db.json b/tests/mock_tables/appl_db.json similarity index 100% rename from sonic-utilities-tests/mock_tables/appl_db.json rename to tests/mock_tables/appl_db.json diff --git a/sonic-utilities-tests/mock_tables/asic_db.json b/tests/mock_tables/asic_db.json similarity index 100% rename from sonic-utilities-tests/mock_tables/asic_db.json rename to tests/mock_tables/asic_db.json diff --git a/sonic-utilities-tests/mock_tables/config_db.json b/tests/mock_tables/config_db.json similarity index 100% rename from sonic-utilities-tests/mock_tables/config_db.json rename to tests/mock_tables/config_db.json diff --git a/sonic-utilities-tests/mock_tables/counters_db.json b/tests/mock_tables/counters_db.json similarity index 100% rename from sonic-utilities-tests/mock_tables/counters_db.json rename to tests/mock_tables/counters_db.json diff --git a/sonic-utilities-tests/mock_tables/dbconnector.py b/tests/mock_tables/dbconnector.py similarity index 100% rename from sonic-utilities-tests/mock_tables/dbconnector.py rename to tests/mock_tables/dbconnector.py diff --git a/sonic-utilities-tests/mock_tables/state_db.json b/tests/mock_tables/state_db.json similarity index 100% rename from sonic-utilities-tests/mock_tables/state_db.json rename to tests/mock_tables/state_db.json diff --git a/sonic-utilities-tests/port2alias_test.py b/tests/port2alias_test.py similarity index 100% rename from sonic-utilities-tests/port2alias_test.py rename to tests/port2alias_test.py diff --git a/sonic-utilities-tests/psu_test.py b/tests/psu_test.py similarity index 100% rename from sonic-utilities-tests/psu_test.py rename to tests/psu_test.py diff --git a/sonic-utilities-tests/pytest.ini b/tests/pytest.ini similarity index 100% rename from sonic-utilities-tests/pytest.ini rename to tests/pytest.ini diff --git a/sonic-utilities-tests/sfp_test.py b/tests/sfp_test.py similarity index 100% rename from sonic-utilities-tests/sfp_test.py rename to tests/sfp_test.py diff --git a/sonic-utilities-tests/show_breakout_test.py b/tests/show_breakout_test.py similarity index 100% rename from sonic-utilities-tests/show_breakout_test.py rename to tests/show_breakout_test.py