Bugfix: Get private ip wrong in iperf vm test. 17/22417/1
authorzhifeng.jiang <jiang.zhifeng@zte.com.cn>
Sun, 25 Sep 2016 03:18:53 +0000 (11:18 +0800)
committerzhifeng.jiang <jiang.zhifeng@zte.com.cn>
Sun, 25 Sep 2016 03:18:53 +0000 (11:18 +0800)
Change-Id: I92c937eaadf5adfa4a8eced5b95af26612d7c523
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
func/driver.py
tests/driver_test.py

index 88d673f..bcda0ce 100644 (file)
@@ -49,7 +49,7 @@ class Driver:
     def get_special_var_json(self, role, roles, benchmark_detail, pip_dict):
         special_json = {}
         index = roles.index(role) + 1
-        private_ip = pip_dict[0][1][0] if pip_dict[0][1][0] else 'NONE'
+        private_ip = pip_dict[0][1] 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])\
index 9162ca1..83c69c8 100644 (file)
@@ -35,13 +35,13 @@ class TestClass:
           [('1-server', ['10.20.0.13']), ('2-host', ['10.20.0.15'])],
           "iperf_vm.yaml",
           [('duration', 20), ('protocol', 'tcp'), ('bandwidthGbps', 0)],
-          [("10.20.0.13", [None]), ("10.20.0.15", [None])],
+          [('1-server', '10.10.17.4'), ('2-host', '10.10.17.5')],
           {}],
          [{'Dest_dir': 'results',
            'ip1': '10.20.0.13',
            'ip2': '',
            'installer': 'joid',
-           'privateip1': 'NONE',
+           'privateip1': '10.10.17.4',
            'workingdir': '/home',
            'fname': 'iperf_vm.yaml',
            'username': 'ubuntu',
@@ -53,7 +53,7 @@ class TestClass:
            'ip1': '10.20.0.13',
            'ip2': '',
            'installer': 'joid',
-           'privateip1': 'NONE',
+           'privateip1': '10.10.17.4',
            'workingdir': '/home',
            'fname': 'iperf_vm.yaml',
            'username': 'ubuntu',