-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest_idm.py
85 lines (68 loc) · 2.92 KB
/
test_idm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
from orchestrator.core.keystone import IdMKeystoneOperations
# class Test_createNewService(object):
# def __init__(self):
# self.KEYSTONE_PROTOCOL="http"
# self.KEYSTONE_HOST="localhost"
# self.KEYSTONE_PORT="5000"
# self.DOMAIN_NAME="admin_domain"
# self.DOMAIN_ADMIN_USER="cloud_admin"
# self.DOMAIN_ADMIN_PASSWORD="password"
# self.SERVICE_NAME="SmartValencia"
# self.SERVICE_ADMIN_USER="adm1"
# self.SERVICE_ADMIN_PASSWORD="password"
# self.KEYPASS_PROTOCOL="http"
# self.KEYPASS_HOST="localhost"
# self.KEYPASS_PORT="8080"
# def test_getToken(DOMAIN_NAME, DOMAIN_ADMIN_USER, DOMAIN_ADMIN_PASSWORD):
# pass
# def test_createDomain(CLOUD_ADMIN_TOKEN, NEW_SERVICE_NAME, NEW_SERVICE_DESCRIPTION):
# pass
# # def test_createUserAdminDomain(CLOUD_ADMIN_TOKEN, NEW_SERVICE_NAME, ID_DOM1,
# # NEW_SERVICE_ADMIN_USER, NEW_SERVICE_ADMIN_PASSWORD):
# # pass
# def createUserDomain(
# SERVICE_ADMIN_TOKEN,
# ID_DOM1,
# SERVICE_NAME,
# NEW_USER_NAME,
# NEW_USER_PASSWORD):
# pass
# def test_getRoleId(CLOUD_ADMIN_TOKEN, ROLE_NAME):
# pass
# def test_grantDomainRole(CLOUD_ADMIN_TOKEN, ID_DOM1, ID_ADM1, ADMIN_ROLE_ID):
# pass
# def test_createDomainRole(SERVICE_ADMIN_TOKEN, SUB_SERVICE_ROLE_NAME, ID_DOM1):
# pass
# def test_provisionPolicy(SERVICE_NAME, SERVICE_ADMIN_TOKEN,
# SUB_SERVICE_ROLE_ID, POLICY_FILE_NAME):
# pass
# def createProject(SERVICE_ADMIN_TOKEN,
# ID_DOM1,
# NEW_SUBSERVICE_NAME,
# NEW_SUBSERVICE_DESCRIPTION):
# pass
class Test_createNewSubService(object):
def __init__(self):
self.KEYSTONE_PROTOCOL="http"
self.KEYSTONE_HOST="localhost"
self.KEYSTONE_PORT="5000"
self.SERVICE_NAME="SmartValencia"
self.SERVICE_ADMIN_USER="adm1"
self.SERVICE_ADMIN_PASSWORD="password"
self.SUBSERVICE_NAME="Electricidad"
self.SUBSERVICE_DESCRIPTION="electricidad"
def test_createProject(self):
pass
def test_getDomainId(self):
ko = IdMKeystoneOperations(self.KEYSTONE_PROTOCOL,
self.KEYSTONE_HOST,
self.KEYSTONE_PORT)
SERVICE_ADMIN_TOKEN = ko.getToken(self.SERVICE_NAME,
self.SERVICE_ADMIN_USER,
self.SERVICE_ADMIN_PASSWORD)
SERVICE_ID = ko.getDomainId(SERVICE_ADMIN_TOKEN,
self.SERVICE_NAME)
print SERVICE_ID
if __name__ == '__main__':
test_createNewService = Test_createNewSubService()
test_createNewService.test_getDomainId()