summaryrefslogtreecommitdiffstats
path: root/docs/testing/user/userguide/opnfv_yardstick_tc014.rst
blob: 1b0d7831a1dbccef6d05ba8bb7ae66b5c7838661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
.. This work is licensed under a Creative Commons Attribution 4.0 International
.. License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) OPNFV, Huawei Technologies Co.,Ltd and others.

*************************************
Yardstick Test Case Description TC014
*************************************

.. _unixbench: https://github.com/kdlucas/byte-unixbench/blob/master/UnixBench

+-----------------------------------------------------------------------------+
|Processing speed                                                             |
|                                                                             |
+--------------+--------------------------------------------------------------+
|test case id  | OPNFV_YARDSTICK_TC014_PROCESSING SPEED                       |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|metric        | score of single cpu running,                                 |
|              | score of parallel running                                    |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test purpose  | The purpose of TC014 is to evaluate the IaaS compute         |
|              | performance with regards to CPU processing speed.            |
|              | It measures score of single cpu running and parallel         |
|              | running.                                                     |
|              |                                                              |
|              | The purpose is also to be able to spot the trends.           |
|              | Test results, graphs and similar shall be stored for         |
|              | comparison reasons and product evolution understanding       |
|              | between different OPNFV versions and/or configurations.      |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test tool     | UnixBench                                                    |
|              |                                                              |
|              | Unixbench is the most used CPU benchmarking software tool.   |
|              | It can measure the performance of bash scripts, CPUs in      |
|              | multithreading and single threading. It can also measure the |
|              | performance for parallel taks. Also, specific disk IO for    |
|              | small and large files are performed. You can use it to       |
|              | measure either linux dedicated servers and linux vps         |
|              | servers, running CentOS, Debian, Ubuntu, Fedora and other    |
|              | distros.                                                     |
|              |                                                              |
|              | (UnixBench is not always part of a Linux distribution, hence |
|              | it needs to be installed. As an example see the              |
|              | /yardstick/tools/ directory for how to generate a Linux      |
|              | image with UnixBench included.)                              |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test          | The UnixBench runs system benchmarks in a host VM on a       |
|description   | compute blade, getting information on the CPUs in the        |
|              | system. If the system has more than one CPU, the tests will  |
|              | be run twice -- once with a single copy of each test running |
|              | at once, and once with N copies, where N is the number of    |
|              | CPUs.                                                        |
|              |                                                              |
|              | UnixBench will processs a set of results from a single test  |
|              | by averaging the individal pass results into a single final  |
|              | value.                                                       |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|configuration | file: opnfv_yardstick_tc014.yaml                             |
|              |                                                              |
|              | run_mode: Run unixbench in quiet mode or verbose mode        |
|              | test_type: dhry2reg, whetstone and so on                     |
|              |                                                              |
|              | For SLA with single_score and parallel_score, both can be    |
|              | set by user, default is NA.                                  |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|applicability | Test can be configured with different:                       |
|              |                                                              |
|              |  * test types;                                               |
|              |  * dhry2reg;                                                 |
|              |  * whetstone.                                                |
|              |                                                              |
|              | Default values exist.                                        |
|              |                                                              |
|              | SLA (optional) : min_score: The minimun UnixBench score that |
|              | is accepted.                                                 |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|usability     | This test case is one of Yardstick's generic test. Thus it   |
|              | is runnable on most of the scenarios.                        |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|references    | unixbench_                                                   |
|              |                                                              |
|              | ETSI-NFV-TST001                                              |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|pre-test      | The test case image needs to be installed into Glance        |
|conditions    | with unixbench included in it.                               |
|              |                                                              |
|              | No POD specific requirements have been identified.           |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test sequence | description and expected result                              |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 1        | A host VM with UnixBench installed is booted.                |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 2        | Yardstick is connected with the host VM by using ssh.        |
|              | "unixbench_benchmark" bash script is copied from Jump Host   |
|              | to the host VM via ssh tunnel.                               |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 3        | UnixBench is invoked. All the tests are executed using the   |
|              | "Run" script in the top-level of UnixBench directory.        |
|              | The "Run" script will run a standard "index" test, and save  |
|              | the report in the "results" directory. Then the report is    |
|              | processed by "unixbench_benchmark" and checked againsted the |
|              | SLA.                                                         |
|              |                                                              |
|              | Result: Logs are stored.                                     |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 4        | The host VM is deleted.                                      |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test verdict  | Fails only if SLA is not passed, or if there is a test case  |
|              | execution problem.                                           |
|              |                                                              |
+--------------+--------------------------------------------------------------+
span class="n">k8s_CoreV1Api.delete_namespaced_pod(name = self._name, namespace = self._namespace) def update_admin_ip(self): """Check for admin IP address assigned by k8s. """ try: pod = self.k8s_CoreV1Api.read_namespaced_pod_status(name = self._name, namespace = self._namespace) self._admin_ip = pod.status.pod_ip except client.rest.ApiException as e: self._log.error("Couldn't update POD %s admin IP!\n%s\n" % (self._name, e)) def wait_for_start(self): """Wait for POD to start. """ self._log.info("Waiting for POD %s to start..." % self._name) while True: self.get_status() if (self._last_status == "Running" or self._last_status == "Failed" or self._last_status == "Unknown"): break else: time.sleep(3) self.update_admin_ip() return self._last_status def ssh_run_cmd(self, cmd): """Execute command for POD via SSH connection. SSH credentials should be configured before use of this function. """ self._ssh_client.run_cmd(cmd) def get_name(self): return self._name def get_admin_ip(self): return self._admin_ip def get_dp_ip(self): return self._dp_ip def get_dp_mac(self): return self._sriov_vf_mac def get_dp_pci_dev(self): return self._sriov_vf def get_id(self): return self._id def get_status(self): """Get current status fro the pod. """ try: pod = self.k8s_CoreV1Api.read_namespaced_pod_status(name = self._name, namespace = self._namespace) except client.rest.ApiException as e: self._log.error("Couldn't read POD %s status!\n%s\n" % (self._name, e)) self._last_status = pod.status.phase return self._last_status def get_sriov_dev_mac(self): """Get assigned by k8s SRIOV network device plugin SRIOV VF devices. Return 0 in case of sucessfull configuration. Otherwise return -1. """ self._log.info("Checking assigned SRIOV VF for POD %s" % self._name) ret = self._ssh_client.run_cmd("cat /opt/k8s_sriov_device_plugin_envs") if ret != 0: self._log.error("Failed to check assigned SRIOV VF!" "Error %s" % self._ssh_client.get_error()) return -1 cmd_output = self._ssh_client.get_output().decode("utf-8").rstrip() self._log.debug("Environment variable %s" % cmd_output) # Parse environment variable cmd_output = cmd_output.split("=")[1] self._sriov_vf = cmd_output.split(",")[0] self._log.debug("Using first SRIOV VF %s" % self._sriov_vf) self._log.info("Getting MAC address for assigned SRIOV VF %s" % self._sriov_vf) self._ssh_client.run_cmd("sudo /home/centos/port_info -n 4 -w %s" % self._sriov_vf) if ret != 0: self._log.error("Failed to get MAC address!" "Error %s" % self._ssh_client.get_error()) return -1 # Parse MAC address cmd_output = self._ssh_client.get_output().decode("utf-8").rstrip() self._log.debug(cmd_output) cmd_output = cmd_output.splitlines() for line in cmd_output: if line.startswith("Port 0 MAC: "): self._sriov_vf_mac = line[12:] self._log.debug("MAC %s" % self._sriov_vf_mac) def set_dp_ip(self, dp_ip): self._dp_ip = dp_ip def set_id(self, pod_id): self._id = pod_id def set_nodeselector(self, hostname): """Set hostname on which POD will be executed. """ self._nodeSelector_hostname = hostname def set_ssh_credentials(self, user, rsa_private_key): """Set SSH credentials for the SSH connection to the POD. """ self.update_admin_ip() self._ssh_client.set_credentials(ip = self._admin_ip, user = user, rsa_private_key = rsa_private_key)