aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/core/test_vnf.py
diff options
context:
space:
mode:
authorValentin Boucher <valentin.boucher@kontron.com>2018-02-21 15:44:52 -0500
committerValentin Boucher <valentin.boucher@kontron.com>2018-02-22 09:35:02 -0500
commitf15f1764ae1531e086a68d6070964a8b6c60a987 (patch)
treed2626a872ef796e3fad886a9a6359bb3b2327e72 /functest/tests/unit/core/test_vnf.py
parent78a21107e377f4f4722fd8d570dc0394f6ae5692 (diff)
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 <valentin.boucher@kontron.com>
Diffstat (limited to 'functest/tests/unit/core/test_vnf.py')
-rw-r--r--functest/tests/unit/core/test_vnf.py14
1 files changed, 12 insertions, 2 deletions
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):