summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/Dockerfile.aarch64.patch2
-rwxr-xr-xtests/ci/load_images.sh2
-rw-r--r--yardstick/benchmark/core/task.py6
-rw-r--r--yardstick/tests/unit/benchmark/core/test_task.py28
4 files changed, 34 insertions, 4 deletions
diff --git a/docker/Dockerfile.aarch64.patch b/docker/Dockerfile.aarch64.patch
index 24e3952fb..a2243293c 100644
--- a/docker/Dockerfile.aarch64.patch
+++ b/docker/Dockerfile.aarch64.patch
@@ -39,7 +39,7 @@ index 2ee5b4c..23e5ea5 100644
+RUN apt-get update && apt-get install -y git python-setuptools python-pip && apt-get -y autoremove && \
+ apt-get install -y libssl-dev && apt-get -y install libffi-dev && apt-get clean
RUN easy_install -U setuptools==30.0.0
- RUN pip install appdirs==1.4.0 pyopenssl==17.5.0 python-openstackclient==3.11.0
+ RUN pip install appdirs==1.4.0 pyopenssl==17.5.0 python-openstackclient==3.11.0 python-heatclient==1.11.0
@@ -43,8 +44,8 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf
diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh
index d723823ee..5df769c0d 100755
--- a/tests/ci/load_images.sh
+++ b/tests/ci/load_images.sh
@@ -251,7 +251,7 @@ main()
load_yardstick_image
if [ "${YARD_IMG_ARCH}" == "arm64" ]; then
#We have overlapping IP with the real network
- for filename in tests/opnfv/test_cases/*; do
+ for filename in ${YARDSTICK_REPO_DIR}/tests/opnfv/test_cases/*; do
sed -i "s/cidr: '10.0.1.0\/24'/cidr: '10.3.1.0\/24'/g" "${filename}"
done
else
diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py
index e7acde696..4272a6db9 100644
--- a/yardstick/benchmark/core/task.py
+++ b/yardstick/benchmark/core/task.py
@@ -344,7 +344,8 @@ class Task(object): # pragma: no cover
# TODO support get multi hosts/vms info
context_cfg = {}
- server_name = scenario_cfg.get('options', {}).get('server_name', {})
+ options = scenario_cfg.get('options') or {}
+ server_name = options.get('server_name') or {}
def config_context_target(cfg):
target = cfg['target']
@@ -627,7 +628,8 @@ class TaskParser(object): # pragma: no cover
scenario['host'] = qualified_name(scenario['host'])
if 'target' in scenario:
scenario['target'] = qualified_name(scenario['target'])
- server_name = scenario.get('options', {}).get('server_name', {})
+ options = scenario.get('options') or {}
+ server_name = options.get('server_name') or {}
if 'host' in server_name:
server_name['host'] = qualified_name(server_name['host'])
if 'target' in server_name:
diff --git a/yardstick/tests/unit/benchmark/core/test_task.py b/yardstick/tests/unit/benchmark/core/test_task.py
index 1ce30eacb..9e8e4e9f7 100644
--- a/yardstick/tests/unit/benchmark/core/test_task.py
+++ b/yardstick/tests/unit/benchmark/core/test_task.py
@@ -421,6 +421,34 @@ key2:
self.parser._change_node_names(scenario, [my_context])
self.assertEqual(scenario, expected_scenario)
+ def test__change_node_names_options_empty(self):
+ ctx_attrs = {
+ 'name': 'demo',
+ 'task_id': '1234567890'
+ }
+
+ my_context = dummy.DummyContext()
+ my_context.init(ctx_attrs)
+ scenario = copy.deepcopy(self.scenario)
+ scenario['options'] = None
+
+ self.parser._change_node_names(scenario, [my_context])
+ self.assertIsNone(scenario['options'])
+
+ def test__change_node_names_options_server_name_empty(self):
+ ctx_attrs = {
+ 'name': 'demo',
+ 'task_id': '1234567890'
+ }
+
+ my_context = dummy.DummyContext()
+ my_context.init(ctx_attrs)
+ scenario = copy.deepcopy(self.scenario)
+ scenario['options']['server_name'] = None
+
+ self.parser._change_node_names(scenario, [my_context])
+ self.assertIsNone(scenario['options']['server_name'])
+
def test__parse_tasks(self):
task_obj = task.Task()
_uuid = uuid.uuid4()