Merge "Yardstick Gambia 7.1.0 release notes"
authorRex Lee <limingjiang@huawei.com>
Sat, 15 Dec 2018 04:49:57 +0000 (04:49 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Sat, 15 Dec 2018 04:49:57 +0000 (04:49 +0000)
ansible/build_yardstick_image.yml
ansible/roles/install_dependencies_jumphost/tasks/Debian.yml
ansible/roles/install_dpdk/tasks/Debian.yml
yardstick/benchmark/runners/iteration.py
yardstick/tests/unit/benchmark/runner/test_iteration.py [new file with mode: 0644]

index 072c12c..495a547 100644 (file)
       'amd64': disk1
       'arm64': uefi1
     boot_mode: "{{ boot_modes[YARD_IMG_ARCH] }}"
-    image_filename: "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"
-    image_path: "{{ release }}/current/{{ image_filename }}"
+    image_filename:
+      'xenial': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img"
+      'bionic': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}.img"
+    image_path: "{{ release }}/current/{{ image_filename[release] }}"
     host: "{{ lookup('env', 'HOST')|default('cloud-images.ubuntu.com', true)}}"
     image_url: "{{ lookup('env', 'IMAGE_URL')|default('https://' ~ host ~ '/' ~ image_path, true) }}"
-    image_dest: "{{ workspace }}/{{ image_filename }}"
+    image_dest: "{{ workspace }}/{{ image_filename[release] }}"
     sha256sums_path: "{{ release }}/current/SHA256SUMS"
     sha256sums_filename: "{{ sha256sums_path|basename }}"
     sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}"
index 419f81b..6c3900d 100755 (executable)
   apt:
     update_cache: yes
 
+- name: Install dependency for Ubuntu 18
+  action: "{{ ansible_pkg_mgr }} name=libssl1.0-dev state=present"
+  when:
+    - ansible_distribution == 'Ubuntu'
+    - ansible_distribution_major_version|int >= 17
+
 - name: Install core packages
   action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
   with_items:
index 4f0c3c8..b76a0fb 100755 (executable)
@@ -17,6 +17,7 @@
   with_items:
     - libpcap-dev
     - pciutils
+    - libelf-dev
 
 - name: Install kernel headers
   action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present"
index 4c88f36..58ab06a 100644 (file)
@@ -96,6 +96,7 @@ def _worker_process(queue, cls, method_name, scenario_cfg,
             except Exception:  # pylint: disable=broad-except
                 errors = traceback.format_exc()
                 LOG.exception("")
+                raise
             else:
                 if result:
                     # add timeout for put so we don't block test
diff --git a/yardstick/tests/unit/benchmark/runner/test_iteration.py b/yardstick/tests/unit/benchmark/runner/test_iteration.py
new file mode 100644 (file)
index 0000000..783b236
--- /dev/null
@@ -0,0 +1,45 @@
+##############################################################################
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd 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
+##############################################################################
+
+import mock
+import unittest
+import multiprocessing
+from yardstick.benchmark.runners import iteration
+from yardstick.common import exceptions as y_exc
+
+
+class IterationRunnerTest(unittest.TestCase):
+    def setUp(self):
+        self.scenario_cfg = {
+            'runner': {'interval': 0, "duration": 0},
+            'type': 'some_type'
+        }
+
+        self.benchmark = mock.Mock()
+        self.benchmark_cls = mock.Mock(return_value=self.benchmark)
+
+    def _assert_defaults__worker_run_setup_and_teardown(self):
+        self.benchmark_cls.assert_called_once_with(self.scenario_cfg, {})
+        self.benchmark.setup.assert_called_once()
+
+    def _assert_defaults__worker_run_one_iteration(self):
+        self.benchmark.pre_run_wait_time.assert_called_once_with(0)
+        self.benchmark.my_method.assert_called_once_with({})
+
+    def test__worker_process_broad_exception(self):
+        self.benchmark.my_method = mock.Mock(
+            side_effect=y_exc.YardstickException)
+
+        with self.assertRaises(Exception):
+            iteration._worker_process(mock.Mock(), self.benchmark_cls, 'my_method',
+                                 self.scenario_cfg, {},
+                                 multiprocessing.Event(), mock.Mock())
+
+        self._assert_defaults__worker_run_one_iteration()
+        self._assert_defaults__worker_run_setup_and_teardown()