summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml42
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc007.yaml46
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc020.yaml41
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc021.yaml44
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation.py50
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation_noisy.py54
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_vtc_throughput.py49
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_vtc_throughput_noisy_test.py52
-rw-r--r--tests/unit/orchestrator/test_heat.py19
9 files changed, 2 insertions, 395 deletions
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml
deleted file mode 100644
index ec7314456..000000000
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2016-2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
----
-
-schema: "yardstick:task:0.1"
-description: >
- Yardstick TC006 config file.
-
-scenarios:
--
- type: vtc_throughput
-
- options:
- packet_size: 1280
- vlan_sender: 2033
- vlan_receiver: 2040
- default_net_name: management_network
- default_subnet_name: management_subnet
- vlan_net_1_name: apexlake_inbound_network
- vlan_subnet_1_name: apexlake_inbound_subnet
- vlan_net_2_name: apexlake_outbound_network
- vlan_subnet_2_name: apexlake_outbound_subnet
- vnic_type: direct
- vtc_flavor: yardstick-flavor
-
- runner:
- type: Iteration
- iterations: 1
-
-context:
- type: Dummy
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc007.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc007.yaml
deleted file mode 100644
index 5f51e7adc..000000000
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc007.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (c) 2016-2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
----
-
-schema: "yardstick:task:0.1"
-description: >
- Sample benchmark task config file;
- vTC.
-
-scenarios:
--
- type: vtc_throughput_noisy
-
- options:
- packet_size: 1280
- vlan_sender: 2033
- vlan_receiver: 2040
- default_net_name: management_network
- default_subnet_name: management_subnet
- vlan_net_1_name: apexlake_inbound_network
- vlan_subnet_1_name: apexlake_inbound_subnet
- vlan_net_2_name: apexlake_outbound_network
- vlan_subnet_2_name: apexlake_outbound_subnet
- vnic_type: direct
- vtc_flavor: yardstick-flavor
- num_of_neighbours: 2
- amount_of_ram: 1G
- number_of_cores: 2
-
- runner:
- type: Iteration
- iterations: 1
-
-context:
- type: Dummy
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc020.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc020.yaml
deleted file mode 100644
index fe89bf8ab..000000000
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc020.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2016-2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
----
-
-schema: "yardstick:task:0.1"
-description: >
- Yardstick TC020 config file.
-
-scenarios:
--
- type: vtc_instantiation_validation
-
- options:
- vlan_sender: 2033
- vlan_receiver: 2040
- default_net_name: management_network
- default_subnet_name: management_subnet
- vlan_net_1_name: apexlake_inbound_network
- vlan_subnet_1_name: apexlake_inbound_subnet
- vlan_net_2_name: apexlake_outbound_network
- vlan_subnet_2_name: apexlake_outbound_subnet
- vnic_type: direct
- vtc_flavor: yardstick-flavor
-
- runner:
- type: Iteration
- iterations: 1
-
-context:
- type: Dummy
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc021.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc021.yaml
deleted file mode 100644
index 735699dab..000000000
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc021.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (c) 2016-2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
----
-
-schema: "yardstick:task:0.1"
-description: >
- Yardstick TC021 config file.
-
-scenarios:
--
- type: vtc_instantiation_validation_noisy
-
- options:
- vlan_sender: 2033
- vlan_receiver: 2040
- default_net_name: management_network
- default_subnet_name: management_subnet
- vlan_net_1_name: apexlake_inbound_network
- vlan_subnet_1_name: apexlake_inbound_subnet
- vlan_net_2_name: apexlake_outbound_network
- vlan_subnet_2_name: apexlake_outbound_subnet
- vnic_type: direct
- vtc_flavor: yardstick-flavor
- num_of_neighbours: 2
- amount_of_ram: 1G
- number_of_cores: 2
-
- runner:
- type: Iteration
- iterations: 1
-
-context:
- type: Dummy
diff --git a/tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation.py b/tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation.py
deleted file mode 100644
index 07b3da992..000000000
--- a/tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-# Unittest for yardstick.benchmark.scenarios.networking.iperf3.Iperf
-
-from __future__ import absolute_import
-import unittest
-
-from yardstick.benchmark.scenarios.networking import \
- vtc_instantiation_validation
-
-
-class VtcInstantiationValidationTestCase(unittest.TestCase):
-
- def setUp(self):
- scenario = dict()
- scenario['options'] = dict()
- scenario['options']['default_net_name'] = ''
- scenario['options']['default_subnet_name'] = ''
- scenario['options']['vlan_net_1_name'] = ''
- scenario['options']['vlan_subnet_1_name'] = ''
- scenario['options']['vlan_net_2_name'] = ''
- scenario['options']['vlan_subnet_2_name'] = ''
- scenario['options']['vnic_type'] = ''
- scenario['options']['vtc_flavor'] = ''
- scenario['options']['packet_size'] = ''
- scenario['options']['vlan_sender'] = ''
- scenario['options']['vlan_receiver'] = ''
-
- self.vt = vtc_instantiation_validation.VtcInstantiationValidation(
- scenario, '')
-
- def test_run_for_success(self):
- result = {}
- self.vt.run(result)
-
-
-def main():
- unittest.main()
-
-if __name__ == '__main__':
- main()
diff --git a/tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation_noisy.py b/tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation_noisy.py
deleted file mode 100644
index 34f3610b1..000000000
--- a/tests/unit/benchmark/scenarios/networking/test_vtc_instantiation_validation_noisy.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-# Unittest for yardstick.benchmark.scenarios.networking.iperf3.Iperf
-
-from __future__ import absolute_import
-import unittest
-
-from yardstick.benchmark.scenarios.networking import \
- vtc_instantiation_validation_noisy
-
-
-class VtcInstantiationValidationiNoisyTestCase(unittest.TestCase):
-
- def setUp(self):
- scenario = dict()
- scenario['options'] = dict()
- scenario['options']['default_net_name'] = ''
- scenario['options']['default_subnet_name'] = ''
- scenario['options']['vlan_net_1_name'] = ''
- scenario['options']['vlan_subnet_1_name'] = ''
- scenario['options']['vlan_net_2_name'] = ''
- scenario['options']['vlan_subnet_2_name'] = ''
- scenario['options']['vnic_type'] = ''
- scenario['options']['vtc_flavor'] = ''
- scenario['options']['packet_size'] = ''
- scenario['options']['vlan_sender'] = ''
- scenario['options']['vlan_receiver'] = ''
- scenario['options']['num_of_neighbours'] = '1'
- scenario['options']['amount_of_ram'] = '1G'
- scenario['options']['number_of_cores'] = '1'
-
- self.vt = \
- vtc_instantiation_validation_noisy.VtcInstantiationValidationNoisy(
- scenario, '')
-
- def test_run_for_success(self):
- result = {}
- self.vt.run(result)
-
-
-def main():
- unittest.main()
-
-if __name__ == '__main__':
- main()
diff --git a/tests/unit/benchmark/scenarios/networking/test_vtc_throughput.py b/tests/unit/benchmark/scenarios/networking/test_vtc_throughput.py
deleted file mode 100644
index a73fad5a8..000000000
--- a/tests/unit/benchmark/scenarios/networking/test_vtc_throughput.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-# Unittest for yardstick.benchmark.scenarios.networking.iperf3.Iperf
-
-from __future__ import absolute_import
-import mock
-import unittest
-
-from yardstick.benchmark.scenarios.networking import vtc_throughput
-
-
-class VtcThroughputTestCase(unittest.TestCase):
-
- def setUp(self):
- scenario = dict()
- scenario['options'] = dict()
- scenario['options']['default_net_name'] = ''
- scenario['options']['default_subnet_name'] = ''
- scenario['options']['vlan_net_1_name'] = ''
- scenario['options']['vlan_subnet_1_name'] = ''
- scenario['options']['vlan_net_2_name'] = ''
- scenario['options']['vlan_subnet_2_name'] = ''
- scenario['options']['vnic_type'] = ''
- scenario['options']['vtc_flavor'] = ''
- scenario['options']['packet_size'] = ''
- scenario['options']['vlan_sender'] = ''
- scenario['options']['vlan_receiver'] = ''
-
- self.vt = vtc_throughput.VtcThroughput(scenario, '')
-
- def test_run_for_success(self):
- result = {}
- self.vt.run(result)
-
-
-def main():
- unittest.main()
-
-if __name__ == '__main__':
- main()
diff --git a/tests/unit/benchmark/scenarios/networking/test_vtc_throughput_noisy_test.py b/tests/unit/benchmark/scenarios/networking/test_vtc_throughput_noisy_test.py
deleted file mode 100644
index e1b162c79..000000000
--- a/tests/unit/benchmark/scenarios/networking/test_vtc_throughput_noisy_test.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-# Unittest for yardstick.benchmark.scenarios.networking.iperf3.Iperf
-
-from __future__ import absolute_import
-import mock
-import unittest
-
-from yardstick.benchmark.scenarios.networking import vtc_throughput_noisy
-
-
-class VtcThroughputNoisyTestCase(unittest.TestCase):
-
- def setUp(self):
- scenario = dict()
- scenario['options'] = dict()
- scenario['options']['default_net_name'] = ''
- scenario['options']['default_subnet_name'] = ''
- scenario['options']['vlan_net_1_name'] = ''
- scenario['options']['vlan_subnet_1_name'] = ''
- scenario['options']['vlan_net_2_name'] = ''
- scenario['options']['vlan_subnet_2_name'] = ''
- scenario['options']['vnic_type'] = ''
- scenario['options']['vtc_flavor'] = ''
- scenario['options']['packet_size'] = ''
- scenario['options']['vlan_sender'] = ''
- scenario['options']['vlan_receiver'] = ''
- scenario['options']['num_of_neighbours'] = '1'
- scenario['options']['amount_of_ram'] = '1G'
- scenario['options']['number_of_cores'] = '1'
-
- self.vt = vtc_throughput_noisy.VtcThroughputNoisy(scenario, '')
-
- def test_run_for_success(self):
- result = {}
- self.vt.run(result)
-
-
-def main():
- unittest.main()
-
-if __name__ == '__main__':
- main()
diff --git a/tests/unit/orchestrator/test_heat.py b/tests/unit/orchestrator/test_heat.py
index 151070423..c34ea53fc 100644
--- a/tests/unit/orchestrator/test_heat.py
+++ b/tests/unit/orchestrator/test_heat.py
@@ -181,7 +181,7 @@ class HeatTemplateTestCase(unittest.TestCase):
self.assertEqual(heat_template.resources['test']['type'], 'OS::Nova::Flavor')
@mock_patch_target_module('op_utils')
- @mock_patch_target_module('heatclient.client.Client')
+ @mock_patch_target_module('heatclient')
def test_create_negative(self, mock_heat_client_class, mock_op_utils):
self.template.HEAT_WAIT_LOOP_INTERVAL = 0
mock_heat_client = mock_heat_client_class() # get the constructed mock
@@ -207,8 +207,6 @@ class HeatTemplateTestCase(unittest.TestCase):
self.assertEqual(mock_op_utils.get_heat_api_version.call_count, expected_op_utils_usage)
# ensure the constructor and instance were used
- expected_constructor_calls += 1
- expected_create_calls += 1
self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls)
self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls)
@@ -233,7 +231,6 @@ class HeatTemplateTestCase(unittest.TestCase):
self.assertEqual(mock_op_utils.get_heat_api_version.call_count, expected_op_utils_usage)
# ensure the constructor was not used but the instance was used
- expected_create_calls += 1
self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls)
self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls)
@@ -241,13 +238,8 @@ class HeatTemplateTestCase(unittest.TestCase):
expected_status_calls += 3
self.assertEqual(mock_status.call_count, expected_status_calls)
- # ensure the expected exception was raised
- error_message = get_error_message(raised.exception)
- self.assertNotIn('timeout', error_message)
- self.assertIn('the reason', error_message)
-
@mock_patch_target_module('op_utils')
- @mock_patch_target_module('heatclient.client.Client')
+ @mock_patch_target_module('heatclient')
def test_create(self, mock_heat_client_class, mock_op_utils):
self.template.HEAT_WAIT_LOOP_INTERVAL = 0.2
mock_heat_client = mock_heat_client_class()
@@ -283,8 +275,6 @@ class HeatTemplateTestCase(unittest.TestCase):
self.assertEqual(mock_op_utils.get_heat_api_version.call_count, expected_op_utils_usage)
# ensure the constructor and instance were used
- expected_constructor_calls += 1
- expected_create_calls += 1
self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls)
self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls)
@@ -301,7 +291,6 @@ class HeatTemplateTestCase(unittest.TestCase):
self.assertIsInstance(self.template.create(block=True, timeout=2), heat.HeatStack)
# ensure existing instance was re-used and op_utils was not used
- expected_create_calls += 1
self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls)
self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls)
@@ -309,9 +298,6 @@ class HeatTemplateTestCase(unittest.TestCase):
expected_status_calls += 1
self.assertEqual(mock_status.call_count, expected_status_calls)
- # ensure the expected outputs are present
- self.assertDictEqual(self.template.outputs, expected_outputs)
-
# reset template outputs
self.template.outputs = None
@@ -324,7 +310,6 @@ class HeatTemplateTestCase(unittest.TestCase):
self.assertIsInstance(self.template.create(block=True, timeout=2), heat.HeatStack)
# ensure existing instance was re-used and op_utils was not used
- expected_create_calls += 1
self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls)
self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls)