From f8460182ebb264212f395e873594f84d41963243 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Thu, 16 Nov 2017 04:10:58 +0000 Subject: Check external network Change-Id: I1ff199fcad99aefccb92807c8f416d4f32ec91a6 Signed-off-by: Linda Wang --- functest/tests/unit/ci/test_check_deployment.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'functest/tests') diff --git a/functest/tests/unit/ci/test_check_deployment.py b/functest/tests/unit/ci/test_check_deployment.py index 1f44d078..24e3ce53 100644 --- a/functest/tests/unit/ci/test_check_deployment.py +++ b/functest/tests/unit/ci/test_check_deployment.py @@ -170,6 +170,23 @@ class CheckDeploymentTesting(unittest.TestCase): self.assertRaises(Exception) self.assertTrue(m.called) + @mock.patch('functest.ci.check_deployment.LOGGER.info') + @mock.patch('functest.opnfv_tests.openstack.snaps.snaps_utils.' + 'get_ext_net_name', return_value='ext-net') + def test_check_extnet(self, mock_getext, mock_loginfo): + self.deployment.check_ext_net() + self.assertTrue(mock_getext.called) + mock_loginfo.assert_called_once_with("External network found: ext-net") + + @mock.patch('functest.opnfv_tests.openstack.snaps.snaps_utils.' + 'get_ext_net_name', return_value='') + def test_check_extnet_None(self, mock_getext): + with self.assertRaises(Exception) as context: + self.deployment.check_ext_net() + self.assertTrue(mock_getext.called) + msg = 'ERROR: No external networks in the deployment.' + self.assertTrue(msg in context) + if __name__ == "__main__": logging.disable(logging.CRITICAL) -- cgit 1.2.3-korg