This test suite contains test cases relating to access checks for createNetwork(), deploying VM in an isolated network and restartNetwork() for Admin, domain admin and regular users.

(cherry picked from commit a18a4ea9e8)
This commit is contained in:
Sangeetha 2014-06-26 13:40:53 -07:00 committed by Daan Hoogland
parent 29287c989d
commit 491eb1bb73
4 changed files with 1334 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -63,3 +63,27 @@ def GetDetailExceptionInfo(e):
exc_type, exc_value, exc_traceback)))
else:
return EXCEPTION_OCCURRED
class CloudstackAclException():
NO_PERMISSION_TO_OPERATE_DOMAIN = "does not have permission to operate within domain"
UNABLE_TO_USE_NETWORK = "Unable to use network"
NO_PERMISSION_TO_OPERATE_ACCOUNT = "does not have permission to operate with resource Acct"
UNABLE_TO_LIST_NETWORK_ACCOUNT = "Can't create/list resources for account"
NO_PERMISSION_TO_ACCESS_ACCOUNT = "does not have permission to access resource Acct"
@staticmethod
def verifyMsginException(e,message):
if message in str(e):
return True
else:
return False
@staticmethod
def verifyErrorCodeinException(e,errorCode):
errorString = " errorCode: " + errorCode
if errorString in str(e):
return True
else:
return False

View File

@ -106,3 +106,8 @@ KVM = "kvm"
VMWARE = "vmware"
ROOT_DOMAIN_ADMIN="root domain admin"
CHILD_DOMAIN_ADMIN="child domain admin"
'''
Network states
'''
ALLOCATED = "Allocated"

View File

@ -1005,5 +1005,157 @@ test_data = {
"name":"Adv-Xen-Zone1"
},
"vpnclient_count": 50,
"config_path":"/hudson/scripts3/auto_xen.cfg"
}
"config_path":"/hudson/scripts3/auto_xen.cfg",
"acl":{
#data for domains and accounts
"domain1": {
"name": "D1",
},
"accountD1": {
"email": "testD1@test.com",
"firstname": "testD1",
"lastname": "Admin",
"username": "testD1",
"password": "password",
"accounttype": "1",
},
"accountD1A": {
"email": "testD1A@test.com",
"firstname": "testD1A",
"lastname": "User",
"username": "testD1A",
"password": "password",
},
"accountD1B": {
"email": "testD1B@test.com",
"firstname": "testD1B",
"lastname": "User",
"username": "testD1B",
"password": "password",
},
"domain11": {
"name": "D11",
},
"accountD11": {
"email": "testD11@test.com",
"firstname": "testD11",
"lastname": "Admin",
"username": "testD11",
"password": "password",
"accounttype": "1",
},
"accountD11A": {
"email": "testD11A@test.com",
"firstname": "testD11A",
"lastname": "User",
"username": "testD11A",
"password": "password",
},
"accountD11B": {
"email": "test11B@test.com",
"firstname": "testD11B",
"lastname": "User",
"username": "testD11B",
"password": "password",
},
"domain111": {
"name": "D111",
},
"accountD111": {
"email": "testD111@test.com",
"firstname": "testD111",
"lastname": "Admin",
"username": "testD111",
"password": "password",
},
"accountD111A": {
"email": "testD111A@test.com",
"firstname": "testD111A",
"lastname": "User",
"username": "testD111A",
"password": "password",
},
"accountD111B": {
"email": "testD111B@test.com",
"firstname": "testD111B",
"lastname": "User",
"username": "testD111B",
"password": "password",
},
"domain12": {
"name": "D12",
},
"accountD12A": {
"email": "testD12A@test.com",
"firstname": "testD12A",
"lastname": "User",
"username": "testD12A",
"password": "password",
},
"accountD12B": {
"email": "testD12B@test.com",
"firstname": "testD12B",
"lastname": "User",
"username": "testD12B",
"password": "password",
},
"domain2": {
"name": "D2",
},
"accountD2": {
"email": "testD2@test.com",
"firstname": "testD2",
"lastname": "User",
"username": "testD2",
"password": "password",
"accounttype": "1",
},
"accountD2A": {
"email": "testD2A@test.com",
"firstname": "testD2A",
"lastname": "User",
"username": "testD2A",
"password": "password",
},
"accountROOTA": {
"email": "testROOTA@test.com",
"firstname": "testROOTA",
"lastname": "User",
"username": "testROOTA",
"password": "password",
},
"accountROOT": {
"email": "testROOTA@test.com",
"firstname": "testROOT",
"lastname": "admin",
"username": "testROOT",
"password": "password",
},
#data reqd for Network creation
"network": {
"name": "Network-",
"displaytext": "Network-",
"gateway" :"10.223.1.1",
"netmask" :"255.255.255.0",
"startip" :"10.223.1.2",
"endip" :"10.223.1.100",
},
#small service offering
"service_offering": {
"small": {
"name": "Small Instance",
"displaytext": "Small Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 128,
},
},
"ostype": 'CentOS 5.6 (64-bit)',
}
}