diff options
Diffstat (limited to 'functest')
-rw-r--r--[-rwxr-xr-x] | functest/ci/download_images.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | functest/ci/prepare_env.py | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | functest/ci/run_tests.py | 3 | ||||
-rw-r--r-- | functest/cli/commands/cli_env.py | 5 | ||||
-rw-r--r-- | functest/cli/commands/cli_testcase.py | 5 | ||||
-rw-r--r-- | functest/cli/commands/cli_tier.py | 3 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/custom_tests/blacklist.txt | 62 | ||||
-rw-r--r--[-rwxr-xr-x] | functest/opnfv_tests/openstack/vping/ping.sh | 0 | ||||
-rw-r--r-- | functest/tests/unit/cli/commands/test_cli_env.py | 7 | ||||
-rw-r--r-- | functest/tests/unit/cli/commands/test_cli_testcase.py | 21 | ||||
-rw-r--r-- | functest/tests/unit/cli/commands/test_cli_tier.py | 21 |
11 files changed, 13 insertions, 118 deletions
diff --git a/functest/ci/download_images.sh b/functest/ci/download_images.sh index 23e09c10..23e09c10 100755..100644 --- a/functest/ci/download_images.sh +++ b/functest/ci/download_images.sh diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py index ae9d9537..da3e6245 100755..100644 --- a/functest/ci/prepare_env.py +++ b/functest/ci/prepare_env.py @@ -389,7 +389,3 @@ def main(): parser = PrepareEnvParser() args = parser.parse_args(sys.argv[1:]) return prepare_env(**args) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index 5155adc4..b95e1008 100755..100644 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -276,6 +276,3 @@ def main(): args = parser.parse_args(sys.argv[1:]) runner = Runner() return runner.main(**args).value - -if __name__ == '__main__': - sys.exit(main()) diff --git a/functest/cli/commands/cli_env.py b/functest/cli/commands/cli_env.py index ce977572..99d36996 100644 --- a/functest/cli/commands/cli_env.py +++ b/functest/cli/commands/cli_env.py @@ -8,7 +8,6 @@ # import os -import pkg_resources import click import prettytable @@ -36,9 +35,7 @@ class CliEnv(object): else: answer = raw_input("Invalid answer. Please type [y|n]\n") - cmd = ("python %s start" % pkg_resources.resource_filename( - 'functest', 'ci/prepare_env.py')) - ft_utils.execute_command(cmd) + ft_utils.execute_command("prepare_env start") def show(self): def _get_value(attr, default='Unknown'): diff --git a/functest/cli/commands/cli_testcase.py b/functest/cli/commands/cli_testcase.py index 91904d87..cb3d4739 100644 --- a/functest/cli/commands/cli_testcase.py +++ b/functest/cli/commands/cli_testcase.py @@ -60,8 +60,5 @@ class CliTestcase(object): else: tests = testname.split(",") for test in tests: - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - flags, test)) + cmd = "run_tests {}-t {}".format(flags, test) ft_utils.execute_command(cmd) diff --git a/functest/cli/commands/cli_tier.py b/functest/cli/commands/cli_tier.py index 48e9f542..9b2e60ba 100644 --- a/functest/cli/commands/cli_tier.py +++ b/functest/cli/commands/cli_tier.py @@ -68,6 +68,5 @@ class CliTier(object): click.echo("Functest environment is not ready. " "Run first 'functest env prepare'") else: - cmd = ("python %s %s -t %s" % (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), flags, tiername)) + cmd = "run_tests {}-t {}".format(flags, tiername) ft_utils.execute_command(cmd) diff --git a/functest/opnfv_tests/openstack/tempest/custom_tests/blacklist.txt b/functest/opnfv_tests/openstack/tempest/custom_tests/blacklist.txt index 026b24f4..bb1aed33 100644 --- a/functest/opnfv_tests/openstack/tempest/custom_tests/blacklist.txt +++ b/functest/opnfv_tests/openstack/tempest/custom_tests/blacklist.txt @@ -1,64 +1,2 @@ - - scenarios: - - os-odl_l2-nofeature-ha - - os-odl_l2-nofeature-noha - - os-nosdn-nofeature-ha - - os-nosdn-nofeature-noha - installers: - - joid - tests: - - tempest.api.object_storage - -- - scenarios: - - os-nosdn-lxd-ha - - os-nosdn-lxd-noha - installers: - - joid - tests: - - tempest.api.object_storage - - tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_network_basic_ops - - tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops - - tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_volume_boot_pattern - - tempest.scenario.test_volume_boot_pattern.TestVolumeBootPatternV2.test_volume_boot_pattern - -- - scenarios: - - os-onos-nofeature-ha - - os-onos-nofeature-noha - installers: - - compass - tests: - - tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_reboot_server_hard - - tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_network_basic_ops - - tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops - - tempest.scenario.test_volume_boot_pattern.TestVolumeBootPattern.test_volume_boot_pattern - - tempest.scenario.test_volume_boot_pattern.TestVolumeBootPatternV2.test_volume_boot_pattern - -- - # https://bugs.launchpad.net/tempest/+bug/1577632 - scenarios: - - os-odl_l2-nofeature-ha - - os-odl_l2-nofeature-noha - - os-odl_l2-sfc-ha - - os-odl_l2-sfc-noha - - os-odl_l2-bgpvpn-ha - - os-odl_l2-bgpvpn-noha - - os-odl_l3-nofeature-ha - - os-odl_l3-nofeature-noha - installers: - - fuel - tests: - - tempest.scenario.test_server_basic_ops.TestServerBasicOps.test_server_basic_ops - -- - # https://bugs.opendaylight.org/show_bug.cgi?id=5586 - scenarios: - - os-odl-bgpvpn-ha - - os-odl-gluon-noha - - os-odl_l2-bgpvpn-ha - installers: - - apex - tests: - - tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_reboot_server_hard diff --git a/functest/opnfv_tests/openstack/vping/ping.sh b/functest/opnfv_tests/openstack/vping/ping.sh index 693b8682..693b8682 100755..100644 --- a/functest/opnfv_tests/openstack/vping/ping.sh +++ b/functest/opnfv_tests/openstack/vping/ping.sh diff --git a/functest/tests/unit/cli/commands/test_cli_env.py b/functest/tests/unit/cli/commands/test_cli_env.py index 0b18554b..ddd5d86c 100644 --- a/functest/tests/unit/cli/commands/test_cli_env.py +++ b/functest/tests/unit/cli/commands/test_cli_env.py @@ -6,7 +6,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 import logging -import pkg_resources import unittest import mock @@ -25,8 +24,7 @@ class CliEnvTesting(unittest.TestCase): return_value=False) @mock.patch('functest.cli.commands.cli_testcase.ft_utils.execute_command') def test_prepare_default(self, mock_ft_utils, mock_os): - cmd = ("python %s start" % pkg_resources.resource_filename( - 'functest', 'ci/prepare_env.py')) + cmd = "prepare_env start" self.cli_environ.prepare() mock_ft_utils.assert_called_with(cmd) @@ -37,8 +35,7 @@ class CliEnvTesting(unittest.TestCase): with mock.patch('__builtin__.raw_input', return_value="y"), \ mock.patch('functest.cli.commands.cli_testcase.os.remove') \ as mock_os_remove: - cmd = ("python %s start" % pkg_resources.resource_filename( - 'functest', 'ci/prepare_env.py')) + cmd = "prepare_env start" self.cli_environ.prepare() mock_os_remove.assert_called_once_with( CONST.__getattribute__('env_active')) diff --git a/functest/tests/unit/cli/commands/test_cli_testcase.py b/functest/tests/unit/cli/commands/test_cli_testcase.py index 4d0bdc2f..9ccf4c4a 100644 --- a/functest/tests/unit/cli/commands/test_cli_testcase.py +++ b/functest/tests/unit/cli/commands/test_cli_testcase.py @@ -7,7 +7,6 @@ import logging -import pkg_resources import unittest import mock @@ -39,10 +38,7 @@ class CliTestCasesTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_testcase.ft_utils.execute_command') def test_run_default(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "-n -r ", self.testname)) + cmd = "run_tests -n -r -t {}".format(self.testname) self.cli_tests.run(self.testname, noclean=True, report=True) mock_ft_utils.assert_called_with(cmd) @@ -50,10 +46,7 @@ class CliTestCasesTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_testcase.ft_utils.execute_command') def test_run_noclean_missing_report(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "-n ", self.testname)) + cmd = "run_tests -n -t {}".format(self.testname) self.cli_tests.run(self.testname, noclean=True, report=False) mock_ft_utils.assert_called_with(cmd) @@ -61,10 +54,7 @@ class CliTestCasesTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_testcase.ft_utils.execute_command') def test_run_report_missing_noclean(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "-r ", self.testname)) + cmd = "run_tests -r -t {}".format(self.testname) self.cli_tests.run(self.testname, noclean=False, report=True) mock_ft_utils.assert_called_with(cmd) @@ -72,10 +62,7 @@ class CliTestCasesTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_testcase.ft_utils.execute_command') def test_run_missing_noclean_report(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "", self.testname)) + cmd = "run_tests -t {}".format(self.testname) self.cli_tests.run(self.testname, noclean=False, report=False) mock_ft_utils.assert_called_with(cmd) diff --git a/functest/tests/unit/cli/commands/test_cli_tier.py b/functest/tests/unit/cli/commands/test_cli_tier.py index b42e3581..1bb630db 100644 --- a/functest/tests/unit/cli/commands/test_cli_tier.py +++ b/functest/tests/unit/cli/commands/test_cli_tier.py @@ -7,7 +7,6 @@ import logging -import pkg_resources import unittest import mock @@ -87,10 +86,7 @@ class CliTierTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_tier.ft_utils.execute_command') def test_run_default(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "-n -r ", self.tiername)) + cmd = "run_tests -n -r -t {}".format(self.tiername) self.cli_tier.run(self.tiername, noclean=True, report=True) mock_ft_utils.assert_called_with(cmd) @@ -98,10 +94,7 @@ class CliTierTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_tier.ft_utils.execute_command') def test_run_report_missing_noclean(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "-r ", self.tiername)) + cmd = "run_tests -r -t {}".format(self.tiername) self.cli_tier.run(self.tiername, noclean=False, report=True) mock_ft_utils.assert_called_with(cmd) @@ -109,10 +102,7 @@ class CliTierTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_tier.ft_utils.execute_command') def test_run_noclean_missing_report(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "-n ", self.tiername)) + cmd = "run_tests -n -t {}".format(self.tiername) self.cli_tier.run(self.tiername, noclean=True, report=False) mock_ft_utils.assert_called_with(cmd) @@ -120,10 +110,7 @@ class CliTierTesting(unittest.TestCase): return_value=True) @mock.patch('functest.cli.commands.cli_tier.ft_utils.execute_command') def test_run_missing_noclean_report(self, mock_ft_utils, mock_os): - cmd = ("python %s %s -t %s" % - (pkg_resources.resource_filename( - 'functest', 'ci/run_tests.py'), - "", self.tiername)) + cmd = "run_tests -t {}".format(self.tiername) self.cli_tier.run(self.tiername, noclean=False, report=False) mock_ft_utils.assert_called_with(cmd) |