aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/test_ssh.py
AgeCommit message (Collapse)AuthorFilesLines
2018-08-02Change AutoConnectSSH to return error code by defaultMytnyk, Volodymyr1-0/+23
AutoConnectSSH execute method always returns exception when remote command returns non 0 ret code. This behavior has been introduced by https://gerrit.opnfv.org/gerrit/#/c/58579/ changes which break the NSB functionality. There are 200+ places where return code (event non zoro) is expected to be returned by AutoConnectSSH.execute() method. Right now the method returns always exception in case of remote command return not zero which causes the problem. Changed execute() method to have previous behavior (raise_on_error is always False by default) and the exception is raised only in case if raise_on_error=True is set explicitly. Added UT. JIRA: YARDSTICK-1365 Change-Id: Ib067583ea5eb704b9174084b45b920c24eb307ac Signed-off-by: Mytnyk, Volodymyr <volodymyrx.mytnyk@intel.com>
2018-06-19Refactor remote command execution in pktgenMiikka Koistinen1-0/+19
Some remote commands in Pktgen are executed without checking the exit status. This patch makes all remote commands check exit value, and removes unused variables that are captured from remote command executions. JIRA: YARDSTICK-1166 Change-Id: I42a667ebd22d086887d61e1671bc569b03c59d33 Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com>
2018-06-13assert[Greater,Equal] -> assert_{,not_}calledEmma Foley1-9/+9
assertEqual(mock_xxx.call_count, 1) -> mock_xxx.assert_called_once assertEqual(mock_xxx.call_count, 0) -> mock_xxx.assert_not_called assertGreater(mock.call_count, 0) -> mock.assert_called() assertGreaterEqual(mock.call_count, 1) -> mock.assert_called() JIRA: YARDSTICK-1069 Change-Id: I890084d120c8e78304e169e2a0e5d30011a41525 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
2018-06-01Convert SSH custom exceptions to Yardstick exceptionsRodolfo Alonso Hernandez1-17/+13
JIRA: YARDSTICK-1215 Change-Id: I5ecfd3dccd91b07cd8de5309dfa1a372eff16ed0 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
2018-03-02Remove main() and __main__ from tests.Emma Foley1-8/+0
Removes the unnecessary main() functions from tests. Also removes shebang (#!) where it appears at the top of files. JIRA: YARDSTICK-861 Change-Id: I79180d1eb9c5bce640142dd62ce28c7437c1b210 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-7/+47
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-01-11Move tests: unit/test_ssh.pyEmma Foley1-0/+572
Change-Id: I0eabdd5d7e918dcf0df747119a104dedf125606f Jira: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com>