aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ansible/build_yardstick_image.yml16
-rw-r--r--ansible/group_vars/all.yml7
-rwxr-xr-xtests/ci/load_images.sh5
-rw-r--r--tests/unit/test_cmd/__init__.py (renamed from tests/unit/cmd/__init__.py)0
-rw-r--r--tests/unit/test_cmd/commands/__init__.py (renamed from tests/unit/cmd/commands/__init__.py)0
-rw-r--r--tests/unit/test_cmd/commands/test_env.py (renamed from tests/unit/cmd/commands/test_env.py)6
-rw-r--r--tests/unit/test_cmd/commands/test_testcase.py (renamed from tests/unit/cmd/commands/test_testcase.py)0
-rw-r--r--tests/unit/test_cmd/test_NSBperf.py (renamed from tests/unit/cmd/test_NSBperf.py)3
8 files changed, 26 insertions, 11 deletions
diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml
index 45ef94e98..7f709873e 100644
--- a/ansible/build_yardstick_image.yml
+++ b/ansible/build_yardstick_image.yml
@@ -41,7 +41,12 @@
- package: name=parted state=present
- set_fact:
- imgfile: "{{ workspace }}/yardstick-image.img"
+ imgfile: "{{ normal_image_file }}"
+ when: img_property == "normal"
+
+ - set_fact:
+ imgfile: "{{ nsb_image_file }}"
+ when: img_property == "nsb"
- set_fact:
mountdir: "{{ lookup('env', 'mountdir')|default('/mnt/yardstick', true) }}"
@@ -197,8 +202,13 @@
nameserver_ip: "{{ ansible_dns.nameservers[0] }}"
image_type: vm
-- name: include {{ img_modify_playbook }}
- include: "{{ img_modify_playbook }}"
+- name: include ubuntu_server_cloudimg_modify.yml
+ include: ubuntu_server_cloudimg_modify.yml
+ when: img_property == "normal"
+
+- name: include ubuntu_server_cloudimg_modify_samplevnfs.yml
+ include: ubuntu_server_cloudimg_modify_samplevnfs.yml
+ when: img_property == "nsb"
- hosts: localhost
tasks:
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index edd6564d0..359968277 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -1,6 +1,9 @@
---
+target_os: "Ubuntu"
+YARD_IMG_ARCH: "amd64"
clone_dest: /opt/tempT
release: xenial
-target_os: Ubuntu
+normal_image_file: "{{ workspace }}/yardstick-image.img"
+nsb_image_file: "{{ workspace }}/yardstick-nsb-image.img"
ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw
-proxy_env: {} \ No newline at end of file
+proxy_env: {}
diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh
index 666a78b40..80caf07ae 100755
--- a/tests/ci/load_images.sh
+++ b/tests/ci/load_images.sh
@@ -66,10 +66,7 @@ build_yardstick_image()
ANSIBLE_SCRIPTS="${0%/*}/../../ansible"
cd ${ANSIBLE_SCRIPTS} &&\
ansible-playbook \
- -e img_modify_playbook='ubuntu_server_cloudimg_modify.yml' \
- -e target_os='Ubuntu' \
- -e YARD_IMG_ARCH='amd64' \
- -e ubuntu_img_file="${QCOW_IMAGE}" \
+ -e img_property="normal" \
-vvv -i inventory.ini build_yardstick_image.yml
if [ ! -f "${QCOW_IMAGE}" ]; then
diff --git a/tests/unit/cmd/__init__.py b/tests/unit/test_cmd/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/unit/cmd/__init__.py
+++ b/tests/unit/test_cmd/__init__.py
diff --git a/tests/unit/cmd/commands/__init__.py b/tests/unit/test_cmd/commands/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/unit/cmd/commands/__init__.py
+++ b/tests/unit/test_cmd/commands/__init__.py
diff --git a/tests/unit/cmd/commands/test_env.py b/tests/unit/test_cmd/commands/test_env.py
index 73cd5af47..13c3ed44a 100644
--- a/tests/unit/cmd/commands/test_env.py
+++ b/tests/unit/test_cmd/commands/test_env.py
@@ -49,6 +49,9 @@ class EnvCommandTestCase(unittest.TestCase):
@mock.patch('yardstick.cmd.commands.env.HttpClient.get')
@mock.patch('yardstick.cmd.commands.env.EnvCommand._print_status')
def test_check_status(self, print_mock, get_mock):
+ # pylint: disable=unused-argument
+ # NOTE(ralonsoh): the pylint exception must be removed. The mocked
+ # command call must be tested.
task_id = str(uuid.uuid4())
get_mock.return_value = {'status': 2, 'result': 'error'}
status = EnvCommand()._check_status(task_id, 'hello world')
@@ -57,7 +60,8 @@ class EnvCommandTestCase(unittest.TestCase):
def test_print_status(self):
try:
EnvCommand()._print_status('hello', 'word')
- except Exception as e:
+ except Exception as e: # pylint: disable=broad-except
+ # NOTE(ralonsoh): try to reduce the scope of this exception.
self.assertIsInstance(e, IndexError)
diff --git a/tests/unit/cmd/commands/test_testcase.py b/tests/unit/test_cmd/commands/test_testcase.py
index 7ef157c19..7ef157c19 100644
--- a/tests/unit/cmd/commands/test_testcase.py
+++ b/tests/unit/test_cmd/commands/test_testcase.py
diff --git a/tests/unit/cmd/test_NSBperf.py b/tests/unit/test_cmd/test_NSBperf.py
index e1b4da7fc..19eb0afa0 100644
--- a/tests/unit/cmd/test_NSBperf.py
+++ b/tests/unit/test_cmd/test_NSBperf.py
@@ -27,7 +27,8 @@ from yardstick.cmd import NSBperf
@mock.patch('six.moves.input', return_value='0')
class TestHandler(unittest.TestCase):
- def test_handler(self, test):
+
+ def test_handler(self, *args):
subprocess.call = mock.Mock(return_value=0)
self.assertRaises(SystemExit, NSBperf.sigint_handler)