diff options
9 files changed, 21 insertions, 143 deletions
diff --git a/samples/vnf_samples/nsut/acl/acl.cfg b/samples/vnf_samples/nsut/acl/acl.cfg index fd3c51ee8..06da405db 100644 --- a/samples/vnf_samples/nsut/acl/acl.cfg +++ b/samples/vnf_samples/nsut/acl/acl.cfg @@ -20,8 +20,6 @@ type = ARPICMP core = 1 pktq_in = SWQ4 pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0 -arp_route_tbl = (c0102814,fffff000,1,c0102814) (c0106414,fffff000,0,c0106414) -nd_route_tbl = (0064:ff9b:0:0:0:0:9810:6414,120,0,0064:ff9b:0:0:0:0:9810:6414) pktq_in_prv = RXQ0.0 prv_to_pub_map = (0,1) [PIPELINE2] diff --git a/samples/vnf_samples/nsut/acl/acl_config/acl_config b/samples/vnf_samples/nsut/acl/acl_config/acl_config deleted file mode 100644 index 52b6a5002..000000000 --- a/samples/vnf_samples/nsut/acl/acl_config/acl_config +++ /dev/null @@ -1,61 +0,0 @@ -; Copyright (c) 2017 Intel Corporation -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http:#www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. - -[PIPELINE0] -type = MASTER -core = s{socket}c0 -[PIPELINE1] -type = ARPICMP -core = s{socket}c1 -pktq_in = SWQ2 -pktq_out = SWQ7 -# debug output -# ({port1_dst_ip},{port1_netmask},1,{port1_dst_ip}) ({port0_dst_ip},{port0_netmask},0,{port0_dst_ip}) -arp_route_tbl = ({port0_dst_ip_hex},{port0_netmask_hex},0,{port0_dst_ip_hex}) ({port1_dst_ip_hex},{port1_netmask_hex},1,{port1_dst_ip_hex}) -#ports_mac_list = port0_local_mac port1_local_mac -ports_mac_list = {port0_local_mac} {port1_local_mac} -pktq_in_prv = RXQ0.0 RXQ1.0 -prv_to_pub_map = (0,1) -prv_que_handler = (0) - -[PIPELINE2] -type = TXRX -core = s{socket}c2 -pktq_in = RXQ0.0 RXQ1.0 -pktq_out = SWQ0 SWQ1 SWQ2 -pipeline_txrx_type = RXRX -dest_if_offset=176 -[PIPELINE3] -type = LOADB -core = s{socket}c3 -pktq_in = SWQ0 SWQ1 -pktq_out = SWQ3 SWQ4 -outport_offset = 136 -phyport_offset = 204 -n_vnf_threads = 1 -prv_que_handler = (0) -[PIPELINE4] -type = ACL -core = s{socket}c4 -pktq_in = SWQ3 SWQ4 -pktq_out = SWQ5 SWQ6 -n_flows = 1000000 -pkt_type = ipv4 -traffic_type = 4 -[PIPELINE5] -type = TXRX -core = s{socket}c5 -pktq_in = SWQ5 SWQ6 SWQ7 -pktq_out = TXQ0.0 TXQ1.0 -pipeline_txrx_type = TXTX diff --git a/samples/vnf_samples/nsut/acl/acl_config/acl_script b/samples/vnf_samples/nsut/acl/acl_config/acl_script deleted file mode 100644 index 4d7553609..000000000 --- a/samples/vnf_samples/nsut/acl/acl_config/acl_script +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (c) 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License")# -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -link 0 down -link 0 config {port0_local_ip} {port0_prefixlen} -link 0 up -link 1 down -link 1 config {port1_local_ip} {port1_prefixlen} -link 1 up - -p action add 0 accept -p action add 0 fwd 0 -p action add 0 count - -p action add 1 accept -p action add 1 fwd 1 -p action add 1 count - -#p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 0 -#p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 1 - -# action rule matches dest port -p acl add 1 {port1_local_network} {port1_prefix} 0.0.0.0 0 0 65535 0 65535 0 0 0 -p acl add 1 0.0.0.0 0 {port1_local_network} {port1_prefix} 0 65535 0 65535 0 0 1 - -p acl add 1 {port0_local_network} {port0_prefix} 0.0.0.0 0 0 65535 0 65535 0 0 1 -p acl add 1 0.0.0.0 0 {port0_local_network} {port0_prefix} 0 65535 0 65535 0 0 0 - -p acl add 1 {port0_local_network} {port0_prefix} {port1_local_network} {port1_prefix} 0 65535 0 65535 0 0 1 -p acl add 1 {port1_local_network} {port1_prefix} {port0_local_network} {port0_prefix} 0 65535 0 65535 0 0 0 - -# gateway is the remote port -p 1 arpadd 0 {port0_gateway} {port0_local_mac} -p 1 arpadd 0 {port0_local_ip} {port0_local_mac} -p 1 arpadd 0 {port0_dst_ip} {port0_dst_mac} -p 1 arpadd 1 {port1_gateway} {port1_local_mac} -p 1 arpadd 1 {port1_local_ip} {port1_local_mac} -p 1 arpadd 1 {port1_dst_ip} {port1_dst_mac} - -p acl applyruleset - -#p acl dbg 1 diff --git a/samples/vnf_samples/nsut/cgnapt/cgnat.cfg b/samples/vnf_samples/nsut/cgnapt/cgnat.cfg index 37c5e2731..27169f8dc 100644 --- a/samples/vnf_samples/nsut/cgnapt/cgnat.cfg +++ b/samples/vnf_samples/nsut/cgnapt/cgnat.cfg @@ -21,15 +21,7 @@ core = 1 pktq_in = SWQ4 pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0 -; ARP route table entries (ip, mask, if_port, nh) hex values with no 0x -arp_route_tbl = (c0102814,fffff000,1,c0102814) (c0106414,fffff000,0,c0106414) -;arp_route_tbl = (c0122814,fffff000,3,c0122814) (c0126414,fffff000,1,c0126414) -; Link MAC addresses in order aa:bb:cc:dd:ee:ff separated by space -nd_route_tbl = (0064:ff9b:0:0:0:0:9810:6414,120,0,0064:ff9b:0:0:0:0:9810:6414) -; -; Hex values with no leading 0x, MACs in ascending port order starting @P0 -;ports_mac_list = 00:05:CA:30:21:F0 00:05:CA:30:21:F1 ;00:05:CA:30:21:F2 00:05:CA:30:21:F3 -; + ; egress (private interface) info pktq_in_prv = RXQ0.0 ; @@ -72,7 +64,7 @@ key_size = 8 hash_offset = 200;72 ;cgnapt_debug = 2 ; -timer_period = 10000 +timer_period = 100 max_clients_per_ip = 65535 max_port_per_client = 100 public_ip_port_range = 04040000:(1, 65535) diff --git a/samples/vnf_samples/nsut/vfw/vfw.cfg b/samples/vnf_samples/nsut/vfw/vfw.cfg index 8bab8d047..c0b11419c 100644 --- a/samples/vnf_samples/nsut/vfw/vfw.cfg +++ b/samples/vnf_samples/nsut/vfw/vfw.cfg @@ -20,8 +20,6 @@ type = ARPICMP core = 1 pktq_in = SWQ4 pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0 -arp_route_tbl = (c0102814,fffff000,1,c0102814) (c0106414,fffff000,0,c0106414) -nd_route_tbl = (0064:ff9b:0:0:0:0:9810:6414,120,0,0064:ff9b:0:0:0:0:9810:6414) pktq_in_prv = RXQ0.0 prv_to_pub_map = (0,1) [PIPELINE2] diff --git a/tests/unit/network_services/helpers/test_samplevnf_helper.py b/tests/unit/network_services/helpers/test_samplevnf_helper.py index 0ac363f28..bff3a7722 100644 --- a/tests/unit/network_services/helpers/test_samplevnf_helper.py +++ b/tests/unit/network_services/helpers/test_samplevnf_helper.py @@ -211,6 +211,7 @@ class TestMultiPortConfig(unittest.TestCase): opnfv_vnf.generate_script_data = \ mock.Mock(return_value={'link_config': 0, 'arp_config': '', 'arp_config6': '', 'actions': '', + 'arp_route_tbl': '', 'arp_route_tbl6': '', 'rules': ''}) opnfv_vnf.port_pair_list = [("xe0", "xe1")] self.assertIsNotNone(opnfv_vnf.generate_script(self.VNFD)) @@ -823,8 +824,9 @@ class TestMultiPortConfig(unittest.TestCase): opnfv_vnf = MultiPortConfig(topology_file, config_tpl, tmp_file, vnfd_mock) opnfv_vnf.all_ports = [3, 2, 5] - expected = '(0a141000,fffff000,32,0a141e28) (0ac81e00,ffffff00,1,0ac81e28) ' \ - '(0a000000,ff000000,987,0a140328)' + expected = 'routeadd net 32 10.20.30.40 0xfffff000\n' \ + 'routeadd net 1 10.200.30.40 0xffffff00\n' \ + 'routeadd net 987 10.20.3.40 0xff000000' result = opnfv_vnf.generate_arp_route_tbl() self.assertEqual(result, expected) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py index 1e6bc1a13..c41da2c45 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py @@ -1886,6 +1886,7 @@ class TestSampleVnf(unittest.TestCase): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] sample_vnf = SampleVNF('vnf1', vnfd) sample_vnf.APP_NAME = 'sample1' + sample_vnf.WAIT_TIME_FOR_SCRIPT = 0 sample_vnf._start_server = mock.Mock(return_value=0) sample_vnf._vnf_process = mock.MagicMock() sample_vnf._vnf_process.exitcode = 0 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') |