aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
AgeCommit message (Collapse)AuthorFilesLines
2019-02-15Quick and ugly fix for "division by zero"Patrice Buriez1-1/+1
Workaround for "ZeroDivisionError: float division by zero" and "RuntimeError: Unable to retrieve TSC" issues. The actual clean fix requires reworking get_data() to accumulate bytes received from PROX TCP port until EOL is received. Since the other functions calling get_data() expect a synchronous answer from PROX, timeout should be considered a fatal error, and the current default at 10ms was just calling for problems! Even if this change does not get merged, at least this workaround will be available to end-users for cherry-picking from gerrit, while the actual clean fix is being implemented. JIRA: YARDSTICK-1381 Change-Id: I6af226ca31aaebeb50302e24b1eb209de70f6526 Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2019-02-07Update Intel Copyright for files edited in 2019John O Loughlin1-1/+1
JIRA: YARDSTICK-1591 Change-Id: I3ea9039d25bfce578681adb9e27e1598e84a1f56 Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
2019-01-29NSB sync: clean-up draft IPC implementation (part 1)Mytnyk, Volodymyr1-1/+1
The existing implementation of IPC is not finished and isn't used by any of the VNFs/TG implementation. It is used in the code but does nothing from functionality perspective. New syncronization mechanism is going to be implemented by using different approach than it was designed before. Thus, the current IPC mechanism is not going to be re-used. So, removing it. The IPC consumer/producer implementation is left as it may be required for other purposes. - Remove SampleVNF MQ consumer class - Remove IterationIPC MQ producer for VNF control messages - Remove MQ producer from SampleVNFTrafficGen class - Remove TrafficGeneratorProducer class - Remove IterationIPC runner - Remove unused task_id form VNF Generic initialization as it is not required for synchronization of VNFs/TGs anymore. - Fix UT JIRA: YARDSTICK-1592 Change-Id: I65fe51bcbd1bfeea0c43eb79ca6fb2aab5b65ae7 Signed-off-by: Mytnyk, Volodymyr <volodymyrx.mytnyk@intel.com>
2018-12-27NSB support for [core x-y] NSB PROX NFVI configurationDanielMartinBuckley1-0/+36
JIRA: YARDSTICK-1571 Cores in PROX support multiple configurations NSB supports today the more basic one, i.e. [core x] When one wants to use multiple cores sharing the same configuration, instead of copying the whole [core] section, PROX support the following syntax [core x-y] where x is the 1st core and y the last one or (for instance) [core x,y,z] NSB Now supports [core a,b,c,d] [core a-d] [core a,c-d] Change-Id: I34cd107143c89e16d58e7a99e1887ffbf720a5d1 Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-12-20Merge "Addition of IRQ Mode to NSB NFVI (PROX)"Abhijit Sinha1-1/+47
2018-11-28Addition of IRQ Mode to NSB NFVI (PROX)DanielMartinBuckley1-1/+47
JIRA: YARDSTICK-1524 Add dashboard, Traffic Profile support, PROX IRQ support, topology Change-Id: I0c0cde66f4f4d3d25aa77c502bd4349cc1b3eca2 Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-11-27NSB NFVi PROX Should report realtime port activity notDanielMartinBuckley1-0/+124
historical data JIRA: YARDSTICK-1458 The TG is only sampled at the end of every test interval. This is incorrect. It should be sampled every interval. Change-Id: I612ead8a243a7d9930874d02adc9b959b843b99b Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-11-05Update Multi Port Stats reading for PROXDanielMartinBuckley1-49/+90
JIRA: YARDSTICK-1458 Removed excessive jitter by removing extra sleeps in start/stop/reset ssh Removed extra retries when bad data returned Added a slep at end of test to give runner a chance to empty the queue on shutdown Added a timeout on port retry attempts Change-Id: Ica60b11c7af242817a83c154157827581f60d16a Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-10-02NSB PROX NFVi Test does not stop after reaching expected precisionDanielMartinBuckley1-1/+1
JIRA: YARDSTICK-1419 When using prox_binsearch algorithm, a binary search is performed, increasing lower bound when step was successful and decreasing upper bound when the step was a failure. This runs until the test_precision (as specified in the traffic profile) is reached. When the test precision is reached, the test is not completed until the runner duration is reached. As runner duration is usually high (e.g. 1800sec), the tests take much too long to execute. This makes it difficult to create test suites. Change-Id: I6cc503a09fb534a556c61c805e6df4786bb8cc4b Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-07-05Enable the MQ producer in "SampleVNFTrafficGen" classRodolfo Alonso Hernandez1-1/+1
Now all traffic generators using the default implementation of "ClientResourceHelper.run_traffic" will update the status of the traffic injection using the MQ. The available methods are listed in common.messsaging (VNF_METHOD_*): - tg_method_started: VNF app started - tg_method_finished: VNF app finished - tg_method_iteration: VNF app execution loop started JIRA: YARDSTICK-1127 Change-Id: I12829e1762fc20cc95da3b50767a66f031e25ee8 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-06-27Fix NSB NfVi support for 25 and 40GbpsXavier Simonart1-4/+27
When setting interface_speed option in the test case, NSB/PROX was still considering 100% as 10 Gbps. With this fix, when interface_speed is set to for instance 25 Gbps then NSB/PROX will start generate at 25 Gbps. Yardstick logging info printed on the screen will show performance result as percentage of interface_speed (e.g. 100% will be 25 Gbps). This is done by sending the command "speed 250" to PROX (PROX cannot know the underlying interface speed in all cases e.g. in virtio, and hence considers 100% as 10Gbps). JIRA: YARDSTICK-1217 Change-Id: I4989161b04a7afa5e347935ee7ccef7dfe5a504d Signed-off-by: Xavier Simonart <xavier.simonart@intel.com> Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-06-27Merge "Decrease Sampling interval"Abhijit Sinha1-14/+62
2018-06-26NSB NFVi BNG test fails to run - stops after one stepDanielMartinBuckley1-4/+16
JIRA: YARDSTICK-1244 When sending the start or stop command to PROX. We sould not send the same core. We should not send "start 1,1" instead we should send "start 1" Change-Id: Ie600dc3ed808fd00341e92f13bd52199e68dc51f Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-06-26Decrease Sampling intervalDanielMartinBuckley1-14/+62
JIRA: YARDSTICK-1219 Currently NSB for NFVI using PROX returns sampling information every 13 seconds. This is too slow. It is required to return sampling information form Generator AND VNF at least every 1 second. This change is depandant on JIRA: YARDSTICK-1212 and YARDSTICK-1220 Change-Id: Ica7ab795a2919d191d8cd846d028e15739e33fb7 Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-06-05Fix NSB NFVi metrics accuracyXavier Simonart1-16/+30
JIRA: YARDSTICK-1212 Change-Id: Ic4d4a3c00e4e278f4de06cc176ff663892895569 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-03-16Merge "NSB PROX L3FWD Dropping packets"Abhijit Sinha1-0/+14
2018-03-15NSB PROX L3FWD Dropping packetsDanielMartinBuckley1-0/+14
JIRA: YARDSTICK-1037 NSB PROX L3FWD was incorrect. The routing table (ipv4.lua) was incorrect. Also a specific ipv4 for 2 port configuration is required. Change-Id: I3a5fd1ea1d1ddf74cbdd6a5d9e7ced42d3c1d6e9 Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com> Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
2018-03-09Do NOT hardcode interface speed for PROX testsDanielMartinBuckley1-15/+23
JIRA: YARDSTICK-1035 Do not hardcode NIC/interface speed in PROX test. Test assumes NIC used is 10Gbps. This is incorrect. It could support 1Gbps, 10Gbps, 25Gbps, 40Gbps or something else. This is used to calculate pps (Packets Per Second) In Baremetal the NIC speed could be extracted. however when run on a virtual machine this is not possible. Solution: Add in options section of test file. eg. Options: interface_speed_gbps: 10 Where 10 refers to a 10Gbps. In a setup where multiple interfaces are used. This will refer to the speed of the slowest connection. Change-Id: I89ab16479a2cdd1d79e52cbcc5a972762c60d057 Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-03-01Import "traffic_profile" modules only onceRodolfo Alonso Hernandez1-3/+2
"traffic_profile" modules should be imported only once. Every time TrafficProfile.get is called, the modules under "yardstick.network_services.traffic_profiles" are loaded [1]. Instead of this, the modules should be registered only once the first time "yardstick.network_services.traffic_profiles.base" is loaded. This will reduce the execution time and will avoid unnecessary calls. [1] https://github.com/opnfv/yardstick/blob/d2c7cc4e9768ed003257a95c92cdb278d516761b/yardstick/network_services/traffic_profile/base.py#L36-L37 JIRA: YARDSTICK-951 Change-Id: Ia3565378ba3a1377fcb0aea8bda50ef8189414fd Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-02-28Addition of storage of extra counters for GrafanaDanielMartinBuckley1-15/+27
JIRA: YARDSTICK-1036 This stores a number of extra counters in influxdb for Prox test cases. It also stores existing counters with a "succcess_" tag. Previously throughput where stored without success or failure indication. Also "Result_" counters are also stored. These can now be used by Grafana to graph output. Change-Id: Ie5636c14ecbab1b53a988bdfbd47ddd1fcdbd695 Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2018-01-04Remove tool provisioning in PROX helperRodolfo Alonso Hernandez1-30/+24
Tool provisioning in PROX setup environment helper is not needed [1]. The tool (PROX traffic injector) is already provided during the VNF building: ./ansible/nsb_setup.yml --> ./ansible/build_yardstick_image.yml --> ./ansible/ubuntu_server_cloudimg_modify_samplevnfs.yml --> ./ansible/roles/install_samplevnf [1]https://github.com/opnfv/yardstick/blob/master/yardstick/network_services/vnf_generic/vnf/prox_helpers.py#L641 JIRA: YARDSTICK-872 Change-Id: I0f925a7967a35a97901fbe5053793a791a7b1b01 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-11-10Merge "Remove ↵Ross Brattain1-5/+0
network_services.vnf_generic.vnf.prox_helpers.ProxSocketHelper.rx_stats"
2017-11-08Remove network_services.vnf_generic.vnf.prox_helpers.ProxSocketHelper.rx_statsEmma Foley1-5/+0
* Remove the method which is unused and is marked as deprecated. Change-Id: Ie64084fcd26985283c664445b173a757d3d908ab JIRA: YARDSTICK-838 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2017-11-07NSB Prox LW_AFTR TestDanielMartinBuckley1-1/+189
JIRA: YARDSTICK-802 Addition of PROX LW_AFTR basked on PROX/DATS v037 test_104_lw_aftr.py - This support BM and Openstack Heat - This supports 4 Ports ONLY - Grafana Dashboards included - Code Coverage / Unit testing Change-Id: If2170ab458bf687256d5f1a1e840a3b9d2788ef7 Signed-off-by: Daniel MArtin Buckley <daniel.m.buckley@intel.com> Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
2017-10-13Relocate iniparser to yardstick.network_services.helpersEdward MacGillivray1-6/+5
Change-Id: I1f457c9c24f2ca84dde61b64f58edaff8952670a Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-10-06NSB Prox vPE TestAbhijit Sinha1-27/+231
JIRA: YARDSTICK-802 Addition of Prox vPE test case - The tests supports BM, Openstack Heat - Supports 4 ports - Grafana dashboards included - Added support for parameters.lua for prox additional files - Unit tests for code coverage Change-Id: I5cccb351dacba88a293ae4b8aba1f0a803d62e6d Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com> Signed-off-by: Daniel MArtin Buckley <daniel.m.buckley@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-10-04NSB Prox minor refactor of BNGAbhijit Sinha1-6/+9
JIRA: YARDSTICK-802 - Updated the BNG code with minor refactor. - Corrected the CPE core name - Update binsearch traffic profile with 64B Change-Id: Iae0be766edb986520045655fa567651711813a8b Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
2017-10-03NSB PROX test hang fixesRoss Brattain1-0/+5
The PROX tests were hanging in the duration runner. These are fixes for various errors: raise error in collect_kpi if VNF is down move prox dpdk_rebind after collectd stop fix dpdk nicbind rebind to group by drivers prox: raise error in collect_kpi if the VNF is down prox: add VNF_TYPE for consistency sample_vnf: debug and fix kill_vnf pkill is not matching some executable names, add some debug process dumps and try switching back to killall until we can find the issue sample_vnf: add default timeout, so we can override default 3600 SSH timeout collect_kpi is the point at which we check the VNFs and TGs for failures or exits queues are the problem make sure we aren't silently blocking on non-empty queues by canceling join thread in subprocess fixup duration runner to close queues and other attempt to stop duration runner from hanging VnfdHelper: memoize port_num resource: fail if ssh can't connect at the end of 3600 second test our ssh connection is dead, so we can't actually stop collectd unless we reconnect fix stop() logic to ignore ssh errors Change-Id: I6c8e682a80cb9d00362e2fef4a46df080f304e55 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-10-01NSB: cancel all queue join threadsRoss Brattain1-0/+1
In some cases we are blocking in base.Runner join() because the queues are not empty call cancel_join_thread to prevent the Queue from blocking the Process exit https://docs.python.org/3.3/library/multiprocessing.html#all-platforms Joining processes that use queues Bear in mind that a process that has put items in a queue will wait before terminating until all the buffered items are fed by the "feeder" thread to the underlying pipe. (The child process can call the cancel_join_thread() method of the queue to avoid this behaviour.) This means that whenever you use a queue you need to make sure that all items which have been put on the queue will eventually be removed before the process is joined. Otherwise you cannot be sure that processes which have put items on the queue will terminate. Remember also that non-daemonic processes will be joined automatically. Warning As mentioned above, if a child process has put items on a queue (and it has not used JoinableQueue.cancel_join_thread), then that process will not terminate until all buffered items have been flushed to the pipe. This means that if you try joining that process you may get a deadlock unless you are sure that all items which have been put on the queue have been consumed. Similarly, if the child process is non-daemonic then the parent process may hang on exit when it tries to join all its non-daemonic children. cancel_join_thread() Prevent join_thread() from blocking. In particular, this prevents the background thread from being joined automatically when the process exits – see join_thread(). A better name for this method might be allow_exit_without_flush(). It is likely to cause enqueued data to lost, and you almost certainly will not need to use it. It is really only there if you need the current process to exit immediately without waiting to flush enqueued data to the underlying pipe, and you don’t care about lost data. Change-Id: I61f11a3b01109d96b7a5445c60f1e171401157fc Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-28Addition of Prox NSB BNG and BNG-QoS testAbhijit Sinha1-165/+467
JIRA: YARDSTICK-802 Added Prox BNG and BNG-QoS Test - The tests supports BM, Openstack Heat - Supports 4 ports - Test added for BNG traffic profile - Fixed the Prox heat test cases with proper upstream and downstream links - Grafana Dashboard for BNG & BNG-QoS added - Increased the test Duration to 300 TODO: - Test does not Terminate correctly Update: Added new helper class for run_test: Genric, MPLS and BNG tests. Change-Id: Ib40811bedb45a3c3030643943f32679a4044e076 Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
2017-09-20Merge "prox: fix TG KPIs"Ross Brattain1-2/+10
2017-09-20prox: fix TG KPIsRoss Brattain1-2/+10
The problem is that we share the same ProxResourceHelper for both VNF and TG. For VNF we want to talk to resource.py and get collectd KPIs. For TG we need to read from the queue the TG calculated KPIs and we also want collectd KPIs. workaround is to use a different method name collect_collectd_kpi for VNFs Change-Id: Icc2132758e37ce210f5600a0cd433077930208e5 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-20prox: use find_relative_file when uploadingRoss Brattain1-1/+2
the prox files were being found correctly. if we use find_relative_file they will lookup relative to the task_path Change-Id: Ifde5d07df5ccfbfeba015b2f43bd8b53e89a00b7 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-09-19prox: pass prox_config_dict between Processes using queueRoss Brattain1-11/+24
we generate the prox_config_dict in the _run Process, but we also need it in the _traffic_runner Process to get core info. use a queue to pass the config list between the processes enable collect_kpi Change-Id: Ibaf41d606e559a87addf43d6ddaed206dbd2d20c Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-09-14NSB: fix port topologyMartin Banszel1-21/+28
Add a new PortPair class to resolve the topology into list of public and private ports. Before we were calculating public/private in multiple locations and using different conventions. In addition for all the DPDK test we need to use the DPDK port number and no rely on interface ordering or interface naming conventions. We used to use xe0 -> 0, xe1 -> 1, etc. This is not the DPDK port number. Use the new dpdknicbind_helper class to parse the output of dpdk-devbind.py to find the actual DPDK port number at runtime. We then use this DPDK port number to correctly calculate the port_mask_hex. The port mask maps the DPDK port num (PMD ID) to the LINK ID used in the pipeline config We also need to make sure we only use the interfaces matched to the topology and not use all the interfaces, because in some cases we will have unused interfaces. In particular TRex always requires an even number of interfaces, so for single port TRex tests we have to create the second port and not use it. Thus we had to modify the traffic generator stats code to only dump stats for used ports and no unused ports. Ixia was using interface ordering to map to Ixia ports, instead we use the dpdk_port_num which must be hardcoded for Ixia. Renamed traffic_profile.execute to traffic_profile.execute_traffic so we can trace the code easier. We pass the port used by the traffic profile to generate_samples so we don't get stats for unused ports. Fixed up vPE config creation and bring up issues. Fixed up CGNAPT and UDP_Replay to work correctly. Tested with 4-port scale-out Change-Id: I2e4f328bff2904108081e92a4bf712333fa73869 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
2017-09-04Addition of Prox NSB changes in yardstickabhijitsinha1-213/+304
JIRA: YARDSTICK-802 Addition of Prox L2Fwd, MPLS test cases for BM and Heat. updates: Most of tg_prox and prox_vnf were absorbed into the base classes. delete most of ProxDpdkVnfSetupEnvHelper, it is handled by DpdkVnfSetupEnvHelper baseclass use standard _build_pipeline_kwargs methods don't use terminate() use baseclass version add new method kill_vnf that runs pkill -x replace resource_helper.execute() with vnf_execture for dumping stats In order to share code between tg_prox and vnf_prox refactor to have tg_prox hold and wrap a ProxApproxVnf instance and call methods on that class. Do this instead of multiple-inheritance. Implement ProxApproxVnf.terminate() using prox socket command based exit, (stop_all, quit, force_quit). vnf_execute calls resource_helper.execute() which calls socket methods on the sut object. Since tg_prox wraps the VNF object, we can call terminate on the VNF object and it should work correctly. move prox config generation to parent process we need to get core number info from config file inside the TG processes, so we need to generate the config in the parent process so the data is copied to the child during the fork. moved more config file methods to the setup_helper class. we run force_quit after quit, so the socket should already be closed this will trigger socket error, so add _ignore_errors option for vnf_execute to ignore socket errors Fixed the terminate issue. Added MPLS tests. Added TG Stats in_packet/out_packet Fixed compile (pep8) issues Fixed MPLS TG port stats, in/out packets Added Grafana dashboards for L2FWD and MPLS Traffic profiles modified for tolerated loss and precision as per DATS tests. Added unit test case for Mpls Single port test stats collection support. Change-Id: Idd9493f597c668a3bb7d90e167e6a418546106e8 Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-14PROX VNF and TGRoss Brattain1-0/+963
PROX was added to samplevnf project https://git.opnfv.org/samplevnf/tree/VNFs/DPPD-PROX JIRA: YARDSTICK-638 Change-Id: If9875b1130c6bed87deb8720b0d8b28ede9289d9 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>