From f15f1764ae1531e086a68d6070964a8b6c60a987 Mon Sep 17 00:00:00 2001 From: Valentin Boucher Date: Wed, 21 Feb 2018 15:44:52 -0500 Subject: Support different user/project domain values For the moment, VNF works well only if OS_PROJECT_DOMAIN_NAME=Default OS_USER_DOMAIN_NAME=Default It's now possible to use domain != Default JIRA: FUNCTEST-935 Change-Id: I779a93538662ff32906d91d7cf3b2c5c3e872765 Signed-off-by: Valentin Boucher --- functest/tests/unit/core/test_vnf.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'functest/tests/unit/core/test_vnf.py') diff --git a/functest/tests/unit/core/test_vnf.py b/functest/tests/unit/core/test_vnf.py index 16a609027..086ee6821 100644 --- a/functest/tests/unit/core/test_vnf.py +++ b/functest/tests/unit/core/test_vnf.py @@ -128,6 +128,9 @@ class VnfBaseTesting(unittest.TestCase): args[2].assert_not_called() @mock.patch('functest.core.vnf.OpenStackUser', side_effect=Exception) + @mock.patch('snaps.openstack.utils.keystone_utils.get_role_by_name', + return_value="admin") + @mock.patch('snaps.openstack.utils.keystone_utils.keystone_client') @mock.patch('functest.core.vnf.OpenStackProject') @mock.patch('snaps.openstack.tests.openstack_tests.get_credentials') def test_prepare_exc3(self, *args): @@ -135,16 +138,23 @@ class VnfBaseTesting(unittest.TestCase): self.test.prepare() args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file) args[1].assert_called_with(mock.ANY, mock.ANY) - args[2].assert_called_with(mock.ANY, mock.ANY) + args[2].assert_called_with(mock.ANY) + args[3].assert_called_with(mock.ANY, mock.ANY) + args[4].assert_called_with(mock.ANY, mock.ANY) @mock.patch('functest.core.vnf.OpenStackUser') + @mock.patch('snaps.openstack.utils.keystone_utils.get_role_by_name', + return_value="admin") + @mock.patch('snaps.openstack.utils.keystone_utils.keystone_client') @mock.patch('functest.core.vnf.OpenStackProject') @mock.patch('snaps.openstack.tests.openstack_tests.get_credentials') def test_prepare_default(self, *args): self.assertEqual(self.test.prepare(), testcase.TestCase.EX_OK) args[0].assert_called_with(os_env_file=vnf.VnfOnBoarding.env_file) args[1].assert_called_with(mock.ANY, mock.ANY) - args[2].assert_called_with(mock.ANY, mock.ANY) + args[2].assert_called_with(mock.ANY) + args[3].assert_called_with(mock.ANY, mock.ANY) + args[4].assert_called_with(mock.ANY, mock.ANY) def test_deploy_vnf_unimplemented(self): with self.assertRaises(vnf.VnfDeploymentException): -- cgit 1.2.3-korg