summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--benchmarks/playbooks/dhrystone.yaml6
-rw-r--r--benchmarks/playbooks/dpi.yaml4
-rw-r--r--benchmarks/playbooks/whetstone.yaml6
-rw-r--r--func/driver.py8
-rw-r--r--func/env_setup.py2
-rw-r--r--tests/driver_test.py11
-rw-r--r--tests/output/hosts2
7 files changed, 14 insertions, 25 deletions
diff --git a/benchmarks/playbooks/dhrystone.yaml b/benchmarks/playbooks/dhrystone.yaml
index d4fe07ea..8fe6a490 100644
--- a/benchmarks/playbooks/dhrystone.yaml
+++ b/benchmarks/playbooks/dhrystone.yaml
@@ -50,12 +50,6 @@
- name: make
shell: sudo make --directory $HOME/tempT/UnixBench/
- - name: downloading_patch
- shell: cd $HOME/tempT/UnixBench/ && sudo wget https://www.dropbox.com/s/11z85gfu0trkhus/fix-limitation.patch
-
- - name: applying_patch
- shell: cd $HOME/tempT/UnixBench/ && sudo patch Run fix-limitation.patch
-
- name: Run dhrystone
shell: cd $HOME/tempT/UnixBench/&& sudo ./Run -v dhrystone
diff --git a/benchmarks/playbooks/dpi.yaml b/benchmarks/playbooks/dpi.yaml
index 6dae0869..46e065a1 100644
--- a/benchmarks/playbooks/dpi.yaml
+++ b/benchmarks/playbooks/dpi.yaml
@@ -51,7 +51,7 @@
- name: Clone nDPI
git: repo=https://github.com/ntop/nDPI.git
- dest=$HOME/tempD
+ dest=$HOME/tempD/nDPI
- name: autogen
shell: cd $HOME/tempD/nDPI && sudo ./autogen.sh
@@ -63,7 +63,7 @@
shell: cd $HOME/tempD/nDPI && sudo make
- name: Fetching Test_pcap file
- shell: cd $HOME/tempD/nDPI/example && wget http://artifacts.opnfv.org/qtip/utilities/test.pcap
+ shell: cd $HOME/tempD/nDPI/example && wget http://build.opnfv.org/artifacts.opnfv.org/qtip/utilities/test.pcap
- name: fetch Averaging script
copy: src=./result_transform/dpi/dpi_average.sh dest={{home_dir.stdout}}/tempD/nDPI/example mode=777
diff --git a/benchmarks/playbooks/whetstone.yaml b/benchmarks/playbooks/whetstone.yaml
index 98280e6a..0b1f89a7 100644
--- a/benchmarks/playbooks/whetstone.yaml
+++ b/benchmarks/playbooks/whetstone.yaml
@@ -50,12 +50,6 @@
- name: make
shell: sudo make --directory $HOME/tempT/UnixBench/
- - name: downloading_patch
- shell: cd $HOME/tempT/UnixBench/ && sudo wget https://www.dropbox.com/s/11z85gfu0trkhus/fix-limitation.patch
-
- - name: applying_patch
- shell: cd $HOME/tempT/UnixBench/ && sudo patch Run fix-limitation.patch
-
- name: Run Whetstone
shell: cd $HOME/tempT/UnixBench/&&./Run -v whetstone
diff --git a/func/driver.py b/func/driver.py
index 859e7f34..726016a5 100644
--- a/func/driver.py
+++ b/func/driver.py
@@ -45,12 +45,16 @@ class Driver:
def get_special_var_json(self, role, roles, benchmark_detail, pip_dict):
special_json = {}
index = roles.index(role) + 1
- special_json.update({'role': role[0]})
- private_ip = pip_dict[0][1] if pip_dict[0][1][0] else 'NONE'
+ private_ip = pip_dict[0][1][0] if pip_dict[0][1][0] else 'NONE'
map(lambda x: special_json.update({'ip' + str(index): x}), role[1])\
if benchmark_detail and (role[0] == '1-server') else None
map(lambda x: special_json.update({'privateip' + str(index): private_ip}), role[1])\
if benchmark_detail and (role[0] == '1-server') else None
+ special_json = self.get_special_var_json(filter(lambda x: x[0] == '1-server', roles)[0],
+ roles,
+ benchmark_detail,
+ pip_dict) if role[0] == '2-host' else special_json
+ special_json.update({'role': role[0]})
return special_json
def run_ansible_playbook(self, benchmark, extra_vars):
diff --git a/func/env_setup.py b/func/env_setup.py
index f6b1d43b..96f984cb 100644
--- a/func/env_setup.py
+++ b/func/env_setup.py
@@ -54,8 +54,6 @@ class Env_setup:
num = len(role[k])
for x in range(num):
f_name_2.write(role[k][x] + '\n')
- f_name_2.write('[localhost]\n')
- f_name_2.write('127.0.0.1\n')
f_name_2.close()
@staticmethod
diff --git a/tests/driver_test.py b/tests/driver_test.py
index 71f01b0e..9162ca16 100644
--- a/tests/driver_test.py
+++ b/tests/driver_test.py
@@ -41,7 +41,7 @@ class TestClass:
'ip1': '10.20.0.13',
'ip2': '',
'installer': 'joid',
- "privateip1": "NONE",
+ 'privateip1': 'NONE',
'workingdir': '/home',
'fname': 'iperf_vm.yaml',
'username': 'ubuntu',
@@ -50,9 +50,10 @@ class TestClass:
'bandwidthGbps': 0,
"role": "1-server"},
{'Dest_dir': 'results',
- 'ip1': '',
+ 'ip1': '10.20.0.13',
'ip2': '',
'installer': 'joid',
+ 'privateip1': 'NONE',
'workingdir': '/home',
'fname': 'iperf_vm.yaml',
'username': 'ubuntu',
@@ -61,13 +62,13 @@ class TestClass:
'bandwidthGbps': 0,
"role": "2-host"}])
])
- @mock.patch('func.driver.AnsibleApi')
+ @mock.patch('func.driver.AnsibleApi.execute_playbook')
def test_driver_success(self, mock_ansible, test_input, expected):
- mock_ansible.execute_playbook.return_value = True
+ mock_ansible.return_value = True
dri = Driver()
dri.drive_bench(test_input[0], test_input[1], test_input[2], test_input[3],
test_input[4], test_input[5], test_input[6], test_input[7])
- call_list = mock_ansible.execute_playbook.call_args_list
+ call_list = mock_ansible.call_args_list
for call in call_list:
call_args, call_kwargs = call
real_call = call_args[3]
diff --git a/tests/output/hosts b/tests/output/hosts
index b380e475..9b47df0e 100644
--- a/tests/output/hosts
+++ b/tests/output/hosts
@@ -1,5 +1,3 @@
[host]
10.20.0.29
10.20.0.28
-[localhost]
-127.0.0.1