diff options
author | 2018-06-01 12:21:20 +0100 | |
---|---|---|
committer | 2018-06-01 12:27:09 +0100 | |
commit | dde8fa628483deec352e176cea8decdbf6bed7e8 (patch) | |
tree | e38cc77f21dcf992bcf942bbb4a39d8678a3e474 /yardstick/tests/unit/network_services | |
parent | e204c5063ab86d4ed2bff296959afae43866890f (diff) |
Convert SSH custom exceptions to Yardstick exceptions
JIRA: YARDSTICK-1215
Change-Id: I5ecfd3dccd91b07cd8de5309dfa1a372eff16ed0
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/tests/unit/network_services')
-rw-r--r-- | yardstick/tests/unit/network_services/helpers/test_dpdkbindnic_helper.py | 5 | ||||
-rw-r--r-- | yardstick/tests/unit/network_services/nfvi/test_resource.py | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/yardstick/tests/unit/network_services/helpers/test_dpdkbindnic_helper.py b/yardstick/tests/unit/network_services/helpers/test_dpdkbindnic_helper.py index 367072e84..0278c20dc 100644 --- a/yardstick/tests/unit/network_services/helpers/test_dpdkbindnic_helper.py +++ b/yardstick/tests/unit/network_services/helpers/test_dpdkbindnic_helper.py @@ -17,7 +17,8 @@ import unittest import os -from yardstick.error import IncorrectConfig, SSHError +from yardstick.common import exceptions +from yardstick.error import IncorrectConfig from yardstick.error import IncorrectNodeSetup from yardstick.error import IncorrectSetup from yardstick.network_services.helpers.dpdkbindnic_helper import DpdkInterface @@ -244,7 +245,7 @@ class TestDpdkNode(unittest.TestCase): mock_ssh_helper = mock.Mock() mock_ssh_helper.execute.return_value = 0, '', '' - mock_intf_type().check.side_effect = SSHError + mock_intf_type().check.side_effect = exceptions.SSHError dpdk_node = DpdkNode(NAME, self.INTERFACES, mock_ssh_helper) diff --git a/yardstick/tests/unit/network_services/nfvi/test_resource.py b/yardstick/tests/unit/network_services/nfvi/test_resource.py index 9f337c673..de9679456 100644 --- a/yardstick/tests/unit/network_services/nfvi/test_resource.py +++ b/yardstick/tests/unit/network_services/nfvi/test_resource.py @@ -17,10 +17,10 @@ import errno import mock import unittest +from yardstick.common import exceptions from yardstick.network_services.nfvi.resource import ResourceProfile from yardstick.network_services.nfvi import resource, collectd -from yardstick.common.exceptions import ResourceCommandError -from yardstick import ssh + class TestResourceProfile(unittest.TestCase): VNFD = {'vnfd:vnfd-catalog': @@ -134,8 +134,8 @@ class TestResourceProfile(unittest.TestCase): self.assertIsNone(self.resource_profile._start_collectd(ssh_mock, "/opt/nsb_bin")) - ssh_mock.execute = mock.Mock(side_effect=ssh.SSHError) - with self.assertRaises(ssh.SSHError): + ssh_mock.execute = mock.Mock(side_effect=exceptions.SSHError) + with self.assertRaises(exceptions.SSHError): self.resource_profile._start_collectd(ssh_mock, "/opt/nsb_bin") ssh_mock.execute = mock.Mock(return_value=(1, "", "")) @@ -148,11 +148,11 @@ class TestResourceProfile(unittest.TestCase): self.assertIsNone(self.resource_profile._start_rabbitmq(ssh_mock)) ssh_mock.execute = mock.Mock(return_value=(0, "", "")) - with self.assertRaises(ResourceCommandError): + with self.assertRaises(exceptions.ResourceCommandError): self.resource_profile._start_rabbitmq(ssh_mock) ssh_mock.execute = mock.Mock(return_value=(1, "", "")) - with self.assertRaises(ResourceCommandError): + with self.assertRaises(exceptions.ResourceCommandError): self.resource_profile._start_rabbitmq(ssh_mock) def test__prepare_collectd_conf(self): |