summaryrefslogtreecommitdiffstats
path: root/docs/testing/user/userguide/opnfv_yardstick_tc078.rst
blob: b5a6545ba5b34194d567d6ef6b4a90bcfd8c3f18 (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
127
128
129
130
131
132
133
134
.. 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 TC078
*************************************

.. _spec_cpu2006: https://www.spec.org/cpu2006/

+-----------------------------------------------------------------------------+
|Compute Performance                                                          |
|                                                                             |
+--------------+--------------------------------------------------------------+
|test case id  | OPNFV_YARDSTICK_TC078_SPEC CPU 2006                          |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|metric        | compute-intensive performance                                |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test purpose  | The purpose of TC078 is to evaluate the IaaS compute         |
|              | performance by using SPEC CPU 2006 benchmark. The SPEC CPU   |
|              | 2006 benchmark has several different ways to measure         |
|              | computer performance. One way is to measure how fast the     |
|              | computer completes a single task; this is called a speed     |
|              | measurement. Another way is to measure how many tasks        |
|              | computer can accomplish in a certain amount of time; this is |
|              | called a throughput, capacity or rate measurement.           |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test tool     | SPEC CPU 2006                                                |
|              |                                                              |
|              | The SPEC CPU 2006 benchmark is SPEC's industry-standardized, |
|              | CPU-intensive benchmark suite, stressing a system's          |
|              | processor, memory subsystem and compiler. This benchmark     |
|              | suite includes the SPECint benchmarks and the SPECfp         |
|              | benchmarks. The SPECint 2006 benchmark contains 12 different |
|              | enchmark tests and the SPECfp 2006 benchmark contains 19     |
|              | different benchmark tests.                                   |
|              |                                                              |
|              | SPEC CPU 2006 is not always part of a Linux distribution.    |
|              | SPEC requires that users purchase a license and agree with   |
|              | their terms and conditions. For this test case, users must   |
|              | manually download cpu2006-1.2.iso from the SPEC website and  |
|              | save it under the yardstick/resources folder (e.g. /home/    |
|              | opnfv/repos/yardstick/yardstick/resources/cpu2006-1.2.iso)   |
|              | SPEC CPU® 2006 benchmark is available for purchase via the   |
|              | SPEC order form (https://www.spec.org/order.html).           |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test          | This test case uses SPEC CPU 2006 benchmark to measure       |
|description   | compute-intensive performance of hosts.                      |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|configuration | file: spec_cpu.yaml (in the 'samples' directory)             |
|              |                                                              |
|              | benchmark_subset is set to int.                              |
|              |                                                              |
|              | SLA is not available in this test case.                      |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|applicability | Test can be configured with different:                       |
|              |                                                              |
|              |  * benchmark_subset - a subset of SPEC CPU2006 benchmarks to |
|              |    run;                                                      |
|              |  * SPECint_benchmark - a SPECint benchmark to run;           |
|              |  * SPECint_benchmark - a SPECfp benchmark to run;            |
|              |  * output_format - desired report format;                    |
|              |  * runspec_config - SPEC CPU2006 config file provided to the |
|              |    runspec binary;                                           |
|              |  * runspec_iterations - the number of benchmark iterations   |
|              |    to execute. For a reportable run, must be 3;              |
|              |  * runspec_tune - tuning to use (base, peak, or all). For a  |
|              |    reportable run, must be either base or all. Reportable    |
|              |    runs do base first, then (optionally) peak;               |
|              |  * runspec_size - size of input data to run (test, train, or |
|              |    ref). Reportable runs ensure that your binaries can       |
|              |    produce correct results with the test and train workloads |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|usability     | This test case is used for executing SPEC CPU 2006 benchmark |
|              | physical servers. The SPECint 2006 benchmark takes           |
|              | approximately 5 hours.                                       |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|references    | spec_cpu2006_                                                |
|              |                                                              |
|              | ETSI-NFV-TST001                                              |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|pre-test      | To run and install SPEC CPU2006, the following are required: |
|conditions    |  * For SPECint2006: Both C99 and C++98 compilers;            |
|              |  * For SPECfp2006: All three of C99, C++98 and Fortran-95    |
|              |    compilers;                                                |
|              |  * At least 8GB of disk space availabile on the system.      |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test sequence | description and expected result                              |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 1        | cpu2006-1.2.iso has been saved under the yardstick/resources |
|              | folder (e.g. /home/opnfv/repos/yardstick/yardstick/resources |
|              | /cpu2006-1.2.iso). Additional, to use your custom runspec    |
|              | config file you can save it under the yardstick/resources/   |
|              | files folder and specify the config file name in the         |
|              | runspec_config parameter.                                    |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 2        | Upload SPEC CPU2006 ISO to the target server and install     |
|              | SPEC CPU2006 via ansible.                                    |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 3        | Yardstick is connected with the target server by using ssh.  |
|              | If custom runspec config file is used, this file is copyied  |
|              | from yardstick to the target server via the ssh tunnel.      |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 4        | SPEC CPU2006 benchmark is invoked and SPEC CPU 2006 metrics  |
|              | are generated.                                               |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 5        | Text, HTML, CSV, PDF, and Configuration file outputs for the |
|              | SPEC CPU 2006 metrics are fetch from the server and stored   |
|              | under /tmp/result folder.                                    |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|step 6        | uninstall SPEC CPU2006 and remove cpu2006-1.2.iso from the   |
|              | target server .                                              |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test verdict  | None. SPEC CPU2006 results are collected and stored.         |
|              |                                                              |
+--------------+--------------------------------------------------------------+
/span>}.img fi mkdir -p /mnt/${release} mount /tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.img /mnt/${release} cp -r /mnt/${release}/lib/modules/$(echo $CLOUD_KERNEL_VERSION) /tmp/${release}-modules umount /mnt/${release} rm /tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.img cd $workspace fi qemu-img convert $filename $raw_imgfile cd - } # mount image setup() { # qemu-img resize $raw_imgfile +5GB if [ "${YARD_IMG_ARCH}" = "arm64" ]; then echo -e "d\nn\np\n1\n\n\nw" | parted -l $raw_imgfile fi mkdir -p $mountdir #kpartx fails with image paths longer than 63 characters #try shortest relative path to image as temporary workaround cd ${workspace} loopdevice=$(kpartx -l $raw_imgfile_basename | head -1 | cut -f1 -d ' ') kpartx -av $raw_imgfile_basename cd - if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then e2fsck -p -f /dev/mapper/$loopdevice resize2fs /dev/mapper/$loopdevice fi # for trouble shooting sleep 2 dmsetup ls parted -l /dev/${loopdevice:0:5} || true mount /dev/mapper/$loopdevice $mountdir mount -t proc none $mountdir/proc if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then cp -r /tmp/${release}-modules/$(echo $CLOUD_KERNEL_VERSION) "$mountdir/lib/modules" cp $(which "qemu-aarch64-static") "$mountdir/usr/bin" fi cp $cmd $mountdir/$(basename $cmd) } # modify image running a script using in a chrooted environment modify() { # resolv.conf does not exist in base image, pass nameserver value from host nameserver_ip=$(grep -m 1 '^nameserver' \ /etc/resolv.conf | awk '{ print $2 '}) # prevent init scripts from running during install echo $'#!/bin/sh\nexit 101' >$mountdir/usr/sbin/policy-rc.d chmod a+x $mountdir/usr/sbin/policy-rc.d chroot $mountdir /$(basename $cmd) $nameserver_ip rm -rf $mountdir/usr/sbin/policy-rc.d umount -f $mountdir/proc umount $mountdir qemu-img convert -c -o compat=0.10 -O qcow2 $raw_imgfile $imgfile if dmsetup table | grep $loopdevice; then dmsetup clear $loopdevice || true fi } # cleanup (umount) the image cleanup() { # designed to be idempotent mount | grep $mountdir/proc && umount $mountdir/proc mount | grep $mountdir && umount $mountdir mount | grep "/mnt/${release}" && umount "/mnt/${release}" if [ -f "${raw_imgfile}" ]; then #kpartx -dv $raw_imgfile sometimes failed, we should checked it agein. #if [ -z "$(kpartx -l $raw_imgfile | grep 'loop deleted')" ]; then # kpartx -dv $raw_imgfile #fi kpartx -dv $raw_imgfile || true fi rm -f $raw_imgfile rm -rf $mountdir } exitcode="" error_trap() { local rc=$? set +e if [ -z "$exitcode" ]; then exitcode=$rc fi dmesg -T | tail -50 cleanup echo "Image build failed with $exitcode" exit $exitcode } main() { cleanup trap "error_trap" EXIT SIGTERM download setup modify trap - EXIT SIGTERM cleanup echo "the modified image is found here: $imgfile" } main