aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/benchmark/scenarios/networking
diff options
context:
space:
mode:
authorDeepanshu Bhatia <deepanshu@voereir.com>2019-05-13 12:52:17 +0530
committerDeepanshu Bhatia <deepanshu@voereir.com>2019-05-13 12:52:17 +0530
commit4a28136293a210b9da725c7dc0a5f0eca37370ee (patch)
tree4d4f636ada097a45ea53c992d0ea33573ef5b37d /yardstick/tests/unit/benchmark/scenarios/networking
parent9539b3c3bd480d6dcbc37a7eacf44015cced3bb8 (diff)
Ping: Fix TypeError without SLA in timeout scenario
In case of no SLA association with scenario, when the commands timeout, stdout is empty and it gives TypeError. Reverted the condition to the old one which was used before introduction of verifySLA() JIRA: YARDSTICK-1618 Change-Id: Ibd86ba7168f26ae5b15c21fd6129cc737a7038db Signed-off-by: Deepanshu Bhatia <deepanshu@voereir.com>
Diffstat (limited to 'yardstick/tests/unit/benchmark/scenarios/networking')
-rw-r--r--yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py
index 559e0599e..944202658 100644
--- a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py
+++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py
@@ -91,3 +91,17 @@ class PingTestCase(unittest.TestCase):
mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR')
self.assertRaises(RuntimeError, p.run, result)
+
+ @mock.patch('yardstick.benchmark.scenarios.networking.ping.ssh')
+ def test_ping_unsuccessful_no_sla(self, mock_ssh):
+
+ args = {
+ 'options': {'packetsize': 200},
+ 'target': 'ares.demo'
+ }
+ result = {}
+
+ p = ping.Ping(args, self.ctx)
+
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ self.assertRaises(y_exc.SLAValidationError, p.run, result)