aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/common/test_utils.py
AgeCommit message (Collapse)AuthorFilesLines
2019-04-19Log VM OS version, Sample VNF branch/commit IDStepan Andrushko1-0/+28
Added debug logs to track VM, Sample VNF details during testing: - Virtual machine OS, kernel version; - Sample VNF branch, commit ID. JIRA: YARDSTICK-1499 Change-Id: I243c435809d4541dfdb8c7c3466f50c5d524ac00 Signed-off-by: Stepan Andrushko <stepanx.andrushko@intel.com>
2018-12-27Add IxNetwork L3 scenario implementationMyron Sosyak1-0/+9
Protocol interfaces are creating with config from pod file Static IP configuration are creating from testcase flow options JIRA: YARDSTICK-1570 Change-Id: I74cde67b5084d5b65d09934fe8fce7760b5ea461 Signed-off-by: Myron Sosyak <myronx.sosyak@intel.com>
2018-10-27Setup hugepages on SA host(sriov, ovs_dpdk)Serhiy Pshyk1-0/+17
JIRA: YARDSTICK-1461 Change-Id: Ia1f5026eee989672aac57775ec9dd182df658fa4 Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
2018-08-21Convert IXIA latency statistics to integerRodolfo Alonso Hernandez1-0/+16
JIRA: YARDSTICK-1385 Change-Id: Id50c393da7ded4b3c8e127f7d7a6501832a68446 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-08-02Merge "Replace assert statements in PipelineRules"Abhijit Sinha1-0/+13
2018-07-31Replace assert statements in PipelineRulesMiikka Koistinen1-0/+13
The class PipelineRules uses assert statements to check the correctness of an input parameter IP address. This commit will modify these lines to use a dedicated function "common.utils.make_ipv4_address". JIRA: YARDSTICK-966 Change-Id: I1c4cc439a7716d36548125c87dfb0bc200714a56 Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com>
2018-07-31Fix remote command execution in common.utilsMiikka Koistinen1-0/+32
yardstick.common.utils get_port_mac and get_port_ip both raise a RuntimeError on positive remote command exit status. This commit fixes them to use the error raising mechanism in yardstick.ssh.SSH. Additionally, the class AutoConnectSSH class needed an additional argument to allow the raising mechanism to work correctly. JIRA: YARDSTICK-1240 Change-Id: Idad125ebbd668cef10a6149eb3e601a437a8d40d Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com>
2018-07-30Change assert statement to raise in common/utilsMiikka Koistinen1-0/+8
This modification utilises a custom exception to be raised if an invalid mac address is passed to the function "mac_address_to_hex_list". JIRA: YARDSTICK-966 Change-Id: Ic2940276f500e9710c54963a445a137e73bd6b25 Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com>
2018-07-26Enable "wait_until_true" when used ouf the main threadRodolfo Alonso Hernandez1-3/+18
"util.wait_until_true" uses "util.Timer" to create an active wait for a condition. "Timer" class uses "signal" to create a watchdog to track the time lapsed. When used out of the main thread, "Timer" raises the following error: ValueError: signal only works in main thread To make "util.wait_until_true" usable always, a new waitting method is implemented. JIRA: YARDSTICK-1358 Change-Id: Ifb5ba0b17b5beca0af5ceab4f6431d58b7928762 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-07-24Add IP mask to IxNetwork configurationRodolfo Alonso Hernandez1-0/+14
Assign the IP mask to IxNetwork configuration, depending on the IP range provided by the user in the traffic profile. In case of single IP, a default mask will be provided: - IP_VERSION_4_MASK = 24 - IP_VERSION_6_MASK = 64 JIRA: YARDSTICK-1351 Change-Id: I029473ab8b9966a76cf559ffef53b34ca11462ad Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-07-10Merge "Add send socket commands function"Rodolfo Alonso Hernandez1-0/+27
2018-06-26NSB NFVi BNG test fails to run - stops after one stepDanielMartinBuckley1-0/+1
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-26Merge "Refactor "utils.parse_ini_file" testing"Rodolfo Alonso Hernandez1-17/+93
2018-06-18Refactor RFC2455 TRex traffic profile injectionRodolfo Alonso Hernandez1-0/+11
The TRex RFC2455 traffic profile configures the duration of the traffic injection. Once the traffic is started, the traffic profile should poll the traffic injector client for the injection status. When the injection is finished, the traffic execution should end. Instead of this, the traffic profile waits a fixed time (using time.sleep method) and then stops the traffic. This approach is not accurate and may cause shorter injection periods. JIRA: YARDSTICK-1197 Change-Id: I5090df81ef4ec7945ff6c1aff070656b48e0fe77 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-06-14Add send socket commands functionRodolfo Alonso Hernandez1-0/+27
Pktgen provides a TCP socket connection to allow the user to control it from a remote console or program [1]. This new method will provide Yardstick the ability to send string commands to a port in a remote host. [1] http://pktgen-dpdk.readthedocs.io/en/latest/socket.html JIRA: YARDSTICK-1186 Change-Id: I9d64ccad662fa3599de65654c5dab02833fcc91d Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-06-12Merge changes from topics 'YARDSTICK-1218', 'YARDSTICK-1216', ↵Rodolfo Alonso Hernandez1-9/+0
'YARDSTICK-1215', 'YARDSTICK-1214' * changes: Move IncorrectConfig, IncorrectSetup and IncorrectNodeSetup to exceptions Move ErrorClass definition to exceptions module Convert SSH custom exceptions to Yardstick exceptions Remove AnsibleCommon class method mock
2018-06-08Refactor "utils.parse_ini_file" testingRodolfo Alonso Hernandez1-17/+93
JIRA: YARDSTICK-1218 Change-Id: I5136b22110d215beb7af72998ad47a8dba27f63b Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-06-08Remove print out of logger exception in TestUtilsRodolfo Alonso Hernandez1-7/+10
Remove print out of logger exception while executing "TestUtils.test_parse_ini_file_missing_section_header" test case. JIRA: YARDSTICK-1225 Change-Id: I2a4e447c5d119fb9585b477d74f3d0a002c8278e Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-06-01Move IncorrectConfig, IncorrectSetup and IncorrectNodeSetup to exceptionsRodolfo Alonso Hernandez1-1/+0
JIRA: YARDSTICK-1218 Change-Id: I804065e9bce3e728f5bf9e756a78df8fd28f74ac Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-06-01Move ErrorClass definition to exceptions moduleRodolfo Alonso Hernandez1-8/+0
JIRA: YARDSTICK-1216 Change-Id: I82556e1d1b0c723221a58e188067cbce560b8338 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-04-27Add active wait functionRodolfo Alonso Hernandez1-1/+43
Added function "wait_until_true". This function will make an active wait until the predicate passed as an argument returns True. If the timeout expires, the function will raise a generic exception or a user defined one passed as an argument. This function will be used in YARDSTICK-1127. JIRA: YARDSTICK-1128 Change-Id: I9854e465ac6b586bf4be39ab4b266d5625b39e30 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-03-06Replace assert statements in testsEmma Foley1-19/+19
JIRA: YARDSTICK-966 Change-Id: Ic98711fa1a31d27fcb60bd96b1b3e22b5cca86b3 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-03-01NSB: move interface probe to VNF, and attempt driver-only probe firstRoss Brattain1-2/+60
If no devices are present we can't detect MAC address so we can't match Heat ports to interfaces. If only the driver is missing we can try to probe the driver using lspci. We can use lspci to ask the kernel what driver it should use for the PCI device. If we can't probe at all because the device is already bound, we can use dpkd-devind to find all the PCI address we care about and create a map with PCI device and real kernel driver. Then we can dpdk force rebind to the kernel driver. Once we have rebound to the kernel driver we can detect MAC address and all the other attributes that are required. Fix VnfSshHelper to allow override of wait timeout And a bunch of other refactors that got swept up in this JIRA: YARDSTICK-835 Change-Id: I14cb657ed289a77941d048345d06ced5b5d5da52 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2018-02-06Improve SampleVNF hugepages setupRodolfo Alonso Hernandez1-5/+25
The goal of this function is to: - Read the default hugepage size. - Set 16GB of hugepages. - Check if the status of the last action. According to [1], the default hugepage size could be read in "/proc/meminfo", always in kB. Then "/proc/sys/vm/nr_hugepages" could be used to set the number of default hugepages. [1] https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt JIRA: YARDSTICK-997 Change-Id: I762d1b16294ba1c1c2feee56610819ac358c7410 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-01-19Replace "oslo_utils.importutils" with standard library "importlib"Rodolfo Alonso Hernandez1-7/+4
The current implementation of dynamic library importation is prone to failure [1]: - "sys.modules" is modified manually, which is something not recommended [2]. - When a module is imported is added to "sys.modules"; that means there is no need to manually create an entry in this object. - "importlib" library is part of the standard library and is now available in PY3 and PY2 (backported). This library contains a function called "import_module" to import a module in runtime. [1]https://github.com/opnfv/yardstick/blob/d2c7cc4e9768ed003257a95c92cdb278d516761b/yardstick/common/utils.py#L72-L93 [2]http://justus.science/blog/2015/04/19/sys.modules-is-dangerous.html JIRA: YARDSTICK-949 Change-Id: Ide3b74f98858d06fa275fb6c9b78ceeaa64feed5 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-01-11Move tests: unit/commonEmma Foley1-0/+1085
* 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>