aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ci/yardstick-verify4
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml4
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_iperf3.py22
-rw-r--r--tests/unit/network_services/nfvi/test_resource.py13
4 files changed, 32 insertions, 11 deletions
diff --git a/tests/ci/yardstick-verify b/tests/ci/yardstick-verify
index f3e7a49e3..d1174825f 100755
--- a/tests/ci/yardstick-verify
+++ b/tests/ci/yardstick-verify
@@ -209,10 +209,10 @@ EOF
- local scenario_status="SUCCESS"
+ local scenario_status="PASS"
if [ $failed -gt 0 ]; then
- scenario_status="FAILED"
+ scenario_status="FAIL"
fi
report "${scenario_status}" "${start_date}" "${stop_date}"
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
index b2077d59e..ee36c6c82 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
@@ -13,7 +13,7 @@ description: >
Yardstick TC011 config file;
Measure packet delay variation (jitter) using iperf3.
-{% set udp = udp or "udp" %}
+{% set protocol = protocol or "udp" %}
{% set bandwidth = bandwidth or "20m" %}
{% set length = length or "8K" %}
{% set window = window or 29200 %}
@@ -25,7 +25,7 @@ scenarios:
-
type: Iperf3
options:
- udp: {{udp}}
+ protocol: {{protocol}}
bandwidth: {{bandwidth}}
length: {{length}}
window: {{window}}
diff --git a/tests/unit/benchmark/scenarios/networking/test_iperf3.py b/tests/unit/benchmark/scenarios/networking/test_iperf3.py
index 331245357..4d3745230 100644
--- a/tests/unit/benchmark/scenarios/networking/test_iperf3.py
+++ b/tests/unit/benchmark/scenarios/networking/test_iperf3.py
@@ -123,7 +123,7 @@ class IperfTestCase(unittest.TestCase):
self.assertRaises(AssertionError, p.run, result)
def test_iperf_successful_sla_jitter(self, mock_ssh):
- options = {"udp": "udp", "bandwidth": "20m"}
+ options = {"protocol": "udp", "bandwidth": "20m"}
args = {
'options': options,
'sla': {'jitter': 10}
@@ -141,7 +141,7 @@ class IperfTestCase(unittest.TestCase):
self.assertEqual(result, expected_result)
def test_iperf_unsuccessful_sla_jitter(self, mock_ssh):
- options = {"udp": "udp", "bandwidth": "20m"}
+ options = {"protocol": "udp", "bandwidth": "20m"}
args = {
'options': options,
'sla': {'jitter': 0.0001}
@@ -156,6 +156,24 @@ class IperfTestCase(unittest.TestCase):
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
self.assertRaises(AssertionError, p.run, result)
+ def test_iperf_successful_tcp_protocal(self, mock_ssh):
+ options = {"protocol": "tcp", "nodelay": "yes"}
+ args = {
+ 'options': options,
+ 'sla': {'bytes_per_second': 15000000}
+ }
+ result = {}
+
+ p = iperf3.Iperf(args, self.ctx)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ p.host = mock_ssh.SSH.from_node()
+
+ sample_output = self._read_sample_output(self.output_name_tcp)
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
+ expected_result = utils.flatten_dict_key(jsonutils.loads(sample_output))
+ p.run(result)
+ self.assertEqual(result, expected_result)
+
def test_iperf_unsuccessful_script_error(self, mock_ssh):
options = {}
diff --git a/tests/unit/network_services/nfvi/test_resource.py b/tests/unit/network_services/nfvi/test_resource.py
index 799cc202b..f3244fdbd 100644
--- a/tests/unit/network_services/nfvi/test_resource.py
+++ b/tests/unit/network_services/nfvi/test_resource.py
@@ -134,6 +134,14 @@ class TestResourceProfile(unittest.TestCase):
self.assertIsNone(
self.resource_profile._prepare_collectd_conf("/opt/nsb_bin"))
+ def test__setup_intel_pmu(self):
+ self.assertIsNone(
+ self.resource_profile._setup_intel_pmu(self.ssh_mock, "/opt/nsb_bin"))
+
+ def test__setup_ovs_stats(self):
+ self.assertIsNone(
+ self.resource_profile._setup_ovs_stats(self.ssh_mock))
+
@mock.patch("yardstick.network_services.nfvi.resource.open")
@mock.patch("yardstick.network_services.nfvi.resource.os")
def test__provide_config_file(self, mock_open, mock_os):
@@ -187,7 +195,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result({})
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -200,7 +207,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {1: {'ipc': '1234'}}, 'dpdkstat': {}, 'hugepages': {},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -209,7 +215,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {},
'memory': {'bw': '101'}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -220,7 +225,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {'free': '101'},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -237,7 +241,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {}, 'dpdkstat': {'tx': '101'}, 'hugepages': {},
'memory': {}, 'ovs_stats': {'tx': '101'}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {'memory': '101'}}
self.assertDictEqual(res, expected_result)