aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-10-13 06:36:42 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-13 06:36:42 +0000
commit4f8b511428cf31f8a74ffab9b9e662e7a05a8a76 (patch)
tree0416690d8692893e392a97054238cd3ff061a36e /yardstick
parent5701fc19e9075115ca1be69626c0b3a618f6ae99 (diff)
parent58d6bbdfaa9d2200323e6d93242ad649b4c3243e (diff)
Merge "Move arp route tbl to script and update defailt vnf config files"
Diffstat (limited to 'yardstick')
-rw-r--r--yardstick/network_services/helpers/samplevnf_helper.py24
-rw-r--r--yardstick/network_services/vnf_generic/vnf/sample_vnf.py3
2 files changed, 14 insertions, 13 deletions
diff --git a/yardstick/network_services/helpers/samplevnf_helper.py b/yardstick/network_services/helpers/samplevnf_helper.py
index 0174d9c0d..4718bbd59 100644
--- a/yardstick/network_services/helpers/samplevnf_helper.py
+++ b/yardstick/network_services/helpers/samplevnf_helper.py
@@ -55,6 +55,10 @@ SCRIPT_TPL = """
{arp_config6}
+{arp_route_tbl}
+
+{arp_route_tbl6}
+
{actions}
{rules}
@@ -345,30 +349,28 @@ class MultiPortConfig(object):
"".join(("{},".format(port_list.index(x)) for x in uplink_ports)))
def generate_arp_route_tbl(self):
- arp_route_tbl_tmpl = "({port0_dst_ip_hex},{port0_netmask_hex},{port_num}," \
- "{next_hop_ip_hex})"
+ arp_route_tbl_tmpl = "routeadd net {port_num} {port_dst_ip} 0x{port_netmask_hex}"
def build_arp_config(port):
dpdk_port_num = self.vnfd_helper.port_num(port)
interface = self.vnfd_helper.find_interface(name=port)["virtual-interface"]
# We must use the dst because we are on the VNF and we need to
# reach the TG.
- dst_port0_ip = ipaddress.ip_interface(six.text_type(
+ dst_port_ip = ipaddress.ip_interface(six.text_type(
"%s/%s" % (interface["dst_ip"], interface["netmask"])))
arp_vars = {
- "port0_dst_ip_hex": ip_to_hex(dst_port0_ip.network.network_address.exploded),
- "port0_netmask_hex": ip_to_hex(dst_port0_ip.network.netmask.exploded),
+ "port_netmask_hex": ip_to_hex(dst_port_ip.network.netmask.exploded),
# this is the port num that contains port0 subnet and next_hop_ip_hex
# this is LINKID which should be based on DPDK port number
"port_num": dpdk_port_num,
# next hop is dst in this case
# must be within subnet
- "next_hop_ip_hex": ip_to_hex(dst_port0_ip.ip.exploded),
+ "port_dst_ip": str(dst_port_ip.ip),
}
return arp_route_tbl_tmpl.format(**arp_vars)
- return ' '.join(build_arp_config(port) for port in self.all_ports)
+ return '\n'.join(build_arp_config(port) for port in self.all_ports)
def generate_arpicmp_data(self):
swq_in_str = self.make_range_str('SWQ{}', self.swq, offset=self.lb_count)
@@ -391,11 +393,6 @@ class MultiPortConfig(object):
# 'ports_mac_list': ' '.join(mac_iter),
'pktq_in_prv': ' '.join(pktq_in_iter),
'prv_to_pub_map': self.set_priv_to_pub_mapping(),
- 'arp_route_tbl': self.generate_arp_route_tbl(),
- # nd_route_tbl must be set or we get segault on random OpenStack IPv6 traffic
- # 'nd_route_tbl': "(0064:ff9b:0:0:0:0:9810:6414,120,0,0064:ff9b:0:0:0:0:9810:6414)"
- # safe default? route discard prefix to localhost
- 'nd_route_tbl': "(0100::,64,0,::1)"
}
self.pktq_out_os = swq_out_str.split(' ')
# HWLB is a run to complition. So override the pktq_in/pktq_out
@@ -710,6 +707,9 @@ class MultiPortConfig(object):
# disable IPv6 for now
# 'arp_config6': self.generate_arp_config6(),
'arp_config6': "",
+ 'arp_config': self.generate_arp_config(),
+ 'arp_route_tbl': self.generate_arp_route_tbl(),
+ 'arp_route_tbl6': "",
'actions': '',
'rules': '',
}
diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
index 92f78c2bc..06f259685 100644
--- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
+++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
@@ -685,6 +685,7 @@ class SampleVNF(GenericVNF):
VNF_PROMPT = "pipeline>"
WAIT_TIME = 1
+ WAIT_TIME_FOR_SCRIPT = 10
APP_NAME = "SampleVNF"
# we run the VNF interactively, so the ssh command will timeout after this long
@@ -811,7 +812,7 @@ class SampleVNF(GenericVNF):
self.APP_NAME)
LOG.info("Waiting for %s VNF to start.. ", self.APP_NAME)
- time.sleep(1)
+ time.sleep(self.WAIT_TIME_FOR_SCRIPT)
# Send ENTER to display a new prompt in case the prompt text was corrupted
# by other VNF output
self.q_in.put('\r\n')