aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
AgeCommit message (Collapse)AuthorFilesLines
2018-01-30Make 'Scenario' classes plugableRodolfo Alonso Hernandez1-0/+53
This patch makes yardstick.benchmark.scenario.base:Scenario classes plugable. A new entry point is added to the setup. This entry point could be extended in other plugin projects to add new Scenario classes. E.g.: take a look at [1]. This is a Yardstick plugin example project. Clone the project and execute, from the project directory: $ sudo -EH python setup.py install This will add a new module to python ('yardstick-new-plugin') and a new Scenario class. Now list the scenarios in Yardstick: $ yardstick scenario list ... | SpecCPU2006_for_VM | Spec CPU2006 benchmark for Virtual Machine | | SpecCPU2006 | Spec CPU2006 benchmark | | Dummy2 | Execute Dummy (v2!) echo | +-----------------------+--------------------------------------------+ [1] https://github.com/ralonsoh/yardstick_new_plugin JIRA: YARDSTICK-910 Change-Id: Ib70ee9bf4dc7ff91d1dd6377317b313288e36bff Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-01-29Merge "Fix up tests for Parser scenario"Ross Brattain1-25/+42
2018-01-29Merge "Move tests: unit/cmd/"Ross Brattain5-222/+0
2018-01-27Fix up tests for Parser scenarioEmma Foley1-25/+42
* Check the results at the test methods * Remove print statement from Parser scenario * Replace assertEquals(x, True) with assertTrue(x) Change-Id: I5c2612692e625fc888c7ce7637b9e1625440724a Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-26Merge "Replace assertEqual(x, True|False) with assert[True|False](x)"Ross Brattain22-48/+48
2018-01-26Merge changes from topic 'bug/yardstick-864'Ross Brattain16-169/+205
* changes: Replace assertEquals with assertEqual Make files pep8 compliant before using assertTrue|False
2018-01-25Replace assertEqual(x, True|False) with assert[True|False](x)Emma Foley22-48/+48
Change-Id: Id19df79b4d27aab1a83d8350ce6395e87c13472b JIRA: YARDSTICK-903 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-25Replace assertEquals with assertEqualEmma Foley5-17/+16
unittest.assertEquals is deprecated[1], and has been replaced with unittest.assertEqual. [1] https://docs.python.org/2/library/unittest.html#deprecated-aliases Change-Id: I9c6320e3a9ec5528036b529a9c32fc48b0bcfd62 JIRA: YARDSTICK-864 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-25Make files pep8 compliant before using assertTrue|FalseEmma Foley13-152/+189
JIRA: YARDSTICK-903 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Change-Id: Id7912b5ddee36e7366bcfa824379853efd0a89f1
2018-01-25Move tests: unit/cmd/Emma Foley5-222/+0
* Fix pylint errors * Add TODOs Some errors are ignored locally, as they were a symptom of other problems. These issues have been flagged with a TODO, and should be fixed later. Change-Id: I505d72e1c646fea1976a0bf854369c6b6308bbb1 Jira: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-24Remove generated file in 'test_build_vm_xml'Rodolfo Alonso Hernandez1-3/+3
Change I22e95c488e27d6e2a8fdf6c1a07faab275fa6bba introduced a change in test case 'test_build_vm_xml' [1]. This test case generates a file which is stored locally but never removed. [1]https://github.com/opnfv/yardstick/blob/80dc9034edeb05f66bfa6264ae0adf0f6aea60da/tests/unit/benchmark/contexts/standalone/test_model.py JIRA: YARDSTICK-918 Change-Id: I91d39bb37c3d8a273fe68155bb308c5a3bc1ca9d Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-01-24Merge "'libvirt' guest console in Standalone model"Ross Brattain1-21/+21
2018-01-23Merge "Use assertIn(x, y) instead of other variations"Rodolfo Alonso Hernandez1-15/+21
2018-01-23Rename ResourceProfile.check_if_sa_running()Emma Foley4-23/+28
* Update log message and rename method to make debugging easier * Fix pep8 violations in touched files JIRA: YARDSTICK-859 Change-Id: Id138d72cd8557ffacd5dcc81d06feeb484e13625 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-22Merge "Clean unit tests in "benchmark.scenarios.lib.test_create_volume.py"Ross Brattain1-16/+67
2018-01-22Merge "Move tests: unit/dispatcher"Ross Brattain3-183/+0
2018-01-22Clean unit tests in "benchmark.scenarios.lib.test_create_volume.pyEmma Foley1-16/+67
* Use mock_object.assert_called_with instead of self.assertTrue(mock_object.called) * Remove an unneeded if clause in CreateVolume * Add individual tests for each method in CreateVolume Change-Id: I54cc56434d316f059b3822879145e6a299866fcb Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-17Move tests: unit/orchestrator/Emma Foley3-453/+0
* Fix pylint errors * Add notes where additional action is needed. Some errors are ignored locally, as they were a symptom of other problems. These issues have been flagged for follow-up, and should be fixed later. JIRA: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Change-Id: Idbf56d0cd3b29b70691acd6af4d5ac3c400d2ccc
2018-01-16bugfix: Fix duplicate 'address' in standlone SRIOVDino Madarang1-3/+24
* Add unit test per Rodolfo's comment Creating a VM using generted xml file /tmp/vm_sriov_0.xml returns an XML error: missing source address type. This fix modifies generted xml from: <source> <address> <address bus="0x1a" domain="0x0000" function="0x0" slot="0x10" type="pci" /> </address> </source> to: <source> <address bus="0x1a" domain="0x0000" function="0x0" slot="0x10" type="pci" /> </source> Change-Id: I694153e7468986bacb19ba3e09e761993aad7184 Signed-off-by: Dino Simeon Madarang <dinox.madarang@intel.com> Reviewed-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> Reviewed-by: Ross Brattain <ross.b.brattain@intel.com> Reviewed-by: Alain Jebara <alain.jebara@intel.com> Reviewed-by: Emma Foley <emma.l.foley@intel.com>
2018-01-12Use assertIn(x, y) instead of other variationsEmma Foley1-15/+21
unittest.assertIn(x,y) should be used instead of: * unittest.assertTrue(x in y) * unittest.assertEqual(x in y, True) Also fixes pep8 violations existing in the file. Change-Id: I705c1bd4af74757b5c928995894aede436d66817 JIRA: YARDSTICK-901 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-12Move tests: unit/dispatcherEmma Foley3-183/+0
* Fix pylint errors * Add TODOs Some errors are ignored locally, as they were a symptom of other problems. These issues have been flagged with a TODO, and should be fixed later. JIRA: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Change-Id: I1f8a6041424c4c69f46ef30bd5c66d2d51d24347
2018-01-11Move tests: unit/commonEmma Foley9-1665/+0
* Fix pylint errors * Add TODOs Some errors are ignored locally, as they were a symptom of other problems. These issues have been flagged with a TODO, and should be fixed later. JIRA: YARDSTICK-837 Change-Id: I2847c380556985fae2c92bb8a7da9c47e91e1338 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-11Merge "Move tests: unit/apiserver/"Ross Brattain4-153/+0
2018-01-11Move tests: unit/apiserver/Emma Foley4-153/+0
* Fix pylint errors * Add TODOs Some errors are ignored locally, as they were a symptom of other problems. These issues have been flagged with a TODO, and should be fixed later. JIRA: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Change-Id: I30d3f61e5ea479758f9a2f39cf415da18e49b9d6
2018-01-11Move tests: unit/test_ssh.pyEmma Foley1-572/+0
Change-Id: I0eabdd5d7e918dcf0df747119a104dedf125606f Jira: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-01-08Merge "Rename test/unit/cmd directory"Ross Brattain5-2/+7
2018-01-04Merge "SPEC cpu2006 test case for VM"Jing Lu1-0/+84
2018-01-04Remove tool provisioning in PROX helperRodolfo Alonso Hernandez3-81/+74
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>
2018-01-03Make GenericVNF an abstract classRodolfo Alonso Hernandez13-397/+255
GenericVNF class is now an abstract class. Only optional methods are implemented. Mandatory methods: - instantiate - wait_for_instantiate - terminate - scale - collect_kpi. JIRA: YARDSTICK-866 Change-Id: Ia8766f9f98816e11894d1e72b0f3bd573d091d99 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-12-25SPEC cpu2006 test case for VMJingLu51-0/+84
JIRA: YARDSTICK-906 This test case is for benchmarking VM(VNF) compute performance using SPEC CPU2006. Change-Id: Ida87aa4d394e38b398acb0af3176dd1b4c858c35 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-12-25Add get function in ssh.pyJingLu51-0/+9
JIRA: YARDSTICK-904 This task is about to implement a get function in ssh.py to fetch desired files/folder in a remote VM to a local path. In some test cases, test tools will produce results in files. We want retain the original result files and archive them in Yardstick docker for future usage. Change-Id: Ifd333eb044ce31cffa6f5b2a8f6a46648a8858d1 Signed-off-by: JingLu5 <lvjing5@huawei.com>
2017-12-22Replace subprocess "check_output" with "Popen"Rodolfo Alonso Hernandez2-10/+129
"check_output" is a blocking wrapper for "Popen" which returns the output of the command execution or raises an exception in case of error. "Popen" is a non-blocking function that allows to create asynchronous tasks. It returns any possible execution error but doesn't raise an exception; this is delegated to the developer. This code is used in the Yardstick CLI base test class. Change-Id: Ie3e1228b2d40cb306354447653678bf581bc9697 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-12-21Rename test/unit/cmd directoryRoss Brattain5-2/+7
Renamed test/unit/cmd directory to test/unit/test_cmd, in order to avoid importing errors during the execution of unit tests. This directory name collides with Python "cmd" library. Change-Id: Ie06d58d4faace33df684c8e511a398aa0667b098 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-12-19Variable local_iface_name is read before it is setJiri Prokes1-4/+4
Moving variable setting before reading Verified via TC: yardstick/samples/vnf_samples/nsut/ping/tc_ping_heat_context.yaml JIRA: YARDSTICK-899 Change-Id: Ia2feac1ed4e67dccd02446ba27afc9d40e87be35 Signed-off-by: Jiri Prokes <jirix.x.prokes@intel.com>
2017-12-16samples: Add generic L3 forwarder testsDino Madarang1-0/+267
A generic throughput test case that can be used as a stub code for a Linux-based VNF configured as an L3 forwarder. Supported context: * Standalone OVSDPDK and SRIOV * Baremetal Code changes: * Allow pmd-cpu-mask and lcore mask for OVS DPDK * router_vnf.py - configures interface IP addresses and static arp entries using ip command * NFVi KPIs * Allow cputune tag for standalone context to be able to PIN on NUMA 1 cpus SRIOV Test cases: * RFC2544 Ethernet framesizes, 128K Flows * 2,4 and 6 ports * 2 and 3 vcpus per port * OVSDPDK Test cases: * RFC2544 Ethernet framesizes, 128K Flows * 2 and 4 ports * 2 vcpus per port * 2 PMD threads per port TODO: * Documentation * Add 6 ports tests References: * router_vnf.py is based on sample_vnf.py * tc_*.yaml files are based on acl/vfw test case files Added unitests Added get_stats to parse ip -s link Change-Id: Id1b969d5420dfcab7c1e695acbd2cd1655747efe Signed-off-by: Dino Simeon Madarang <dinox.madarang@intel.com> Signed-off-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Reviewed-by: Alain Jebara <alain.jebara@intel.com> Reviewed-by: Deepak S <deepak.s@linux.intel.com> Reviewed-by: Emma Foley <emma.l.foley@intel.com> Reviewed-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> Reviewed-by: Ross Brattain <ross.b.brattain@intel.com> Reviewed-by: Edward MacGillivray <edward.s.macgillivray@intel.com> Signed-off-by: Dhaval Patel <dhaval.r.patel@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-12-15'libvirt' guest console in Standalone modelJan Malanik1-21/+21
Add support for 'libvirt' guest console in Standalone model. Change-Id: I660e641339658d8abe4f040bec96e9d0041402c6 Signed-off-by: Jan Malanik <janx.malanik@intel.com>
2017-12-15NSB: Fix standalone.model.Libvirt SR-IOV modelingDino Madarang3-118/+282
Fixed standalone.model.Libvirt SR-IOV XML interface modeling, acording to [1]: - All PCI attributes now are printed in hexadecimal format. - The PCI address is now added in the correct section, 'interface'. network_services.utils.PciAddress was refactored to accept both 'domain: bus:slot:function' and 'bus:slot:function' format inputs. This class is used as input in the previous class, Libvirt, to print in XML the PCI address of a SR-IOV interface. network_services.utils.PciAddress.parse_address is now deprecated. Instead the class standard instantiation must be used: libvirt_obj = utils.PciAddress(text_with_address) A deprecation decorator is implemented along with this patch. This decorator is used for the first time in the previously mentioned function. This decorator stores every decorated function name and deprecation message and raises a logging warning message the first time this function is used. [1] https://goo.gl/so2Mrp Change-Id: I22e95c488e27d6e2a8fdf6c1a07faab275fa6bba Signed-off-by: Dino Simeon Madarang <dinox.madarang@intel.com> Reviewed-by: Alain Jebara <alain.jebara@intel.com> Reviewed-by: Deepak S <deepak.s@linux.intel.com> Reviewed-by: Ross Brattain <ross.b.brattain@intel.com> Reviewed-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-12-14Merge "Ansible: fix lowercasing issue with ConfigParser"Ross Brattain1-21/+56
2017-12-11heat: allow overriding Heat/Neutron private IP for DPDK testsRoss Brattain2-2/+178
For some L2/L3 DPDK testcases we need to use a custom IP address space different from what Heat provides. These testcases require port_security_enabled = False so Neutron should allow for unrestricted L2 traffic. This will work because we bind the ports to DPDK and thus don't need DHCP. vnf_0: floating_ip: true placement: "pgrp1" network_ports: mgmt: - mgmt uplink_0: - xe0: local_ip: 10.44.0.20 netmask: 255.255.255.0 downlink_0: - xe1: local_ip: 10.44.0.30 netmask: 255.255.255.0 Also fixup flake8 errors in unittests Change-Id: Id29dfffa692f16fb1f526d208db43e476e2f7830 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-12-01Merge "KVMFORNFV: Reverting LiveMigration changes"Jing Lu1-10/+9
2017-11-30KVMFORNFV: Reverting LiveMigration changesNavya Bathula1-10/+9
This patch consists of reverting the changes of patch 45227 and incudes redirecting the console output of the LiveMigration execution to /dev/null as the stdout contains only the statistics, i.e., totaltime, downtime and setuptime. This reverts commit 5a1f65d3e7d67488ee6f558dccfa5ca5581ddb65. Change-Id: I252b5a4045657cfa8362e9aae755249480cd3b77 Signed-off-by: Navya <navyax.bathula@intel.com>
2017-11-17Make GenericTrafficGen class abstractRodolfo Alonso Hernandez2-74/+33
GenericTrafficGen class is now an abstract class. Only optional methods are implemented. - 'run_traffic' and 'terminate' are mandatory. - 'listen_traffic', 'verify_traffic' and 'wait_for_instance' are optional. By default these methods doesn't execute any action. JIRA: YARDSTICK-853 Change-Id: I2befdaa337af79cc2364bdd7c66183c31c5ab69a Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2017-11-17Merge "Create get_description and get_scenario_type for Scenario"Ross Brattain1-0/+53
2017-11-16NSB "Prox" : Cleanup duplicated traffic profileAbhijit Sinha1-95/+0
JIRA: YARDSTICK-848 The NSB PROX MPLS test uses Binsearch traffic profile and the mpls traffic profile is a duplicate. Change-Id: Ie2124cebf306fd6917b70ecd7c23ae12ef4850dc Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
2017-11-14NSB TRex: convert DPDK port number to logical TRex port numberRoss Brattain1-0/+54
when we create TRex config we sort based on PCI bus address and create a logical port ordering. We need to save this port ordering and re-use it everywhere. redirect vnfd_helper.port_num() to resource_helper.port_num() to use the logical mapping Change-Id: Ibff628556d5e11e686e15716a66a3210758c4ff0 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-11-10Merge "Remove ↵Ross Brattain1-14/+0
network_services.vnf_generic.vnf.prox_helpers.ProxSocketHelper.rx_stats"
2017-11-10Merge "Heat: add availability_zone"Ross Brattain1-11/+37
2017-11-10Merge "pmu: remove event_download_local workaround script"Ross Brattain1-4/+0
2017-11-09Merge "NSB Prox LW_AFTR Test"Ross Brattain1-0/+115
2017-11-08Remove network_services.vnf_generic.vnf.prox_helpers.ProxSocketHelper.rx_statsEmma Foley1-14/+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>