From d29f8fa251540b48371f76e47ddba6315607d192 Mon Sep 17 00:00:00 2001 From: Provoost Date: Mon, 29 Jan 2018 13:01:07 +0100 Subject: Rework of the test cases in the *.test files Cores can now be specified in the test files. An irq test has been added to verify if the VMs are not suffering from long interrupts. Change-Id: I647fda3ebf76c7c2b36a8df9a63d9fb83563c249 Signed-off-by: Provoost --- .../helper-scripts/openstackrapid/3VMrapid.yaml | 2 +- .../openstackrapid/3VMsriovrapid.yaml | 2 +- .../DPPD-PROX/helper-scripts/openstackrapid/README | 12 +- .../helper-scripts/openstackrapid/basicrapid.test | 30 ++++- .../helper-scripts/openstackrapid/createrapid.py | 4 +- .../helper-scripts/openstackrapid/gen.cfg | 4 +- .../helper-scripts/openstackrapid/gen_gw.cfg | 4 +- .../helper-scripts/openstackrapid/impair.cfg | 6 +- .../helper-scripts/openstackrapid/impair.test | 27 ++++- .../helper-scripts/openstackrapid/prox_ctrl.py | 20 +++- .../helper-scripts/openstackrapid/rapid.yaml | 2 +- .../helper-scripts/openstackrapid/runrapid.py | 123 +++++++++++++++------ .../helper-scripts/openstackrapid/secgw.test | 28 ++++- .../helper-scripts/openstackrapid/secgw1.cfg | 2 +- .../helper-scripts/openstackrapid/secgw2.cfg | 2 +- .../helper-scripts/openstackrapid/sriovrapid.yaml | 2 +- .../helper-scripts/openstackrapid/sut.cfg | 46 -------- .../helper-scripts/openstackrapid/swap.cfg | 2 +- 18 files changed, 211 insertions(+), 107 deletions(-) delete mode 100644 VNFs/DPPD-PROX/helper-scripts/openstackrapid/sut.cfg diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMrapid.yaml b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMrapid.yaml index 98bc95a4..99bbd20a 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMrapid.yaml +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMrapid.yaml @@ -146,7 +146,7 @@ outputs: description: Number of VMs created by this stack value: 3 vm1_private_ip: - description: IP address ofVM1 admin port + description: IP address of VM1 admin port value: { get_attr: [vm1_admin_port, fixed_ips, 0, ip_address] } vm1_public_ip: description: Floating IP address of VM1 in public network diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMsriovrapid.yaml b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMsriovrapid.yaml index fe910def..07a039ff 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMsriovrapid.yaml +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/3VMsriovrapid.yaml @@ -167,7 +167,7 @@ outputs: description: IP address of VM3 admin port value: { get_attr: [vm3_admin_port, fixed_ips, 0, ip_address] } vm3_public_ip: - description: Floating IP address of VM32 in public network + description: Floating IP address of VM3 in public network value: { get_attr: [ vm3_floating_ip, floating_ip_address ] } vm3_dataplane_ip: description: IP address of VM3 dataplane port diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README index c29532ac..ec333e38 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/README @@ -51,7 +51,7 @@ that floating IPs are working on your OpenStack deployment. Once that is done it will connect to the PROX tcp socket and start sending commands to run the actual test. It will print test results on the screen while running. -The actual test that is running is decribed in .test. +The actual test that is running is described in .test. Notes about prox_user_data.sh script: - The script contains commands that will be executed using cloud-init at @@ -71,6 +71,16 @@ openstack port create --network fast-network --vnic-type direct --fixed-ip subne Make sure to use the network and subnet in the createrapid parameters list. Port1, Port2 and Port3 are being used in the yaml files. +Note when doing tests using the gateway functionality on OVS: +When a GW VM is sending packets on behalf of another VM (e.g. the generator), we need to make sure the OVS +will allow those packets to go through. Therefore you need to the IP address of the generator in the +"allowed address pairs" of the GW VM. + +Note when doing tests using encryption on OVS: +Your OVS configuration might block encrypted packets. To allow packets to go through, +you can disable port_security. You can do this by using the following commands +neutron port-update xxxxxx --no-security-groups +neutron port-update xxxxxx --port_security_enabled=False An example of the env file generated by createrapid.py can be found below. Note that this file can be created manually in case the stack is created in a diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/basicrapid.test b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/basicrapid.test index e1180039..fde148f6 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/basicrapid.test +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/basicrapid.test @@ -1,3 +1,19 @@ +## +## Copyright (c) 2010-2018 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. +## + [DEFAULT] name = BasicSwapTesting number_of_tests = 3 @@ -6,21 +22,29 @@ init_code=init_test() dest_vm = not_used gw_vm = not_used script_control = false +group1cores = not_used +group2cores = not_used +group3cores = not_used [VM1] name = Generator config_file = gen.cfg dest_vm = 2 +script_control = true +group1cores = [1] +group2cores = [3] +group3cores = [1,3] [VM2] name = Swap config_file = swap.cfg +group1cores = [1] [test1] -cmd=run_speedtest(sock[0],sock[1],sutstatcores,genstatcores,gencontrolcores) +cmd=run_speedtest(sock[0],sock[1]) [test2] -cmd=run_sizetest(sock[0],sock[1],sutstatcores,genstatcores,gencontrolcores) +cmd=run_sizetest(sock[0],sock[1]) [test3] -cmd=run_flowtest(sock[0],sock[1],sutstatcores,genstatcores,gencontrolcores) +cmd=run_flowtest(sock[0],sock[1]) diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py index 0fb67237..beca11c3 100755 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/createrapid.py @@ -39,7 +39,7 @@ flavor = "prox_flavor" # This is also the default in the yaml file.... image = "rapidVM" # This is also the default in the yaml file.... image_file = "rapidVM.qcow2" dataplane_network = "dataplane-network" # This is also the default in the yaml file.... -subnet = "dpdk-subnet" #Hardcoded at this moment +subnet = "dpdk-subnet" #subnet for dataplane subnet_cidr="10.10.10.0/24" # cidr for dataplane internal_network="admin_internal_net" floating_network="admin_floating_net" @@ -131,7 +131,7 @@ for opt, arg in opts: print ("Using dataplane subnet: "+ subnet_cidr) elif opt in ("--internal_network"): internal_network = arg - print ("Using controle plane network: "+ internal_network) + print ("Using control plane network: "+ internal_network) elif opt in ("--floating_network"): floating_network = arg print ("Using floating ip network: "+ floating_network) diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen.cfg index 3222bde5..7ef0159c 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen.cfg +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen.cfg @@ -36,7 +36,7 @@ name=${name} [core 0] mode=master -[core 1] +[core ${group1}] name=p0 task=0 mode=gen @@ -53,7 +53,7 @@ drop=no lat pos=42 accuracy pos=46 -[core 2] +[core ${group2}] name=lat task=0 mode=lat diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen_gw.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen_gw.cfg index 03f8b354..2e900dcf 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen_gw.cfg +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/gen_gw.cfg @@ -36,7 +36,7 @@ name=${name} [core 0] mode=master -[core 1] +[core ${group1}] name=p0 task=0 mode=gen @@ -53,7 +53,7 @@ drop=no lat pos=42 accuracy pos=46 -[core 2] +[core ${group2}] name=lat task=0 mode=lat diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.cfg index b508c9b4..4b1f7018 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.cfg +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.cfg @@ -34,14 +34,14 @@ name=${name} [core 0] mode=master -[core 1] +[core ${group1}] name=impair task=0 mode=impair sub mode=l3 rx port=if0 tx port=if0 -delay us=20 -probability=60 +delay us=120 +probability=99 local ipv4=${local_ip} diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.test b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.test index da856876..9c9fba26 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.test +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/impair.test @@ -1,3 +1,19 @@ +## +## Copyright (c) 2010-2018 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. +## + [DEFAULT] name = impairTesting number_of_tests = 1 @@ -6,21 +22,28 @@ init_code=init_test() dest_vm = not_used gw_vm = not_used script_control = false +group1cores = not_used +group2cores = not_used +group3cores = not_used [VM1] name = Generator config_file = gen_gw.cfg gw_vm = 2 dest_vm = 3 -script_control = true +group1cores = [1] +group2cores = [3] +group3cores = [1,3] [VM2] name = ImpairGW config_file = impair.cfg +group1cores = [1] [VM3] name = Swap config_file = swap.cfg +group1cores = [1] [test1] -cmd=run_speedtest(sock[0],'none',sutstatcores,genstatcores,gencontrolcores) +cmd=run_speedtest(sock[0],sock[2]) diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/prox_ctrl.py b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/prox_ctrl.py index daa96a50..059cbf71 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/prox_ctrl.py +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/prox_ctrl.py @@ -184,15 +184,29 @@ class prox_sock(object): self._send('reset stats') def lat_stats(self, cores, task=0): - min_lat = max_lat = avg_lat = 0 + min_lat = 999999999 + max_lat = avg_lat = 0 self._send('lat stats %s %s' % (','.join(map(str, cores)), task)) for core in cores: stats = self._recv().split(',') - min_lat += int(stats[0]) - max_lat += int(stats[1]) + min_lat = min(int(stats[0]),min_lat) + max_lat = max(int(stats[1]),max_lat) avg_lat += int(stats[2]) + avg_lat = avg_lat/len(cores) return min_lat, max_lat, avg_lat + def irq_stats(self, core, bucket, task=0): + self._send('stats task.core(%s).task(%s).irq(%s)' % (core, task, bucket)) + stats = self._recv().split(',') + return int(stats[0]) + + def show_irq_buckets(self, core, task=0): + rx = tx = drop = tsc = hz = 0 + self._send('show irq buckets %s %s' % (core,task)) + buckets = self._recv().split(';') + buckets = buckets[:-1] + return buckets + def core_stats(self, cores, task=0): rx = tx = drop = tsc = hz = 0 self._send('core stats %s %s' % (','.join(map(str, cores)), task)) diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/rapid.yaml b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/rapid.yaml index 63778c1c..9b42ed85 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/rapid.yaml +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/rapid.yaml @@ -146,7 +146,7 @@ outputs: description: Number of VMs created by this stack value: 2 vm1_private_ip: - description: IP address ofVM1 admin port + description: IP address of VM1 admin port value: { get_attr: [vm1_admin_port, fixed_ips, 0, ip_address] } vm1_public_ip: description: Floating IP address of VM1 in public network diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py index 7447e160..22181b96 100755 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/runrapid.py @@ -30,10 +30,11 @@ from logging.handlers import RotatingFileHandler from logging import handlers from prox_ctrl import prox_ctrl import ConfigParser +import ast version="17.12.15" stack = "rapid" #Default string for stack -test = "basicrapid" #Default string for stack +test = "basicrapid" #Default string for test loglevel="DEBUG" # sets log level for writing to file runtime=10 # time in seconds for 1 test run @@ -80,10 +81,10 @@ for opt, arg in opts: if opt in ("--test"): test = arg print ("Using '"+test+".test' for test case definition") - elif opt in ("--runtime"): + if opt in ("--runtime"): runtime = arg print ("Runtime: "+ runtime) - elif opt in ("--log"): + if opt in ("--log"): loglevel = arg print ("Log level: "+ loglevel) @@ -174,21 +175,21 @@ def connect_client(client): log.debug("Trying to connect to VM which was just launched on %s, attempt: %d" % (client.ip(), attempts)) log.info("Connected to VM on %s" % client.ip()) -def run_iteration(gensock,sutsock,sutstatcores,genstatcores,gencontrolcores): - gensock.start(gencontrolcores) +def run_iteration(gensock,sutsock): + gensock.start(gencores) time.sleep(1) if sutsock!='none': old_sut_rx, old_sut_tx, old_sut_drop, old_sut_tsc, sut_tsc_hz = sutsock.core_stats(sutstatcores) old_rx, old_tx, old_drop, old_tsc, tsc_hz = gensock.core_stats(genstatcores) time.sleep(float(runtime)) - lat_min, lat_max, lat_avg = gensock.lat_stats([2]) + lat_min, lat_max, lat_avg = gensock.lat_stats(latcores) # Get statistics after some execution time new_rx, new_tx, new_drop, new_tsc, tsc_hz = gensock.core_stats(genstatcores) if sutsock!='none': new_sut_rx, new_sut_tx, new_sut_drop, new_sut_tsc, sut_tsc_hz = sutsock.core_stats(sutstatcores) time.sleep(1) #Stop generating - gensock.stop(gencontrolcores) + gensock.stop(gencores) drop = new_drop-old_drop # drop is all packets dropped by all tasks. This includes packets dropped at the generator task + packets dropped by the nop task. In steady state, this equals to the number of packets received by this VM rx = new_rx - old_rx # rx is all packets received by the nop task = all packets received in the gen VM tx = new_tx - old_tx # tx is all generated packets actually accepted by the interface @@ -222,7 +223,7 @@ def new_speed(speed,drop_rate): p=1 q=.99 ratio = min((q-y0)/p*drop_rate+y0,(q-y100)/(p-100)*drop_rate+q-p*(q-y100)/(p-100)) - return (int(speed*ratio*100)+0.5)/100 + return (int(speed*ratio*100)+0.5)/100.0 def get_drop_rate(speed,pps_rx,size): # pps_rx are all the packets that are received by the generator. That is substracted @@ -231,9 +232,10 @@ def get_drop_rate(speed,pps_rx,size): # that the speed variable is already expressed in % so we only take 100 and not 10000) # divided by the number of bits in 1 packet. That is 8 bits in a byte times the size of # a frame (=our size + 24 bytes overhead). - return (100*(speed * 100 / (8*(size+24)) - pps_rx)/(speed*100.0/(8*(size+24)))) + tried_to_send = speed * 100.0 / (8*(size+24)) + return (100.0*(tried_to_send - pps_rx)/tried_to_send) -def run_speedtest(gensock,sutsock,sutstatcores,genstatcores,gencores): +def run_speedtest(gensock,sutsock): log.info("+----------------------------------------------------------------------------------------------------------------------------+") log.info("| Generator is sending UDP (1 flow) packets (64 bytes) to SUT. SUT sends packets back |") log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+------------+") @@ -250,7 +252,7 @@ def run_speedtest(gensock,sutsock,sutstatcores,genstatcores,gencores): gensock.speed(speed, gencores) time.sleep(1) # Get statistics now that the generation is stable and NO ARP messages any more - pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock,sutstatcores,genstatcores,gencores) + pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock) drop_rate = get_drop_rate(speed,pps_rx,size) if ((drop_rate) < 1): # This will stop the test when number of dropped packets is below a certain percentage @@ -263,10 +265,7 @@ def run_speedtest(gensock,sutsock,sutstatcores,genstatcores,gencores): speed = new_speed(speed,drop_rate) time.sleep(2) - -# print("") - -def run_flowtest(gensock,sutsock,sutstatcores,genstatcores,gencores): +def run_flowtest(gensock,sutsock): log.info("+---------------------------------------------------------------------------------------------------------------+") log.info("| UDP, 64 bytes, different number of flows by randomizing SRC & DST UDP port |") log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") @@ -292,25 +291,24 @@ def run_flowtest(gensock,sutsock,sutstatcores,genstatcores,gencores): gensock.speed(speed, gencores) time.sleep(1) # Get statistics now that the generation is stable and NO ARP messages any more - pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock,sutstatcores,genstatcores,gencores) + pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock) drop_rate = get_drop_rate(speed,pps_rx,size) if ((drop_rate) < 1): # This will stop the test when number of dropped packets is below a certain percentage - log.info('|{:>7}'.format(str(flow_number))+" | "+ '{:>14}'.format(str(round(speed,2))) + '% | '+ '{:>9}'.format(str(pps_req_tx))+' Mpps | '+ '{:>9}'.format(str(pps_tx)) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9}'.format(str(pps_rx))+" Mpps |"+ '{:>9}'.format(str(lat_avg))+" us |") + log.info('|{:>7}'.format(str(flow_number))+" | "+ '{:>14}'.format(str(round(speed,2))) + '% | '+ '{:>9}'.format(str(pps_req_tx))+' Mpps | '+ '{:>9}'.format(str(pps_tx)) +' Mpps | ' + '{:>9}'.format(pps_sut_tx_str) +' Mpps | '+ '{:>9}'.format(str(pps_rx))+" Mpps |"+ '{:>10}'.format(str(lat_avg))+" us |") log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") break speed = new_speed(speed,drop_rate) time.sleep(2) -# print("") -def run_sizetest(gensock,sutsock,sutstatcores,genstatcores,gencores): +def run_sizetest(gensock,sutsock): log.info("+---------------------------------------------------------------------------------------------------------------+") log.info("| UDP, 1 flow, different packet sizes |") log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") log.info("| Pktsize| Speed requested | Sent to NIC | Sent by Gen | Forward by SUT | Rec. by Gen | Avg. Latency |") log.info("+--------+-----------------+----------------+----------------+----------------+----------------+----------------+") speed = 100 - # To generate a desired number of flows, PROX will randomize the bits in source and destination ports, as specified by the bit masks in the flows variable. + # PROX will use different packet sizes as defined in sizes[] sizes=[1400,1024,512,256,128,64] for size in sizes: #speed = 100 Commented out: Not starting from 100% since we are trying smaller packets, so speed will not be higher than the speed achieved in previous loop @@ -328,7 +326,7 @@ def run_sizetest(gensock,sutsock,sutstatcores,genstatcores,gencores): gensock.speed(speed, gencores) time.sleep(1) # Get statistics now that the generation is stable and NO ARP messages any more - pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock,sutstatcores,genstatcores,gencores) + pps_req_tx,pps_tx,pps_sut_tx_str,pps_rx,lat_avg = run_iteration(gensock,sutsock) drop_rate = get_drop_rate(speed,pps_rx,size) if ((drop_rate) < 1): # This will stop the test when number of dropped packets is below a certain percentage @@ -337,27 +335,54 @@ def run_sizetest(gensock,sutsock,sutstatcores,genstatcores,gencores): break speed = new_speed(speed,drop_rate) time.sleep(2) -#======================================================================== + +def run_irqtest(sock): + log.info("+----------------------------------------------------------------------------------------------------------------------------") + log.info("| Measuring time probably spent dealing with an interrupt. Interrupting DPDK cores for more than 50us might be problematic ") + log.info("| and result in packet loss. The first row shows the interrupted time buckets: first number is the bucket between 0us and ") + log.info("| that number expressed in us and so on. The numbers in the other rows show how many times per second, the program was ") + log.info("| interrupted for a time as specified by its bucket. ") + log.info("+----------------------------------------------------------------------------------------------------------------------------") + sys.stdout.flush() + buckets=sock.show_irq_buckets(1) + print('Measurement ongoing ... ',end='\r') + sock.stop(irqcores) + old_irq = [[0 for x in range(len(buckets)+1)] for y in range(len(irqcores)+1)] + new_irq = [[0 for x in range(len(buckets)+1)] for y in range(len(irqcores)+1)] + irq = [[0 for x in range(len(buckets)+1)] for y in range(len(irqcores)+1)] + irq[0][0] = 'bucket us' + for j,bucket in enumerate(buckets,start=1): + irq[0][j] = '<'+ bucket + irq[0][-1] = '>'+ buckets [-2] + for j,bucket in enumerate(buckets,start=1): + for i,irqcore in enumerate(irqcores,start=1): + old_irq[i][j] = sock.irq_stats(irqcore,j-1) + sock.start(irqcores) + time.sleep(float(runtime)) + sock.stop(irqcores) + for i,irqcore in enumerate(irqcores,start=1): + irq[i][0]='core %s'%irqcore + for j,bucket in enumerate(buckets,start=1): + new_irq[i][j] = sock.irq_stats(irqcore,j-1) + irq[i][j] = (new_irq[i][j] - old_irq[i][j])/float(runtime) + log.info('\n'.join([''.join(['{:>10}'.format(item) for item in row]) for row in irq])) + def init_test(): - global sutstatcores - global genstatcores - global genrxcores - global gencontrolcores - sutstatcores = [1] - genstatcores = [1,2] - genrxcores = [2] - gencontrolcores = [1] # Running at low speed to make sure the ARP messages can get through. # If not doing this, the ARP message could be dropped by a switch in overload and then the test will not give proper results # Note hoever that if we would run the test steps during a very long time, the ARP would expire in the switch. # PROX will send a new ARP request every seconds so chances are very low that they will all fail to get through - sock[0].speed(0.01, gencontrolcores) + sock[0].speed(0.01, gencores) sock[0].start(genstatcores) time.sleep(2) - sock[0].stop(gencontrolcores) - sock[1].start([1]) + sock[0].stop(gencores) +global sutstatcores +global genstatcores +global latcores +global gencores +global irqcores vmDPIP =[] vmAdminIP =[] vmDPmac =[] @@ -384,6 +409,15 @@ for vm in range(1, int(total_number_of_VMs)+1): for vm in range(1, int(required_number_of_VMs)+1): config_file.append(testconfig.get('VM%d'%vm, 'config_file')) script_control.append(testconfig.get('VM%d'%vm, 'script_control')) + group1cores=testconfig.get('VM%d'%vm, 'group1cores') + if group1cores <> 'not_used': + group1cores=ast.literal_eval(group1cores) + group2cores=testconfig.get('VM%d'%vm, 'group2cores') + if group2cores <> 'not_used': + group2cores=ast.literal_eval(group2cores) + group3cores=testconfig.get('VM%d'%vm, 'group3cores') + if group3cores <> 'not_used': + group3cores=ast.literal_eval(group3cores) with open("parameters%d.lua"%vm, "w") as f: f.write('name="%s"\n'% testconfig.get('VM%d'%vm, 'name')) f.write('local_ip="%s"\n'% vmDPIP[vm-1]) @@ -398,6 +432,26 @@ for vm in range(1, int(required_number_of_VMs)+1): destVMindex = int(destVM)-1 f.write('dest_ip="%s"\n'% vmDPIP[destVMindex]) f.write('dest_hex_ip="%s"\n'% hexDPIP[destVMindex]) + if group1cores <> 'not_used': + f.write('group1="%s"\n'% ','.join(map(str, group1cores))) + if group2cores <> 'not_used': + f.write('group2="%s"\n'% ','.join(map(str, group2cores))) + if group3cores <> 'not_used': + f.write('group3="%s"\n'% ','.join(map(str, group3cores))) + if config_file[-1] == 'gen.cfg': + gencores = group1cores + latcores = group2cores + genstatcores = group3cores + elif config_file[-1] == 'gen_gw.cfg': + gencores = group1cores + latcores = group2cores + genstatcores = group3cores + elif config_file[-1] == 'swap.cfg': + sutstatcores = group1cores + elif config_file[-1] == 'secgw2.cfg': + sutstatcores = group1cores + elif config_file[-1] == 'irq.cfg': + irqcores = group1cores f.close ##################################################################################### client =[] @@ -429,7 +483,8 @@ for vm in range(0, int(required_number_of_VMs)): sock.append(connect_socket(client[-1])) init_code = testconfig.get('DEFAULT', 'init_code') -eval(init_code) +if init_code <> 'not_used': + eval(init_code) #################################################### # Run test cases # Best to run the flow test at the end since otherwise the tests coming after thatmight be influenced by the big number of entries in the switch flow tables diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw.test b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw.test index 3f537e33..ae72c75f 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw.test +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw.test @@ -1,3 +1,19 @@ +## +## Copyright (c) 2010-2018 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. +## + [DEFAULT] name = GWTesting number_of_tests = 2 @@ -6,6 +22,9 @@ init_code=init_test() dest_vm = not_used gw_vm = not_used script_control = false +group1cores = not_used +group2cores = not_used +group3cores = not_used [VM1] @@ -14,18 +33,23 @@ config_file = gen_gw.cfg dest_vm = 3 gw_vm = 2 script_control = true +group1cores = [1] +group2cores = [3] +group3cores = [1,3] [VM2] name = GW1 config_file = secgw1.cfg dest_vm = 3 +group1cores = [1] [VM3] name = GW2 config_file = secgw2.cfg +group1cores = [1] [test1] -cmd=run_speedtest(sock[0],'none',sutstatcores,genstatcores,gencontrolcores) +cmd=run_speedtest(sock[0],sock[2]) [test2] -cmd=run_sizetest(sock[0],'none',sutstatcores,genstatcores,gencontrolcores) +cmd=run_sizetest(sock[0],sock[2]) diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw1.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw1.cfg index c4aa82fa..30abb8f7 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw1.cfg +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw1.cfg @@ -43,7 +43,7 @@ name=${name} [core 0] mode=master -[core 1] +[core ${group1}] name=esp_enc task=0 mode=esp_enc diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw2.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw2.cfg index 6b9c7500..a361e875 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw2.cfg +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/secgw2.cfg @@ -42,7 +42,7 @@ name=${name} [core 0] mode=master -[core 1] +[core ${group1}] name=esp_dec task=0 mode=esp_dec diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/sriovrapid.yaml b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/sriovrapid.yaml index d76e1ee3..dc512c65 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/sriovrapid.yaml +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/sriovrapid.yaml @@ -167,7 +167,7 @@ outputs: # description: IP address of VM3 admin port # value: { get_attr: [vm3_admin_port, fixed_ips, 0, ip_address] } # vm3_public_ip: -# description: Floating IP address of VM32 in public network +# description: Floating IP address of VM3 in public network # value: { get_attr: [ vm3_floating_ip, floating_ip_address ] } # vm3_dataplane_ip: # description: IP address of VM3 dataplane port diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/sut.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/sut.cfg deleted file mode 100644 index 9e4d5e3e..00000000 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/sut.cfg +++ /dev/null @@ -1,46 +0,0 @@ -;; -;; Copyright (c) 2010-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. -;; - -[eal options] --n=4 ; force number of memory channels -no-output=no ; disable DPDK debug output - -[lua] -dofile("parameters.lua") - -[port 0] -name=if0 -mac=hardware - -[defaults] -mempool size=2K - -[global] -name=SWAP - -[core 0] -mode=master - -[core 1] -name=swap -task=0 -mode=swap -sub mode=l3 -rx port=if0 -tx port=if0 -;local ipv4=${sut_ip} -drop=no - diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/swap.cfg b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/swap.cfg index 7b8dd492..4229c207 100644 --- a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/swap.cfg +++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/swap.cfg @@ -34,7 +34,7 @@ name=${name} [core 0] mode=master -[core 1] +[core ${group1}] name=swap task=0 mode=swap -- cgit 1.2.3-korg