diff options
-rw-r--r-- | docs/testing/user/userguide/04-installation.rst | 30 | ||||
-rw-r--r-- | samples/vnf_samples/nsut/cgnapt/cgnat.cfg | 2 | ||||
-rw-r--r-- | tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml | 4 | ||||
-rw-r--r-- | tests/unit/benchmark/scenarios/networking/test_iperf3.py | 22 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/networking/iperf3.py | 20 |
5 files changed, 42 insertions, 36 deletions
diff --git a/docs/testing/user/userguide/04-installation.rst b/docs/testing/user/userguide/04-installation.rst index cb4f31434..b40e1143e 100644 --- a/docs/testing/user/userguide/04-installation.rst +++ b/docs/testing/user/userguide/04-installation.rst @@ -82,7 +82,7 @@ following docker command:: Run the Docker image to get a Yardstick container:: - docker run -itd --privileged -v /var/run/docker.sock:/var/run/docker.sock -p 8888:5000 -e INSTALLER_IP=192.168.200.2 -e INSTALLER_TYPE=compass --name yardstick opnfv/yardstick:stable + docker run -itd --privileged -v /var/run/docker.sock:/var/run/docker.sock -p 8888:5000 --name yardstick opnfv/yardstick:stable Note: @@ -101,21 +101,6 @@ Note: | | Yardstick container, this | | | parameter is needed. | +----------------------------------------------+------------------------------+ -| -e INSTALLER_IP=192.168.200.2 | If you want to use yardstick | -| | env prepare command(or | -| -e INSTALLER_TYPE=compass | related API) to load the | -| | images that Yardstick needs, | -| | these parameters should be | -| | provided. | -| | The INSTALLER_IP and | -| | INSTALLER_TYPE are depending | -| | on your OpenStack installer. | -| | Currently Apex, Compass, | -| | Fuel and Joid are supported. | -| | If you use other installers, | -| | such as devstack, these | -| | parameters can be ignores. | -+----------------------------------------------+------------------------------+ | -p 8888:5000 | If you want to call | | | Yardstick API out of | | | Yardstick container, this | @@ -149,11 +134,11 @@ In the Yardstick container, the Yardstick repository is located in the ``/home/o yardstick env prepare -**NOTE**: The above command works for four OPNFV installers -- **Apex**, **Compass**, **Fuel** and **Joid**. -For Non-OPNFV installer OpenStack environment, the above command can also be used to configure the environment. -But before running the above command in a Non-OPNFV installer environment, it is necessary to create the /etc/yardstick/openstack.creds file and -save OpenStack environment variables in it. For details of the required OpenStack environment variables please refer to -section **Export OpenStack environment variables** +**NOTE**: Since Euphrates release, the above command will not able to automatically configure the /etc/yardstick/openstack.creds file. +So before running the above command, it is necessary to create the /etc/yardstick/openstack.creds file and save OpenStack environment variables into it manually. +If you have the openstack credential file saved outside the Yardstcik Docker container, you can do this easily by mapping the credential file into Yardstick container + using '-v /path/to/credential_file:/etc/yardstick/openstack.creds' when running the Yardstick container. +For details of the required OpenStack environment variables please refer to section **Export OpenStack environment variables** The env prepare command may take up to 6-8 minutes to finish building yardstick-image and other environment preparation. Meanwhile if you wish to @@ -647,4 +632,5 @@ yaml file and add test cases, constraint or task arguments if necessary. Proxy Support (**Todo**) ----------------------------
\ No newline at end of file +--------------------------- + diff --git a/samples/vnf_samples/nsut/cgnapt/cgnat.cfg b/samples/vnf_samples/nsut/cgnapt/cgnat.cfg index 394f4ad8c..37c5e2731 100644 --- a/samples/vnf_samples/nsut/cgnapt/cgnat.cfg +++ b/samples/vnf_samples/nsut/cgnapt/cgnat.cfg @@ -76,8 +76,6 @@ timer_period = 10000 max_clients_per_ip = 65535 max_port_per_client = 100 public_ip_port_range = 04040000:(1, 65535) -public_ip_port_range = 04040001:(1, 65535) -public_ip_port_range = 04040002:(1, 65535) vnf_set = (3,4,5) pkt_type = ipv4 cgnapt_meta_offset = 128 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/yardstick/benchmark/scenarios/networking/iperf3.py b/yardstick/benchmark/scenarios/networking/iperf3.py index a3d273750..98c45990e 100644 --- a/yardstick/benchmark/scenarios/networking/iperf3.py +++ b/yardstick/benchmark/scenarios/networking/iperf3.py @@ -111,18 +111,22 @@ For more info see http://software.es.net/iperf # If there are no options specified if not options: - options = "" + options = {} use_UDP = False - if "udp" in options: - cmd += " --udp" - use_UDP = True - if "bandwidth" in options: - cmd += " --bandwidth %s" % options["bandwidth"] - else: - # tcp obviously + try: + protocol = options.get("protocol") + bandwidth = options.get('bandwidth') + use_UDP = protocol == 'udp' + if protocol: + cmd += " --" + protocol + if use_UDP and bandwidth: + cmd += " --bandwidth " + bandwidth + # if nodelay in the option, protocal maybe null or 'tcp' if "nodelay" in options: cmd += " --nodelay" + except AttributeError: + LOG.warning("Can't parser the options in your config file!!!") # these options are mutually exclusive in iperf3 if time: |