mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2323: fix test scripts to conform with library changes
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
70c936bb85
commit
f0749ce625
|
|
@ -162,11 +162,11 @@ class TestAccounts(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["account"]
|
||||
)
|
||||
self.debug("Created account: %s" % account.account.name)
|
||||
self.debug("Created account: %s" % account.name)
|
||||
self.cleanup.append(account)
|
||||
list_accounts_response = list_accounts(
|
||||
self.apiclient,
|
||||
id=account.account.id
|
||||
id=account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_accounts_response, list),
|
||||
|
|
@ -181,12 +181,12 @@ class TestAccounts(cloudstackTestCase):
|
|||
|
||||
account_response = list_accounts_response[0]
|
||||
self.assertEqual(
|
||||
account.account.accounttype,
|
||||
account.accounttype,
|
||||
account_response.accounttype,
|
||||
"Check Account Type of Created account"
|
||||
)
|
||||
self.assertEqual(
|
||||
account.account.name,
|
||||
account.name,
|
||||
account_response.name,
|
||||
"Check Account Name of Created account"
|
||||
)
|
||||
|
|
@ -194,8 +194,8 @@ class TestAccounts(cloudstackTestCase):
|
|||
user = User.create(
|
||||
self.apiclient,
|
||||
self.services["user"],
|
||||
account=account.account.name,
|
||||
domainid=account.account.domainid
|
||||
account=account.name,
|
||||
domainid=account.domainid
|
||||
)
|
||||
self.debug("Created user: %s" % user.id)
|
||||
list_users_response = list_users(
|
||||
|
|
@ -301,15 +301,15 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
user_1 = User.create(
|
||||
self.apiclient,
|
||||
self.services["user"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created user: %s" % user_1.id)
|
||||
user_2 = User.create(
|
||||
self.apiclient,
|
||||
self.services["user"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created user: %s" % user_2.id)
|
||||
self.cleanup.append(user_2)
|
||||
|
|
@ -317,12 +317,12 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
vm_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM in account: %s, ID: %s" % (
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
vm_1.id
|
||||
))
|
||||
self.cleanup.append(vm_1)
|
||||
|
|
@ -330,12 +330,12 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
vm_2 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM in account: %s, ID: %s" % (
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
vm_2.id
|
||||
))
|
||||
self.cleanup.append(vm_2)
|
||||
|
|
@ -347,7 +347,7 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
# Account should exist after deleting user
|
||||
accounts_response = list_accounts(
|
||||
self.apiclient,
|
||||
id=self.account.account.id
|
||||
id=self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(accounts_response, list),
|
||||
|
|
@ -362,8 +362,8 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
)
|
||||
vm_response = list_virtual_machines(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(vm_response, list),
|
||||
|
|
@ -401,43 +401,43 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
user_1 = User.create(
|
||||
self.apiclient,
|
||||
self.services["user"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created user: %s" % user_1.id)
|
||||
user_2 = User.create(
|
||||
self.apiclient,
|
||||
self.services["user"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created user: %s" % user_2.id)
|
||||
vm_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM in account: %s, ID: %s" % (
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
vm_1.id
|
||||
))
|
||||
vm_2 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM in account: %s, ID: %s" % (
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
vm_2.id
|
||||
))
|
||||
# Get users associated with an account
|
||||
# (Total 3: 2 - Created & 1 default generated while account creation)
|
||||
users = list_users(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(users, list),
|
||||
|
|
@ -468,7 +468,7 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
# Account is removed after last user is deleted
|
||||
account_response = list_accounts(
|
||||
self.apiclient,
|
||||
id=self.account.account.id
|
||||
id=self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
account_response,
|
||||
|
|
@ -478,8 +478,8 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
# All VMs associated with account are removed.
|
||||
vm_response = list_virtual_machines(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
vm_response,
|
||||
|
|
@ -490,8 +490,8 @@ class TestRemoveUserFromAccount(cloudstackTestCase):
|
|||
with self.assertRaises(Exception):
|
||||
list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
return
|
||||
|
||||
|
|
@ -1217,11 +1217,11 @@ class TestUserDetails(cloudstackTestCase):
|
|||
# Fetching the user details of account
|
||||
self.debug(
|
||||
"Fetching user details for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
users = User.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(users, list),
|
||||
|
|
@ -1304,11 +1304,11 @@ class TestUserDetails(cloudstackTestCase):
|
|||
# Fetching the user details of account
|
||||
self.debug(
|
||||
"Fetching user details for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
users = User.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(users, list),
|
||||
|
|
@ -1391,11 +1391,11 @@ class TestUserDetails(cloudstackTestCase):
|
|||
# Fetching the user details of account
|
||||
self.debug(
|
||||
"Fetching user details for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
users = User.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(users, list),
|
||||
|
|
@ -1515,7 +1515,7 @@ class TestUserLogin(cloudstackTestCase):
|
|||
self.debug("Logging into the cloudstack with login API")
|
||||
respose = User.login(
|
||||
self.apiclient,
|
||||
username=self.account.account.name,
|
||||
username=self.account.name,
|
||||
password=self.services["account"]["password"]
|
||||
)
|
||||
self.assertEqual(respose, None, "Login response should not be none")
|
||||
|
|
@ -1572,8 +1572,8 @@ class TestUserLogin(cloudstackTestCase):
|
|||
|
||||
accounts = Account.list(
|
||||
self.apiclient,
|
||||
name=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
name=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True
|
||||
)
|
||||
|
||||
|
|
@ -1586,7 +1586,7 @@ class TestUserLogin(cloudstackTestCase):
|
|||
self.debug("Logging into the cloudstack with login API")
|
||||
respose = User.login(
|
||||
self.apiclient,
|
||||
username=self.account.account.name,
|
||||
username=self.account.name,
|
||||
password=self.services["account"]["password"]
|
||||
)
|
||||
self.assertEqual(respose, None, "Login response should not be none")
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -146,8 +146,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=cls.template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -204,8 +204,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["volume"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Created volume with ID: %s" % volume.id)
|
||||
|
|
@ -283,8 +283,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
volume_response.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created snapshot: %s" % snapshot.id)
|
||||
#Create volume from snapshot
|
||||
|
|
@ -292,8 +292,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
snapshot.id,
|
||||
self.services["volume"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created Volume: %s from Snapshot: %s" % (
|
||||
volume_from_snapshot.id,
|
||||
|
|
@ -323,12 +323,12 @@ class TestSnapshots(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
mode=self.services["mode"]
|
||||
)
|
||||
self.debug("Deployed new VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deployed new VM for account: %s" % self.account.name)
|
||||
self.cleanup.append(new_virtual_machine)
|
||||
|
||||
self.debug("Attaching volume: %s to VM: %s" % (
|
||||
|
|
@ -434,7 +434,7 @@ class TestTemplate(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
|
|
@ -471,8 +471,8 @@ class TestTemplate(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["templates"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Registering template with ID: %s" % template.id)
|
||||
try:
|
||||
|
|
@ -519,8 +519,8 @@ class TestTemplate(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
)
|
||||
self.debug("Deployed VM with ID: %s " % virtual_machine.id)
|
||||
|
|
@ -565,15 +565,15 @@ class TestNATRules(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.public_ip = PublicIPAddress.create(
|
||||
cls.api_client,
|
||||
accountid=cls.account.account.name,
|
||||
accountid=cls.account.name,
|
||||
zoneid=cls.zone.id,
|
||||
domainid=cls.account.account.domainid,
|
||||
domainid=cls.account.domainid,
|
||||
services=cls.services["virtual_machine"]
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -817,23 +817,23 @@ class TestRouters(cloudstackTestCase):
|
|||
vm_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.admin_account.account.name,
|
||||
domainid=self.admin_account.account.domainid,
|
||||
accountid=self.admin_account.name,
|
||||
domainid=self.admin_account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM with ID: %s" % vm_1.id)
|
||||
vm_2 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.user_account.account.name,
|
||||
domainid=self.user_account.account.domainid,
|
||||
accountid=self.user_account.name,
|
||||
domainid=self.user_account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM with ID: %s" % vm_2.id)
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.admin_account.account.name,
|
||||
domainid=self.admin_account.account.domainid,
|
||||
account=self.admin_account.name,
|
||||
domainid=self.admin_account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(routers, list),
|
||||
|
|
@ -887,8 +887,8 @@ class TestRouterRestart(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.cleanup = [
|
||||
|
|
@ -927,8 +927,8 @@ class TestRouterRestart(cloudstackTestCase):
|
|||
# Find router associated with user account
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -945,8 +945,8 @@ class TestRouterRestart(cloudstackTestCase):
|
|||
while True:
|
||||
networks = Network.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
network = networks[0]
|
||||
if network.state in ["Implemented", "Setup"]:
|
||||
|
|
@ -966,8 +966,8 @@ class TestRouterRestart(cloudstackTestCase):
|
|||
# Get router details after restart
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -1009,7 +1009,7 @@ class TestTemplates(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -1020,8 +1020,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
)
|
||||
#Stop virtual machine
|
||||
|
|
@ -1091,8 +1091,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["templates"],
|
||||
self.volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Creating template with ID: %s" % template.id)
|
||||
# Volume and Template Size should be same
|
||||
|
|
@ -1121,8 +1121,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
self.volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created snapshot with ID: %s" % snapshot.id)
|
||||
snapshots = Snapshot.list(
|
||||
|
|
@ -1203,8 +1203,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
self.volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created snapshot with ID: %s" % snapshot.id)
|
||||
snapshots = Snapshot.list(
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class TestDefaultSecurityGroupEgress(cloudstackTestCase):
|
|||
admin=True,
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
|
|
@ -208,12 +208,12 @@ class TestDefaultSecurityGroupEgress(cloudstackTestCase):
|
|||
# 4. listVirtualMachines should show that the VM belongs to default
|
||||
# security group
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM with ID: %s" % self.virtual_machine.id)
|
||||
|
|
@ -260,8 +260,8 @@ class TestDefaultSecurityGroupEgress(cloudstackTestCase):
|
|||
# Verify listSecurity groups response
|
||||
security_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(security_groups, list),
|
||||
|
|
@ -333,7 +333,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -371,15 +371,15 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -396,8 +396,8 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule, dict),
|
||||
|
|
@ -410,12 +410,12 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
# Should be able to SSH VM
|
||||
try:
|
||||
self.debug("SSH into VM: %s" % self.virtual_machine.ssh_ip)
|
||||
|
|
@ -491,7 +491,7 @@ class TestDefaultGroupEgress(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -529,16 +529,16 @@ class TestDefaultGroupEgress(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -557,8 +557,8 @@ class TestDefaultGroupEgress(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -575,8 +575,8 @@ class TestDefaultGroupEgress(cloudstackTestCase):
|
|||
egress_rule = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -589,12 +589,12 @@ class TestDefaultGroupEgress(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Should be able to SSH VM
|
||||
try:
|
||||
|
|
@ -692,7 +692,7 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -730,16 +730,16 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -758,8 +758,8 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -773,12 +773,12 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
self.debug(
|
||||
|
|
@ -787,8 +787,8 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase):
|
|||
egress_rule = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -875,7 +875,7 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -915,16 +915,16 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -944,8 +944,8 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -963,8 +963,8 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||
egress_rule = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -977,12 +977,12 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Should be able to SSH VM
|
||||
try:
|
||||
|
|
@ -1033,7 +1033,7 @@ class TestRevokeEgressRule(cloudstackTestCase):
|
|||
"Revoke Egress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
result = security_group.revokeEgress(
|
||||
|
|
@ -1137,7 +1137,7 @@ class TestInvalidAccountAuthroize(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -1173,16 +1173,16 @@ class TestInvalidAccountAuthroize(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -1205,7 +1205,7 @@ class TestInvalidAccountAuthroize(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=random_gen(),
|
||||
domainid=self.account.account.domainid
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
return
|
||||
|
||||
|
|
@ -1804,7 +1804,7 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -1842,16 +1842,16 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -1871,8 +1871,8 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -1886,12 +1886,12 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
self.debug(
|
||||
|
|
@ -1900,8 +1900,8 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase):
|
|||
egress_rule = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -2016,7 +2016,7 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -2054,16 +2054,16 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -2085,8 +2085,8 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
egress_rule = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["sg_invalid_port"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug(
|
||||
"Authorizing egress rule for sec group ID: %s with invalid cidr"
|
||||
|
|
@ -2095,8 +2095,8 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
egress_rule = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["sg_invalid_cidr"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug(
|
||||
"Authorizing egress rule for sec group ID: %s with invalid account"
|
||||
|
|
@ -2106,7 +2106,7 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=random_gen(),
|
||||
domainid=self.account.account.domainid
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug(
|
||||
"Authorizing egress rule for sec group ID: %s with cidr: anywhere and port: 22"
|
||||
|
|
@ -2114,8 +2114,8 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
egress_rule_A = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["sg_cidr_anywhere"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -2127,8 +2127,8 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
egress_rule_R = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["sg_cidr_restricted"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -2144,8 +2144,8 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
|
|||
security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["sg_cidr_restricted"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
return
|
||||
|
||||
|
|
@ -2203,7 +2203,7 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -2241,16 +2241,16 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -2270,8 +2270,8 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -2289,8 +2289,8 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||
egress_rule = security_group.authorizeEgress(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -2303,12 +2303,12 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Should be able to SSH VM
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -119,8 +119,8 @@ class TestEIP(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
networks = Network.list(
|
||||
|
|
@ -140,8 +140,8 @@ class TestEIP(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
associatednetworkid=cls.guest_network.id,
|
||||
isstaticnat=True,
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
listall=True
|
||||
)
|
||||
if isinstance(ip_addrs, list):
|
||||
|
|
@ -240,8 +240,8 @@ class TestEIP(cloudstackTestCase):
|
|||
# Verify listSecurity groups response
|
||||
security_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(security_groups, list),
|
||||
|
|
@ -262,8 +262,8 @@ class TestEIP(cloudstackTestCase):
|
|||
"Creating Ingress rule to allow SSH on default security group")
|
||||
|
||||
cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
|
||||
cmd.domainid = self.account.account.domainid
|
||||
cmd.account = self.account.account.name
|
||||
cmd.domainid = self.account.domainid
|
||||
cmd.account = self.account.name
|
||||
cmd.securitygroupid = security_group.id
|
||||
cmd.protocol = 'TCP'
|
||||
cmd.startport = 22
|
||||
|
|
@ -370,16 +370,16 @@ class TestEIP(cloudstackTestCase):
|
|||
|
||||
public_ip = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
services=self.services["virtual_machine"]
|
||||
)
|
||||
self.debug("IP address: %s is acquired by network: %s" % (
|
||||
public_ip.ipaddress.ipaddress,
|
||||
public_ip.ipaddress,
|
||||
self.guest_network.id))
|
||||
self.debug("Enabling static NAT for IP Address: %s" %
|
||||
public_ip.ipaddress.ipaddress)
|
||||
public_ip.ipaddress)
|
||||
|
||||
StaticNATRule.enable(
|
||||
self.apiclient,
|
||||
|
|
@ -390,11 +390,11 @@ class TestEIP(cloudstackTestCase):
|
|||
# Fetch details from user_ip_address table in database
|
||||
self.debug(
|
||||
"select is_system, one_to_one_nat from user_ip_address where public_ip_address='%s';" \
|
||||
% public_ip.ipaddress.ipaddress)
|
||||
% public_ip.ipaddress)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select is_system, one_to_one_nat from user_ip_address where public_ip_address='%s';" \
|
||||
% public_ip.ipaddress.ipaddress
|
||||
% public_ip.ipaddress
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -449,12 +449,12 @@ class TestEIP(cloudstackTestCase):
|
|||
)
|
||||
|
||||
# try:
|
||||
# self.debug("SSH into VM: %s" % public_ip.ipaddress.ipaddress)
|
||||
# self.debug("SSH into VM: %s" % public_ip.ipaddress)
|
||||
# ssh = self.virtual_machine.get_ssh_client(
|
||||
# ipaddress=public_ip.ipaddress.ipaddress)
|
||||
# ipaddress=public_ip.ipaddress)
|
||||
# except Exception as e:
|
||||
# self.fail("SSH Access failed for %s: %s" % \
|
||||
# (public_ip.ipaddress.ipaddress, e)
|
||||
# (public_ip.ipaddress, e)
|
||||
# )
|
||||
|
||||
self.debug("SSH into netscaler: %s" %
|
||||
|
|
@ -472,7 +472,7 @@ class TestEIP(cloudstackTestCase):
|
|||
self.debug("Output: %s" % result)
|
||||
|
||||
self.assertEqual(
|
||||
result.count(public_ip.ipaddress.ipaddress),
|
||||
result.count(public_ip.ipaddress),
|
||||
1,
|
||||
"One IP from EIP pool should be taken and configured on NS"
|
||||
)
|
||||
|
|
@ -484,7 +484,7 @@ class TestEIP(cloudstackTestCase):
|
|||
self.debug("Output: %s" % result)
|
||||
|
||||
self.assertEqual(
|
||||
result.count("NAME: Cloud-Inat-%s" % public_ip.ipaddress.ipaddress),
|
||||
result.count("NAME: Cloud-Inat-%s" % public_ip.ipaddress),
|
||||
1,
|
||||
"User source IP should be enabled for INAT service"
|
||||
)
|
||||
|
|
@ -517,8 +517,8 @@ class TestEIP(cloudstackTestCase):
|
|||
self.api_client,
|
||||
associatednetworkid=self.guest_network.id,
|
||||
isstaticnat=True,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True
|
||||
)
|
||||
self.assertEqual(
|
||||
|
|
@ -602,8 +602,8 @@ class TestEIP(cloudstackTestCase):
|
|||
self.api_client,
|
||||
associatednetworkid=self.guest_network.id,
|
||||
isstaticnat=True,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True
|
||||
)
|
||||
self.assertEqual(
|
||||
|
|
@ -711,8 +711,8 @@ class TestEIP(cloudstackTestCase):
|
|||
self.api_client,
|
||||
associatednetworkid=self.guest_network.id,
|
||||
isstaticnat=True,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True
|
||||
)
|
||||
self.assertEqual(
|
||||
|
|
@ -784,8 +784,8 @@ class TestEIP(cloudstackTestCase):
|
|||
self.api_client,
|
||||
associatednetworkid=self.guest_network.id,
|
||||
isstaticnat=True,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True
|
||||
)
|
||||
self.assertEqual(
|
||||
|
|
@ -942,15 +942,15 @@ class TestELB(cloudstackTestCase):
|
|||
cls.vm_1 = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.vm_2 = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
networks = Network.list(
|
||||
|
|
@ -968,9 +968,9 @@ class TestELB(cloudstackTestCase):
|
|||
cls.lb_rule = LoadBalancerRule.create(
|
||||
cls.api_client,
|
||||
cls.services["lbrule"],
|
||||
accountid=cls.account.account.name,
|
||||
accountid=cls.account.name,
|
||||
networkid=cls.guest_network.id,
|
||||
domainid=cls.account.account.domainid
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.lb_rule.assign(cls.api_client, [cls.vm_1, cls.vm_2])
|
||||
|
||||
|
|
@ -1024,8 +1024,8 @@ class TestELB(cloudstackTestCase):
|
|||
# Verify listSecurity groups response
|
||||
security_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(security_groups, list),
|
||||
|
|
@ -1046,8 +1046,8 @@ class TestELB(cloudstackTestCase):
|
|||
"Creating Ingress rule to allow SSH on default security group")
|
||||
|
||||
cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
|
||||
cmd.domainid = self.account.account.domainid
|
||||
cmd.account = self.account.account.name
|
||||
cmd.domainid = self.account.domainid
|
||||
cmd.account = self.account.name
|
||||
cmd.securitygroupid = security_group.id
|
||||
cmd.protocol = 'TCP'
|
||||
cmd.startport = 22
|
||||
|
|
@ -1056,12 +1056,12 @@ class TestELB(cloudstackTestCase):
|
|||
self.apiclient.authorizeSecurityGroupIngress(cmd)
|
||||
|
||||
self.debug(
|
||||
"Fetching LB IP for account: %s" % self.account.account.name)
|
||||
"Fetching LB IP for account: %s" % self.account.name)
|
||||
ip_addrs = PublicIPAddress.list(
|
||||
self.api_client,
|
||||
associatednetworkid=self.guest_network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
forloadbalancing=True,
|
||||
listall=True
|
||||
)
|
||||
|
|
@ -1073,7 +1073,7 @@ class TestELB(cloudstackTestCase):
|
|||
|
||||
lb_ip = ip_addrs[0]
|
||||
self.debug("LB IP generated for account: %s is: %s" % (
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
lb_ip.ipaddress
|
||||
))
|
||||
#TODO: uncomment this after ssh issue is resolved
|
||||
|
|
@ -1199,24 +1199,24 @@ class TestELB(cloudstackTestCase):
|
|||
|
||||
public_ip = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
services=self.services["virtual_machine"]
|
||||
)
|
||||
self.debug("IP address: %s is acquired by network: %s" % (
|
||||
public_ip.ipaddress.ipaddress,
|
||||
public_ip.ipaddress,
|
||||
self.guest_network.id))
|
||||
|
||||
self.debug("Creating LB rule for public IP: %s" %
|
||||
public_ip.ipaddress.ipaddress)
|
||||
public_ip.ipaddress)
|
||||
lb_rule = LoadBalancerRule.create(
|
||||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
ipaddressid=public_ip.ipaddress.id,
|
||||
networkid=self.guest_network.id,
|
||||
domainid=self.account.account.domaind
|
||||
domainid=self.account.domaind
|
||||
)
|
||||
self.debug("Assigning VMs (%s, %s) to LB rule: %s" % (self.vm_1.name,
|
||||
self.vm_2.name,
|
||||
|
|
@ -1225,10 +1225,10 @@ class TestELB(cloudstackTestCase):
|
|||
#TODO: workaround : add route in the guest VM for SNIP
|
||||
#
|
||||
# self.debug("SSHing into VMs using ELB IP: %s" %
|
||||
# public_ip.ipaddress.ipaddress)
|
||||
# public_ip.ipaddress)
|
||||
# try:
|
||||
# ssh_1 = self.vm_1.get_ssh_client(
|
||||
# ipaddress=public_ip.ipaddress.ipaddress)
|
||||
# ipaddress=public_ip.ipaddress)
|
||||
# self.debug("Command: hostname")
|
||||
# result = ssh_1.execute("hostname")
|
||||
# self.debug("Result: %s" % result)
|
||||
|
|
@ -1244,7 +1244,7 @@ class TestELB(cloudstackTestCase):
|
|||
# )
|
||||
#
|
||||
# ssh_2 = self.vm_2.get_ssh_client(
|
||||
# ipaddress=public_ip.ipaddress.ipaddress)
|
||||
# ipaddress=public_ip.ipaddress)
|
||||
# self.debug("Command: hostname")
|
||||
# result = ssh_2.execute("hostname")
|
||||
# self.debug("Result: %s" % result)
|
||||
|
|
@ -1265,11 +1265,11 @@ class TestELB(cloudstackTestCase):
|
|||
## Fetch details from user_ip_address table in database
|
||||
self.debug(
|
||||
"select is_system from user_ip_address where public_ip_address='%s';" \
|
||||
% public_ip.ipaddress.ipaddress)
|
||||
% public_ip.ipaddress)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select is_system from user_ip_address where public_ip_address='%s';" \
|
||||
% public_ip.ipaddress.ipaddress)
|
||||
% public_ip.ipaddress)
|
||||
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -1304,7 +1304,7 @@ class TestELB(cloudstackTestCase):
|
|||
self.debug("Output: %s" % result)
|
||||
|
||||
self.assertEqual(
|
||||
result.count(public_ip.ipaddress.ipaddress),
|
||||
result.count(public_ip.ipaddress),
|
||||
1,
|
||||
"One IP from EIP pool should be taken and configured on NS"
|
||||
)
|
||||
|
|
@ -1316,7 +1316,7 @@ class TestELB(cloudstackTestCase):
|
|||
self.debug("Output: %s" % result)
|
||||
|
||||
self.assertEqual(
|
||||
result.count("Cloud-VirtualServer-%s-22 (%s:22) - TCP" % (public_ip.ipaddress.ipaddress, public_ip.ipaddress.ipaddress)),
|
||||
result.count("Cloud-VirtualServer-%s-22 (%s:22) - TCP" % (public_ip.ipaddress, public_ip.ipaddress)),
|
||||
1,
|
||||
"User subnet IP should be enabled for LB service"
|
||||
)
|
||||
|
|
@ -1342,12 +1342,12 @@ class TestELB(cloudstackTestCase):
|
|||
# running and USNIP : ON
|
||||
|
||||
self.debug(
|
||||
"Fetching LB IP for account: %s" % self.account.account.name)
|
||||
"Fetching LB IP for account: %s" % self.account.name)
|
||||
ip_addrs = PublicIPAddress.list(
|
||||
self.api_client,
|
||||
associatednetworkid=self.guest_network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
forloadbalancing=True,
|
||||
listall=True
|
||||
)
|
||||
|
|
@ -1359,7 +1359,7 @@ class TestELB(cloudstackTestCase):
|
|||
|
||||
lb_ip = ip_addrs[0]
|
||||
self.debug("LB IP generated for account: %s is: %s" % (
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
lb_ip.ipaddress
|
||||
))
|
||||
|
||||
|
|
@ -1424,11 +1424,11 @@ class TestELB(cloudstackTestCase):
|
|||
# Fetch details from account_id table in database
|
||||
self.debug(
|
||||
"select id from account where account_name='%s';" \
|
||||
% self.account.account.name)
|
||||
% self.account.name)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where account_name='%s';" \
|
||||
% self.account.account.name)
|
||||
% self.account.name)
|
||||
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -1467,7 +1467,7 @@ class TestELB(cloudstackTestCase):
|
|||
public_ip = qresult[0]
|
||||
|
||||
self.debug(
|
||||
"Fetching public IP for account: %s" % self.account.account.name)
|
||||
"Fetching public IP for account: %s" % self.account.name)
|
||||
ip_addrs = PublicIPAddress.list(
|
||||
self.api_client,
|
||||
ipaddress=public_ip,
|
||||
|
|
|
|||
|
|
@ -256,21 +256,21 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.debug("Created network with ID: %s" % self.network.id)
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Spawn an instance in that network
|
||||
virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
networkids=[str(self.network.id)]
|
||||
)
|
||||
|
|
@ -279,8 +279,8 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
src_nat_list = PublicIPAddress.list(
|
||||
self.apiclient,
|
||||
associatednetworkid=self.network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True,
|
||||
issourcenat=True,
|
||||
)
|
||||
|
|
@ -305,7 +305,7 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=src_nat.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug(
|
||||
"Trying to create a port forwarding rule in source NAT: %s" %
|
||||
|
|
@ -322,18 +322,18 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.debug("Associating public IP for network: %s" % self.network.id)
|
||||
ip_with_nat_rule = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
self.debug("Associated %s with network %s" % (
|
||||
ip_with_nat_rule.ipaddress.ipaddress,
|
||||
ip_with_nat_rule.ipaddress,
|
||||
self.network.id
|
||||
))
|
||||
self.debug("Creating PF rule for IP address: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
NATRule.create(
|
||||
self.apiclient,
|
||||
virtual_machine,
|
||||
|
|
@ -342,7 +342,7 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
)
|
||||
|
||||
self.debug("Trying to create LB rule on IP with NAT: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
|
||||
# Create Load Balancer rule on IP already having NAT rule
|
||||
with self.assertRaises(Exception):
|
||||
|
|
@ -350,7 +350,7 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=ip_with_nat_rule.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Creating PF rule with public port: 66")
|
||||
|
||||
|
|
@ -376,27 +376,27 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.debug("Associating public IP for network: %s" % self.network.id)
|
||||
ip_with_lb_rule = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
networkid=self.network.id
|
||||
)
|
||||
self.debug("Associated %s with network %s" % (
|
||||
ip_with_lb_rule.ipaddress.ipaddress,
|
||||
ip_with_lb_rule.ipaddress,
|
||||
self.network.id
|
||||
))
|
||||
self.debug("Creating LB rule for IP address: %s" %
|
||||
ip_with_lb_rule.ipaddress.ipaddress)
|
||||
ip_with_lb_rule.ipaddress)
|
||||
|
||||
LoadBalancerRule.create(
|
||||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=ip_with_lb_rule.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
|
||||
self.debug("Trying to create PF rule on IP with LB rule: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
|
||||
with self.assertRaises(Exception):
|
||||
NATRule.create(
|
||||
|
|
@ -411,7 +411,7 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule_port_2221"],
|
||||
ipaddressid=ip_with_lb_rule.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
|
||||
# Check if NAT rule created successfully
|
||||
|
|
@ -499,21 +499,21 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.debug("Created network with ID: %s" % self.network.id)
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Spawn an instance in that network
|
||||
virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
networkids=[str(self.network.id)]
|
||||
)
|
||||
|
|
@ -522,8 +522,8 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
src_nat_list = PublicIPAddress.list(
|
||||
self.apiclient,
|
||||
associatednetworkid=self.network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True,
|
||||
issourcenat=True,
|
||||
)
|
||||
|
|
@ -547,7 +547,7 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=src_nat.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Created LB rule on source NAT: %s" % src_nat.ipaddress)
|
||||
|
||||
|
|
@ -624,18 +624,18 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.debug("Associating public IP for network: %s" % self.network.id)
|
||||
public_ip = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
self.debug("Associated %s with network %s" % (
|
||||
public_ip.ipaddress.ipaddress,
|
||||
public_ip.ipaddress,
|
||||
self.network.id
|
||||
))
|
||||
self.debug("Creating PF rule for IP address: %s" %
|
||||
public_ip.ipaddress.ipaddress)
|
||||
public_ip.ipaddress)
|
||||
NATRule.create(
|
||||
self.apiclient,
|
||||
virtual_machine,
|
||||
|
|
@ -644,14 +644,14 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
)
|
||||
|
||||
self.debug("Trying to create LB rule on IP with NAT: %s" %
|
||||
public_ip.ipaddress.ipaddress)
|
||||
public_ip.ipaddress)
|
||||
|
||||
# Create Load Balancer rule on IP already having NAT rule
|
||||
lb_rule = LoadBalancerRule.create(
|
||||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=public_ip.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Creating PF rule with public port: 66")
|
||||
|
||||
|
|
@ -679,7 +679,7 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule_port_2221"],
|
||||
ipaddressid=public_ip.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
|
||||
# Check if NAT rule created successfully
|
||||
|
|
@ -700,8 +700,8 @@ class TestNOVirtualRouter(cloudstackTestCase):
|
|||
vpn = Vpn.create(
|
||||
self.apiclient,
|
||||
src_nat.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
vpns = Vpn.list(
|
||||
|
|
@ -834,21 +834,21 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.debug("Created network with ID: %s" % self.network.id)
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Spawn an instance in that network
|
||||
virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
networkids=[str(self.network.id)]
|
||||
)
|
||||
|
|
@ -857,8 +857,8 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
src_nat_list = PublicIPAddress.list(
|
||||
self.apiclient,
|
||||
associatednetworkid=self.network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True,
|
||||
issourcenat=True,
|
||||
)
|
||||
|
|
@ -883,7 +883,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=src_nat.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
|
||||
self.debug(
|
||||
|
|
@ -930,18 +930,18 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.debug("Associating public IP for network: %s" % self.network.id)
|
||||
ip_with_nat_rule = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
self.debug("Associated %s with network %s" % (
|
||||
ip_with_nat_rule.ipaddress.ipaddress,
|
||||
ip_with_nat_rule.ipaddress,
|
||||
self.network.id
|
||||
))
|
||||
self.debug("Creating PF rule for IP address: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
NATRule.create(
|
||||
self.apiclient,
|
||||
virtual_machine,
|
||||
|
|
@ -950,7 +950,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
)
|
||||
|
||||
self.debug("Trying to create LB rule on IP with NAT: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
|
||||
# Create Load Balancer rule on IP already having NAT rule
|
||||
with self.assertRaises(Exception):
|
||||
|
|
@ -958,7 +958,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=ip_with_nat_rule.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Creating PF rule with public port: 66")
|
||||
|
||||
|
|
@ -984,28 +984,28 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.debug("Associating public IP for network: %s" % self.network.id)
|
||||
ip_with_lb_rule = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
networkid=self.network.id
|
||||
)
|
||||
self.debug("Associated %s with network %s" % (
|
||||
ip_with_lb_rule.ipaddress.ipaddress,
|
||||
ip_with_lb_rule.ipaddress,
|
||||
self.network.id
|
||||
))
|
||||
self.debug("Creating LB rule for IP address: %s" %
|
||||
ip_with_lb_rule.ipaddress.ipaddress)
|
||||
ip_with_lb_rule.ipaddress)
|
||||
|
||||
LoadBalancerRule.create(
|
||||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=ip_with_lb_rule.ipaddress.id,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
self.debug("Trying to create PF rule on IP with LB rule: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
|
||||
with self.assertRaises(Exception):
|
||||
NATRule.create(
|
||||
|
|
@ -1031,7 +1031,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule_port_2221"],
|
||||
ipaddressid=ip_with_lb_rule.ipaddress.id,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
|
|
@ -1054,8 +1054,8 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
Vpn.create(
|
||||
self.apiclient,
|
||||
src_nat.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
return
|
||||
|
||||
|
|
@ -1104,21 +1104,21 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.debug("Created network with ID: %s" % self.network.id)
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Spawn an instance in that network
|
||||
virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
networkids=[str(self.network.id)]
|
||||
)
|
||||
|
|
@ -1127,8 +1127,8 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
src_nat_list = PublicIPAddress.list(
|
||||
self.apiclient,
|
||||
associatednetworkid=self.network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True,
|
||||
issourcenat=True,
|
||||
)
|
||||
|
|
@ -1153,7 +1153,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=src_nat.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
|
||||
self.debug(
|
||||
|
|
@ -1213,18 +1213,18 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.debug("Associating public IP for network: %s" % self.network.id)
|
||||
ip_with_nat_rule = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
self.debug("Associated %s with network %s" % (
|
||||
ip_with_nat_rule.ipaddress.ipaddress,
|
||||
ip_with_nat_rule.ipaddress,
|
||||
self.network.id
|
||||
))
|
||||
self.debug("Creating PF rule for IP address: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
NATRule.create(
|
||||
self.apiclient,
|
||||
virtual_machine,
|
||||
|
|
@ -1233,7 +1233,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
)
|
||||
|
||||
self.debug("Trying to create LB rule on IP with NAT: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
|
||||
# Create Load Balancer rule on IP already having NAT rule
|
||||
with self.assertRaises(Exception):
|
||||
|
|
@ -1241,7 +1241,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=ip_with_nat_rule.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Creating PF rule with public port: 66")
|
||||
|
||||
|
|
@ -1267,28 +1267,28 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.debug("Associating public IP for network: %s" % self.network.id)
|
||||
ip_with_lb_rule = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
zoneid=self.zone.id,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
networkid=self.network.id
|
||||
)
|
||||
self.debug("Associated %s with network %s" % (
|
||||
ip_with_lb_rule.ipaddress.ipaddress,
|
||||
ip_with_lb_rule.ipaddress,
|
||||
self.network.id
|
||||
))
|
||||
self.debug("Creating LB rule for IP address: %s" %
|
||||
ip_with_lb_rule.ipaddress.ipaddress)
|
||||
ip_with_lb_rule.ipaddress)
|
||||
|
||||
LoadBalancerRule.create(
|
||||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=ip_with_lb_rule.ipaddress.id,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
self.debug("Trying to create PF rule on IP with LB rule: %s" %
|
||||
ip_with_nat_rule.ipaddress.ipaddress)
|
||||
ip_with_nat_rule.ipaddress)
|
||||
|
||||
with self.assertRaises(Exception):
|
||||
NATRule.create(
|
||||
|
|
@ -1314,7 +1314,7 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule_port_2221"],
|
||||
ipaddressid=ip_with_lb_rule.ipaddress.id,
|
||||
accountid=self.account.account.name,
|
||||
accountid=self.account.name,
|
||||
networkid=self.network.id
|
||||
)
|
||||
|
||||
|
|
@ -1336,8 +1336,8 @@ class TestNOWithNetscaler(cloudstackTestCase):
|
|||
vpn = Vpn.create(
|
||||
self.apiclient,
|
||||
src_nat.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
vpns = Vpn.list(
|
||||
|
|
@ -1457,21 +1457,21 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
self.network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.debug("Created network with ID: %s" % self.network.id)
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Spawn an instance in that network
|
||||
virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
networkids=[str(self.network.id)]
|
||||
)
|
||||
|
|
@ -1480,8 +1480,8 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
src_nat_list = PublicIPAddress.list(
|
||||
self.apiclient,
|
||||
associatednetworkid=self.network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True,
|
||||
issourcenat=True,
|
||||
)
|
||||
|
|
@ -1504,7 +1504,7 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=src_nat.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Created LB rule on source NAT: %s" % src_nat.ipaddress)
|
||||
|
||||
|
|
@ -1585,8 +1585,8 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
vpn = Vpn.create(
|
||||
self.apiclient,
|
||||
src_nat.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
vpns = Vpn.list(
|
||||
|
|
@ -1657,21 +1657,21 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
self.network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.debug("Created network with ID: %s" % self.network.id)
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Spawn an instance in that network
|
||||
virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
networkids=[str(self.network.id)]
|
||||
)
|
||||
|
|
@ -1680,8 +1680,8 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
src_nat_list = PublicIPAddress.list(
|
||||
self.apiclient,
|
||||
associatednetworkid=self.network.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
listall=True,
|
||||
issourcenat=True,
|
||||
)
|
||||
|
|
@ -1704,7 +1704,7 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
ipaddressid=src_nat.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Created LB rule on source NAT: %s" % src_nat.ipaddress)
|
||||
|
||||
|
|
@ -1785,8 +1785,8 @@ class TestNetworkUpgrade(cloudstackTestCase):
|
|||
vpn = Vpn.create(
|
||||
self.apiclient,
|
||||
src_nat.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
vpns = Vpn.list(
|
||||
|
|
@ -1921,21 +1921,21 @@ class TestSharedNetworkWithoutIp(cloudstackTestCase):
|
|||
self.network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=shared_nw_off.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.debug("Created network with ID: %s" % self.network.id)
|
||||
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
try:
|
||||
# Spawn an instance in that network
|
||||
VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
networkids=[str(self.network.id)]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -206,8 +206,8 @@ class TestUserProjectCreation(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -373,8 +373,8 @@ class TestProjectCreationNegative(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -498,8 +498,8 @@ class TestProjectInviteRequired(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -650,8 +650,8 @@ class TestProjectInviteRequiredTrue(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -819,8 +819,8 @@ class TestProjectInviteTimeout(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -945,8 +945,8 @@ class TestProjectInviteTimeout(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -1076,8 +1076,8 @@ class TestProjectInviteTimeout(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -1205,8 +1205,8 @@ class TestProjectInviteTimeout(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -1333,8 +1333,8 @@ class TestProjectInviteTimeout(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
|
|||
|
|
@ -505,10 +505,10 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
# Create Service offering and disk offerings etc
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -720,7 +720,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||
projectid=self.project.id
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
|
|
@ -843,7 +843,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||
)
|
||||
self.debug(
|
||||
"Updating template resource limits for domain: %s" %
|
||||
self.account.account.domainid)
|
||||
self.account.domainid)
|
||||
# Set usage_vm=1 for Account 1
|
||||
update_resource_limit(
|
||||
self.apiclient,
|
||||
|
|
@ -852,7 +852,7 @@ class TestResourceLimitsProject(cloudstackTestCase):
|
|||
projectid=self.project.id
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
|
|
@ -994,13 +994,13 @@ class TestMaxProjectNetworks(cloudstackTestCase):
|
|||
# 3. Create network should fail
|
||||
|
||||
self.debug("Creating project with '%s' as admin" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
# Create project as a domain admin
|
||||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
|
|||
|
|
@ -220,8 +220,8 @@ class TestOfferings(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -263,8 +263,8 @@ class TestOfferings(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -400,8 +400,8 @@ class TestNetwork(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -546,10 +546,10 @@ class TestTemplates(cloudstackTestCase):
|
|||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
# Create Service offering and disk offerings etc
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -771,10 +771,10 @@ class TestSnapshots(cloudstackTestCase):
|
|||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
# Create Service offering and disk offerings etc
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -872,8 +872,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
|
||||
snapshots = Snapshot.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
snapshots,
|
||||
|
|
@ -918,10 +918,10 @@ class TestPublicIpAddress(cloudstackTestCase):
|
|||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
# Create Service offering and disk offerings etc
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -1037,7 +1037,7 @@ class TestPublicIpAddress(cloudstackTestCase):
|
|||
|
||||
#Create Load Balancer rule and assign VMs to rule
|
||||
self.debug("Created LB rule for public IP: %s" %
|
||||
public_ip.ipaddress.ipaddress)
|
||||
public_ip.ipaddress)
|
||||
lb_rule = LoadBalancerRule.create(
|
||||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
|
|
@ -1112,13 +1112,13 @@ class TestPublicIpAddress(cloudstackTestCase):
|
|||
"Check end port of firewall rule"
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
)
|
||||
self.cleanup.append(virtual_machine_1)
|
||||
|
|
@ -1142,17 +1142,17 @@ class TestPublicIpAddress(cloudstackTestCase):
|
|||
)
|
||||
|
||||
self.debug("Creating LB rule for public IP: %s outside project" %
|
||||
public_ip.ipaddress.ipaddress)
|
||||
public_ip.ipaddress)
|
||||
with self.assertRaises(Exception):
|
||||
LoadBalancerRule.create(
|
||||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
public_ip.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug(
|
||||
"Creating firewall rule for public IP: %s outside project" %
|
||||
public_ip.ipaddress.ipaddress)
|
||||
public_ip.ipaddress)
|
||||
with self.assertRaises(Exception):
|
||||
FireWallRule.create(
|
||||
self.apiclient,
|
||||
|
|
@ -1219,10 +1219,10 @@ class TestSecurityGroup(cloudstackTestCase):
|
|||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls._cleanup = [
|
||||
cls.project,
|
||||
|
|
@ -1317,8 +1317,8 @@ class TestSecurityGroup(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
serviceofferingid=self.service_offering.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
securitygroupids=[security_group.id],
|
||||
)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -142,13 +142,13 @@ class TestVmUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -337,13 +337,13 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -416,7 +416,7 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||
# 3. Delete the newly created account
|
||||
|
||||
self.debug("Deleting public IP: %s" %
|
||||
self.public_ip.ipaddress.ipaddress)
|
||||
self.public_ip.ipaddress)
|
||||
|
||||
# Release one of the IP
|
||||
self.public_ip.delete(self.apiclient)
|
||||
|
|
@ -512,13 +512,13 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -689,13 +689,13 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -858,12 +858,12 @@ class TestISOUsage(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.iso = Iso.create(
|
||||
|
|
@ -1014,13 +1014,13 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -1198,13 +1198,13 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -1375,13 +1375,13 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -1559,13 +1559,13 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -1648,7 +1648,7 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
)
|
||||
|
||||
self.debug("Created VPN user for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
|
||||
vpnuser = VpnUser.create(
|
||||
self.apiclient,
|
||||
|
|
|
|||
|
|
@ -183,8 +183,8 @@ class TestMultipleProjectCreation(cloudstackTestCase):
|
|||
project_1 = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project_1)
|
||||
|
|
@ -218,8 +218,8 @@ class TestMultipleProjectCreation(cloudstackTestCase):
|
|||
project_2 = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project_2)
|
||||
|
|
@ -398,8 +398,8 @@ class TestCrossDomainAccountAdd(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -519,8 +519,8 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -555,7 +555,7 @@ class TestDeleteAccountWithProject(cloudstackTestCase):
|
|||
with self.assertRaises(Exception):
|
||||
self.account.delete(self.apiclient)
|
||||
self.debug("Deleting account %s failed!" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
return
|
||||
|
||||
|
||||
|
|
@ -635,8 +635,8 @@ class TestDeleteDomainWithProject(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.debug("Created project with domain admin with ID: %s" %
|
||||
|
|
@ -1215,8 +1215,8 @@ class TestProjectResources(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.cleanup.append(project)
|
||||
|
|
@ -1331,8 +1331,8 @@ class TestProjectResources(cloudstackTestCase):
|
|||
project = Project.create(
|
||||
self.apiclient,
|
||||
self.services["project"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Cleanup created project at end of test
|
||||
self.debug("Created project with domain admin with ID: %s" %
|
||||
|
|
@ -1496,8 +1496,8 @@ class TestProjectSuspendActivate(cloudstackTestCase):
|
|||
cls.project = Project.create(
|
||||
cls.api_client,
|
||||
cls.services["project"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
|
||||
cls._cleanup = [
|
||||
|
|
|
|||
|
|
@ -902,7 +902,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
# Create Service offering and disk offerings etc
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
|
|
@ -957,22 +957,22 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
|
||||
self.debug(
|
||||
"Updating instance resource limits for domain: %s" %
|
||||
self.account.account.domainid)
|
||||
self.account.domainid)
|
||||
# Set usage_vm=1 for Account 1
|
||||
update_resource_limit(
|
||||
self.apiclient,
|
||||
0, # Instance
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
max=2
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.cleanup.append(virtual_machine_1)
|
||||
|
|
@ -982,13 +982,13 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
'Running',
|
||||
"Check VM state is Running or not"
|
||||
)
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_2 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.cleanup.append(virtual_machine_2)
|
||||
|
|
@ -1005,7 +1005,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account_1.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
return
|
||||
|
|
@ -1025,22 +1025,22 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
|
||||
self.debug(
|
||||
"Updating public IP resource limits for domain: %s" %
|
||||
self.account.account.domainid)
|
||||
self.account.domainid)
|
||||
# Set usage_vm=1 for Account 1
|
||||
update_resource_limit(
|
||||
self.apiclient,
|
||||
1, # Public Ip
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
max=2
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.cleanup.append(virtual_machine_1)
|
||||
|
|
@ -1050,7 +1050,7 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
'Running',
|
||||
"Check VM state is Running or not"
|
||||
)
|
||||
self.debug("Associating public IP for account: %s" % self.account.account.name)
|
||||
self.debug("Associating public IP for account: %s" % self.account.name)
|
||||
public_ip_1 = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
virtual_machine_1.account,
|
||||
|
|
@ -1097,22 +1097,22 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
|
||||
self.debug(
|
||||
"Updating snapshot resource limits for domain: %s" %
|
||||
self.account.account.domainid)
|
||||
self.account.domainid)
|
||||
# Set usage_vm=1 for Account 1
|
||||
update_resource_limit(
|
||||
self.apiclient,
|
||||
3, # Snapshot
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
max=1
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.cleanup.append(virtual_machine_1)
|
||||
|
|
@ -1141,8 +1141,8 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
# Create a snapshot from the ROOTDISK
|
||||
snapshot_1 = Snapshot.create(self.apiclient,
|
||||
volumes[0].id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.cleanup.append(snapshot_1)
|
||||
# Verify Snapshot state
|
||||
|
|
@ -1159,8 +1159,8 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
with self.assertRaises(Exception):
|
||||
Snapshot.create(self.apiclient,
|
||||
volumes[0].id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
return
|
||||
|
||||
|
|
@ -1179,22 +1179,22 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
|
||||
self.debug(
|
||||
"Updating volume resource limits for domain: %s" %
|
||||
self.account.account.domainid)
|
||||
self.account.domainid)
|
||||
# Set usage_vm=1 for Account 1
|
||||
update_resource_limit(
|
||||
self.apiclient,
|
||||
2, # Volume
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
max=2
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.cleanup.append(virtual_machine_1)
|
||||
|
|
@ -1211,8 +1211,8 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["volume"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
return
|
||||
|
|
@ -1234,28 +1234,28 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
update_resource_limit(
|
||||
self.apiclient,
|
||||
2, # Volume
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
max=5
|
||||
)
|
||||
|
||||
self.debug(
|
||||
"Updating template resource limits for domain: %s" %
|
||||
self.account.account.domainid)
|
||||
self.account.domainid)
|
||||
# Set usage_vm=1 for Account 1
|
||||
update_resource_limit(
|
||||
self.apiclient,
|
||||
4, # Template
|
||||
domainid=self.account.account.domainid,
|
||||
domainid=self.account.domainid,
|
||||
max=2
|
||||
)
|
||||
|
||||
self.debug("Deploying VM for account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM for account: %s" % self.account.name)
|
||||
virtual_machine_1 = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.cleanup.append(virtual_machine_1)
|
||||
|
|
@ -1286,8 +1286,8 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["template"],
|
||||
volumeid=volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.cleanup.append(template_1)
|
||||
|
|
@ -1303,8 +1303,8 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["template"],
|
||||
volumeid=volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.cleanup.append(template_2)
|
||||
|
|
@ -1321,8 +1321,8 @@ class TestResourceLimitsDomain(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["template"],
|
||||
volumeid=volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
return
|
||||
|
||||
|
|
@ -1432,8 +1432,8 @@ class TestMaxAccountNetworks(cloudstackTestCase):
|
|||
network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
|
|
@ -1446,8 +1446,8 @@ class TestMaxAccountNetworks(cloudstackTestCase):
|
|||
Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
networkofferingid=self.network_offering.id,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
|
|
|
|||
|
|
@ -127,16 +127,16 @@ class TestRouterServices(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=cls.template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.vm_2 = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=cls.template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.cleanup = [
|
||||
|
|
@ -189,8 +189,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -216,8 +216,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Network state associated with account should be 'Implemented'
|
||||
networks = list_networks(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(networks, list),
|
||||
|
|
@ -243,8 +243,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# VM state associated with account should be 'Running'
|
||||
virtual_machines = list_virtual_machines(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -271,8 +271,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Check status of DNS, DHCP, FIrewall, LB VPN processes
|
||||
networks = list_networks(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(networks, list),
|
||||
|
|
@ -332,8 +332,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -360,8 +360,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Network state associated with account should be 'Implemented'
|
||||
networks = list_networks(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(networks, list),
|
||||
|
|
@ -387,8 +387,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# VM state associated with account should be 'Running'
|
||||
virtual_machines = list_virtual_machines(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -445,8 +445,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -488,8 +488,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed a VM with ID: %s" % vm.id)
|
||||
|
|
@ -497,8 +497,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
virtual_machines = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=vm.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -522,8 +522,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -554,8 +554,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
virtual_machines = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=self.vm_1.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -615,8 +615,8 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.cleanup = [
|
||||
|
|
@ -668,8 +668,8 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||
# Get router details associated for that account
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -693,8 +693,8 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(routers, list),
|
||||
|
|
@ -711,8 +711,8 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||
|
||||
public_ips = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.assertEqual(
|
||||
|
|
@ -749,8 +749,8 @@ class TestRouterStopCreatePF(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
zoneid=self.zone.id
|
||||
)
|
||||
self.assertEqual(
|
||||
|
|
@ -827,8 +827,8 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.cleanup = [
|
||||
|
|
@ -874,8 +874,8 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||
# Get router details associated for that account
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -900,8 +900,8 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(routers, list),
|
||||
|
|
@ -918,8 +918,8 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||
|
||||
public_ips = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(public_ips, list),
|
||||
|
|
@ -943,7 +943,7 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
public_ip.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.debug("Assigning VM %s to LB rule: %s" % (
|
||||
self.vm_1.id,
|
||||
|
|
@ -958,8 +958,8 @@ class TestRouterStopCreateLB(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(routers, list),
|
||||
|
|
@ -1038,8 +1038,8 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.cleanup = [
|
||||
|
|
@ -1084,8 +1084,8 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||
# Get the router details associated with account
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -1110,8 +1110,8 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(routers, list),
|
||||
|
|
@ -1128,8 +1128,8 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||
|
||||
public_ips = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(public_ips, list),
|
||||
|
|
@ -1157,8 +1157,8 @@ class TestRouterStopCreateFW(cloudstackTestCase):
|
|||
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(routers, list),
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||
admin=True,
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
|
|
@ -178,8 +178,8 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM with ID: %s" % self.virtual_machine.id)
|
||||
|
|
@ -222,7 +222,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||
# Verify List Routers response for account
|
||||
self.debug(
|
||||
"Verify list routers response for account: %s" \
|
||||
% self.account.account.name
|
||||
% self.account.name
|
||||
)
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
|
|
@ -256,8 +256,8 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -292,8 +292,8 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Deployed VM with ID: %s" % self.virtual_machine.id)
|
||||
|
|
@ -336,8 +336,8 @@ class TestDefaultSecurityGroup(cloudstackTestCase):
|
|||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -416,7 +416,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -450,15 +450,15 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -475,8 +475,8 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule, dict),
|
||||
|
|
@ -489,12 +489,12 @@ class TestAuthorizeIngressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
# Should be able to SSH VM
|
||||
try:
|
||||
self.debug("SSH into VM: %s" % self.virtual_machine.id)
|
||||
|
|
@ -552,7 +552,7 @@ class TestRevokeIngressRule(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -587,16 +587,16 @@ class TestRevokeIngressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -615,8 +615,8 @@ class TestRevokeIngressRule(cloudstackTestCase):
|
|||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -629,12 +629,12 @@ class TestRevokeIngressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Should be able to SSH VM
|
||||
try:
|
||||
|
|
@ -712,12 +712,12 @@ class TestDhcpOnlyRouter(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -849,7 +849,7 @@ class TestdeployVMWithUserData(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
cls.service_offering
|
||||
|
|
@ -897,15 +897,15 @@ class TestdeployVMWithUserData(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -922,15 +922,15 @@ class TestdeployVMWithUserData(cloudstackTestCase):
|
|||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule, dict),
|
||||
|
|
@ -940,12 +940,12 @@ class TestdeployVMWithUserData(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
# Should be able to SSH VM
|
||||
try:
|
||||
self.debug(
|
||||
|
|
@ -1009,7 +1009,7 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
self.services["account"],
|
||||
domainid=self.domain.id
|
||||
)
|
||||
self.services["account"] = self.account.account.name
|
||||
self.services["account"] = self.account.name
|
||||
self.cleanup = [
|
||||
self.account,
|
||||
self.service_offering
|
||||
|
|
@ -1059,15 +1059,15 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -1084,15 +1084,15 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule, dict),
|
||||
|
|
@ -1103,12 +1103,12 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Deleting Security group should raise exception
|
||||
security_group.delete(self.apiclient)
|
||||
|
|
@ -1143,15 +1143,15 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -1168,14 +1168,14 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule, dict),
|
||||
|
|
@ -1186,12 +1186,12 @@ class TestDeleteSecurityGroup(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# Destroy the VM
|
||||
self.virtual_machine.delete(self.apiclient)
|
||||
|
|
@ -1255,7 +1255,7 @@ class TestIngressRule(cloudstackTestCase):
|
|||
self.services["account"],
|
||||
domainid=self.domain.id
|
||||
)
|
||||
self.services["account"] = self.account.account.name
|
||||
self.services["account"] = self.account.name
|
||||
self.cleanup = [
|
||||
self.account,
|
||||
self.service_offering
|
||||
|
|
@ -1305,15 +1305,15 @@ class TestIngressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -1329,15 +1329,15 @@ class TestIngressRule(cloudstackTestCase):
|
|||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule_1 = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule_1, dict),
|
||||
|
|
@ -1347,25 +1347,25 @@ class TestIngressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
self.debug(
|
||||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule_2 = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group_2"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule_2, dict),
|
||||
|
|
@ -1421,16 +1421,16 @@ class TestIngressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -1447,15 +1447,15 @@ class TestIngressRule(cloudstackTestCase):
|
|||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule, dict),
|
||||
|
|
@ -1465,26 +1465,26 @@ class TestIngressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
self.debug(
|
||||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule_2 = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group_2"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule_2, dict),
|
||||
|
|
@ -1528,7 +1528,7 @@ class TestIngressRule(cloudstackTestCase):
|
|||
"Revoke Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
result = security_group.revoke(
|
||||
|
|
@ -1573,15 +1573,15 @@ class TestIngressRule(cloudstackTestCase):
|
|||
security_group = SecurityGroup.create(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created security group with ID: %s" % security_group.id)
|
||||
# Default Security group should not have any ingress rule
|
||||
sercurity_groups = SecurityGroup.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(sercurity_groups, list),
|
||||
|
|
@ -1599,15 +1599,15 @@ class TestIngressRule(cloudstackTestCase):
|
|||
"Authorize Ingress Rule for Security Group %s for account: %s" \
|
||||
% (
|
||||
security_group.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
# Authorize Security group to SSH to VM
|
||||
ingress_rule = security_group.authorize(
|
||||
self.apiclient,
|
||||
self.services["security_group"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(ingress_rule, dict),
|
||||
|
|
@ -1618,12 +1618,12 @@ class TestIngressRule(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
securitygroupids=[security_group.id]
|
||||
)
|
||||
self.debug("Deploying VM in account: %s" % self.account.account.name)
|
||||
self.debug("Deploying VM in account: %s" % self.account.name)
|
||||
|
||||
# SSH should be allowed on 22 port
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class TestSnapshotRootDisk(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -163,8 +163,8 @@ class TestSnapshotRootDisk(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server_without_disk"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -220,8 +220,8 @@ class TestSnapshotRootDisk(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
volumes[0].id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Snapshot created: ID - %s" % snapshot.id)
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ class TestSnapshots(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -395,8 +395,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server_with_disk"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -405,8 +405,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server_without_disk"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -462,8 +462,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
volume[0].id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
snapshots = list_snapshots(
|
||||
self.apiclient,
|
||||
|
|
@ -663,8 +663,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
volume_response.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Created Snapshot from volume: %s" % volume_response.id)
|
||||
|
||||
|
|
@ -674,8 +674,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
snapshot.id,
|
||||
self.services,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
volumes = list_volumes(
|
||||
|
|
@ -789,8 +789,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
volumes[0].id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
snapshot.delete(self.apiclient)
|
||||
|
||||
|
|
@ -1079,8 +1079,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.debug("Snapshot created from volume ID: %s" % volume.id)
|
||||
|
|
@ -1118,8 +1118,8 @@ class TestSnapshots(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server_without_disk"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
mode=self.services["mode"]
|
||||
)
|
||||
|
|
@ -1209,7 +1209,7 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -1269,8 +1269,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Created VM with ID: %s" % self.virtual_machine.id)
|
||||
|
|
@ -1359,8 +1359,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.debug("Created VM with ID: %s from template: %s" % (
|
||||
|
|
@ -1373,8 +1373,8 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase):
|
|||
virtual_machines = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=new_virtual_machine.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(virtual_machines, list),
|
||||
|
|
@ -1505,7 +1505,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -1515,8 +1515,8 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
# Get the Root disk of VM
|
||||
|
|
@ -1577,7 +1577,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||
|
||||
accounts = list_accounts(
|
||||
self.apiclient,
|
||||
id=self.account.account.id
|
||||
id=self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(accounts, list),
|
||||
|
|
@ -1737,7 +1737,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||
"Check snapshot UUID in secondary storage and database"
|
||||
)
|
||||
|
||||
self.debug("Deleting account: %s" % self.account.account.name)
|
||||
self.debug("Deleting account: %s" % self.account.name)
|
||||
# Delete account
|
||||
self.account.delete(self.apiclient)
|
||||
|
||||
|
|
@ -1757,7 +1757,7 @@ class TestAccountSnapshotClean(cloudstackTestCase):
|
|||
|
||||
accounts = list_accounts(
|
||||
self.apiclient,
|
||||
id=self.account.account.id
|
||||
id=self.account.id
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -1859,7 +1859,7 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -1869,8 +1869,8 @@ class TestSnapshotDetachedDisk(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -2142,7 +2142,7 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -2152,8 +2152,8 @@ class TestSnapshotLimit(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -2401,7 +2401,7 @@ class TestSnapshotEvents(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -2411,8 +2411,8 @@ class TestSnapshotEvents(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
|
||||
|
|
@ -2498,8 +2498,8 @@ class TestSnapshotEvents(cloudstackTestCase):
|
|||
time.sleep(self.services["sleep"])
|
||||
events = list_events(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
type='SNAPSHOT.DELETE'
|
||||
)
|
||||
self.assertEqual(
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ class TestStorageMotion(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["small"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.small_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls._cleanup = [
|
||||
cls.account,
|
||||
|
|
@ -183,8 +183,8 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
v,
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug(
|
||||
"Registered a template of format: %s with ID: %s" % (
|
||||
|
|
@ -205,8 +205,8 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
self.services["templatefilter"],
|
||||
id=template.id,
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
if isinstance(list_template_response, list):
|
||||
break
|
||||
|
|
@ -240,8 +240,8 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
mode=self.services["mode"]
|
||||
)
|
||||
|
|
@ -249,8 +249,8 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
vm_response = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=virtual_machine.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(vm_response, list),
|
||||
|
|
@ -304,7 +304,7 @@ class TestTemplates(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -315,8 +315,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
)
|
||||
#Stop virtual machine
|
||||
|
|
@ -396,8 +396,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
)
|
||||
|
||||
|
|
@ -406,8 +406,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
vm_response = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=virtual_machine.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
#Verify VM response to check whether VM deployment was successful
|
||||
self.assertNotEqual(
|
||||
|
|
@ -591,8 +591,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
snapshot = Snapshot.create(
|
||||
self.apiclient,
|
||||
volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("Creating a template from snapshot: %s" % snapshot.id)
|
||||
# Generate template from the snapshot
|
||||
|
|
@ -626,8 +626,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
)
|
||||
self.cleanup.append(virtual_machine)
|
||||
|
|
@ -635,8 +635,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
vm_response = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=virtual_machine.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(vm_response, list),
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class TestVmUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -145,8 +145,8 @@ class TestVmUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -202,11 +202,11 @@ class TestVmUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -319,7 +319,7 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -329,8 +329,8 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
|
||||
|
|
@ -382,18 +382,18 @@ class TestPublicIPUsage(cloudstackTestCase):
|
|||
# 3. Delete the newly created account
|
||||
|
||||
self.debug("Deleting public IP: %s" %
|
||||
self.public_ip.ipaddress.ipaddress)
|
||||
self.public_ip.ipaddress)
|
||||
|
||||
# Release one of the IP
|
||||
self.public_ip.delete(self.apiclient)
|
||||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -474,7 +474,7 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -484,8 +484,8 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -562,11 +562,11 @@ class TestVolumeUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -640,7 +640,7 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -651,8 +651,8 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -726,11 +726,11 @@ class TestTemplateUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -801,12 +801,12 @@ class TestISOUsage(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.iso = Iso.create(
|
||||
cls.api_client,
|
||||
cls.services["iso"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
try:
|
||||
# Wait till ISO gets downloaded
|
||||
|
|
@ -862,11 +862,11 @@ class TestISOUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -946,7 +946,7 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -956,8 +956,8 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.public_ip_1 = PublicIPAddress.create(
|
||||
|
|
@ -1016,7 +1016,7 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
self.public_ip_1.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
# Delete LB Rule
|
||||
self.debug("Deleting LB rule with ID: %s" % lb_rule.id)
|
||||
|
|
@ -1024,11 +1024,11 @@ class TestLBRuleUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -1109,7 +1109,7 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -1119,8 +1119,8 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -1190,11 +1190,11 @@ class TestSnapshotUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -1275,7 +1275,7 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -1285,8 +1285,8 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.public_ip_1 = PublicIPAddress.create(
|
||||
|
|
@ -1354,11 +1354,11 @@ class TestNatRuleUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
@ -1438,7 +1438,7 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -1448,8 +1448,8 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.public_ip = PublicIPAddress.create(
|
||||
|
|
@ -1506,19 +1506,19 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
vpn = Vpn.create(
|
||||
self.apiclient,
|
||||
self.public_ip.ipaddress.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.debug("Created VPN user for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
|
||||
vpnuser = VpnUser.create(
|
||||
self.apiclient,
|
||||
self.services["vpn_user"]["username"],
|
||||
self.services["vpn_user"]["password"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
# Remove VPN user
|
||||
|
|
@ -1531,11 +1531,11 @@ class TestVpnUsage(cloudstackTestCase):
|
|||
|
||||
# Fetch account ID from account_uuid
|
||||
self.debug("select id from account where uuid = '%s';" \
|
||||
% self.account.account.id)
|
||||
% self.account.id)
|
||||
|
||||
qresultset = self.dbclient.execute(
|
||||
"select id from account where uuid = '%s';" \
|
||||
% self.account.account.id
|
||||
% self.account.id
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(qresultset, list),
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ class TestVMPasswordEnabled(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["small"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.small_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -159,8 +159,8 @@ class TestVMPasswordEnabled(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["template"],
|
||||
cls.volume.id,
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
# Delete the VM - No longer needed
|
||||
cls.virtual_machine.delete(cls.api_client)
|
||||
|
|
@ -169,8 +169,8 @@ class TestVMPasswordEnabled(cloudstackTestCase):
|
|||
cls.vm = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["small"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.small_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class TestAttachVolume(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -129,8 +129,8 @@ class TestAttachVolume(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -162,13 +162,13 @@ class TestAttachVolume(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["volume"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Created volume: %s for account: %s" % (
|
||||
volume.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
# Check List Volume response for newly created volume
|
||||
list_volume_response = list_volumes(
|
||||
|
|
@ -311,13 +311,13 @@ class TestAttachVolume(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["volume"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Created volume: %s for account: %s" % (
|
||||
volume.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
# Check List Volume response for newly created volume
|
||||
list_volume_response = list_volumes(
|
||||
|
|
@ -392,7 +392,7 @@ class TestAttachDetachVolume(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -400,8 +400,8 @@ class TestAttachDetachVolume(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -449,13 +449,13 @@ class TestAttachDetachVolume(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["volume"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Created volume: %s for account: %s" % (
|
||||
volume.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
self.cleanup.append(volume)
|
||||
volumes.append(volume)
|
||||
|
|
@ -639,7 +639,7 @@ class TestAttachVolumeISO(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -647,8 +647,8 @@ class TestAttachVolumeISO(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -694,13 +694,13 @@ class TestAttachVolumeISO(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["volume"],
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Created volume: %s for account: %s" % (
|
||||
volume.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
# Check List Volume response for newly created volume
|
||||
list_volume_response = list_volumes(
|
||||
|
|
@ -749,12 +749,12 @@ class TestAttachVolumeISO(cloudstackTestCase):
|
|||
iso = Iso.create(
|
||||
self.apiclient,
|
||||
self.services["iso"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.debug("Created ISO with ID: %s for account: %s" % (
|
||||
iso.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
))
|
||||
|
||||
try:
|
||||
|
|
@ -831,7 +831,7 @@ class TestVolumes(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -839,8 +839,8 @@ class TestVolumes(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
)
|
||||
|
||||
|
|
@ -848,8 +848,8 @@ class TestVolumes(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["volume"],
|
||||
zoneid=cls.zone.id,
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
diskofferingid=cls.disk_offering.id
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -1071,7 +1071,7 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -1137,8 +1137,8 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
|
|||
Volume.create_custom_disk(
|
||||
self.apiclient,
|
||||
self.services["custom_volume"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Create volume failed!")
|
||||
|
|
@ -1149,8 +1149,8 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
|
|||
Volume.create_custom_disk(
|
||||
self.apiclient,
|
||||
self.services["custom_volume"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Create volume failed!")
|
||||
|
|
@ -1163,8 +1163,8 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase):
|
|||
Volume.create_custom_disk(
|
||||
self.apiclient,
|
||||
self.services["custom_volume"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Create volume of cust disk size succeeded")
|
||||
|
|
|
|||
|
|
@ -138,8 +138,8 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["virtual_machine"],
|
||||
templateid=self.template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
self.public_ip = PublicIPAddress.create(
|
||||
|
|
@ -170,8 +170,8 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
# Assign VPN to Public IP
|
||||
vpn = Vpn.create(self.apiclient,
|
||||
self.public_ip.ipaddress.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid)
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid)
|
||||
|
||||
self.debug("Verifying the remote VPN access")
|
||||
vpns = Vpn.list(self.apiclient,
|
||||
|
|
@ -190,7 +190,7 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
"""Creates VPN users for the network"""
|
||||
|
||||
self.debug("Creating VPN users for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
if api_client is None:
|
||||
api_client = self.apiclient
|
||||
try:
|
||||
|
|
@ -198,8 +198,8 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
api_client,
|
||||
self.services["vpn_user"]["username"],
|
||||
self.services["vpn_user"]["password"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
rand_name=rand_name
|
||||
)
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
limit = int(configs[0].value)
|
||||
|
||||
self.debug("Enabling the VPN access for IP: %s" %
|
||||
self.public_ip.ipaddress.ipaddress)
|
||||
self.public_ip.ipaddress)
|
||||
|
||||
self.create_VPN(self.public_ip)
|
||||
self.debug("Creating %s VPN users" % limit)
|
||||
|
|
@ -278,7 +278,7 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
"List NAT rules should return a valid response")
|
||||
|
||||
self.debug("Enabling the VPN connection for IP: %s" %
|
||||
self.public_ip.ipaddress.ipaddress)
|
||||
self.public_ip.ipaddress)
|
||||
with self.assertRaises(Exception):
|
||||
self.create_VPN(self.public_ip)
|
||||
self.debug("Create VPN connection failed! Test successful!")
|
||||
|
|
@ -295,7 +295,7 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
# saying that VPN is enabled over port 1701
|
||||
|
||||
self.debug("Enabling the VPN connection for IP: %s" %
|
||||
self.public_ip.ipaddress.ipaddress)
|
||||
self.public_ip.ipaddress)
|
||||
self.create_VPN(self.public_ip)
|
||||
|
||||
self.debug("Creating a port forwarding rule on port 1701")
|
||||
|
|
@ -321,12 +321,12 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
# the newly added user credential.
|
||||
|
||||
self.debug("Enabling the VPN connection for IP: %s" %
|
||||
self.public_ip.ipaddress.ipaddress)
|
||||
self.public_ip.ipaddress)
|
||||
self.create_VPN(self.public_ip)
|
||||
|
||||
try:
|
||||
self.debug("Adding new VPN user to account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
self.create_VPN_Users()
|
||||
|
||||
# TODO: Verify the VPN connection
|
||||
|
|
@ -348,11 +348,11 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
# 3. Adding this VPN user should fail.
|
||||
|
||||
self.debug("Enabling the VPN connection for IP: %s" %
|
||||
self.public_ip.ipaddress.ipaddress)
|
||||
self.public_ip.ipaddress)
|
||||
self.create_VPN(self.public_ip)
|
||||
|
||||
self.debug("Adding new VPN user to account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
self.create_VPN_Users(rand_name=False)
|
||||
|
||||
# TODO: Verify the VPN connection
|
||||
|
|
@ -378,22 +378,22 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
# establish VPN connection that will give access all VMs of this user
|
||||
|
||||
self.debug("Enabling VPN connection to account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
self.create_VPN(self.public_ip)
|
||||
self.debug("Creating VPN user for the account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
self.create_VPN_Users()
|
||||
|
||||
self.debug("Creating a global admin account")
|
||||
admin = Account.create(self.apiclient,
|
||||
self.services["account"],
|
||||
admin=True,
|
||||
domainid=self.account.account.domainid)
|
||||
domainid=self.account.domainid)
|
||||
self.cleanup.append(admin)
|
||||
self.debug("Creating API client for newly created user")
|
||||
api_client = self.testClient.createUserApiClient(
|
||||
UserName=self.account.account.name,
|
||||
DomainName=self.account.account.domain)
|
||||
UserName=self.account.name,
|
||||
DomainName=self.account.domain)
|
||||
|
||||
self.debug("Adding new user to VPN as a global admin: %s" %
|
||||
admin.account.name)
|
||||
|
|
@ -421,21 +421,21 @@ class TestVPNUsers(cloudstackTestCase):
|
|||
# establish VPN connection that will give access all VMs of this user
|
||||
|
||||
self.debug("Enabling VPN connection to account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
self.create_VPN(self.public_ip)
|
||||
self.debug("Creating VPN user for the account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
self.create_VPN_Users()
|
||||
|
||||
self.debug("Creating a domain admin account")
|
||||
admin = Account.create(self.apiclient,
|
||||
self.services["account"],
|
||||
domainid=self.account.account.domainid)
|
||||
domainid=self.account.domainid)
|
||||
self.cleanup.append(admin)
|
||||
self.debug("Creating API client for newly created user")
|
||||
api_client = self.testClient.createUserApiClient(
|
||||
UserName=self.account.account.name,
|
||||
DomainName=self.account.account.domain)
|
||||
UserName=self.account.name,
|
||||
DomainName=self.account.domain)
|
||||
|
||||
self.debug("Adding new user to VPN as a domain admin: %s" %
|
||||
admin.account.name)
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ class TestCreateIso(cloudstackTestCase):
|
|||
iso = Iso.create(
|
||||
self.apiclient,
|
||||
self.services["iso_2"],
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.debug("ISO created with ID: %s" % iso.id)
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ class TestISO(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
# Finding the OsTypeId from Ostype
|
||||
ostypes = list_os_types(
|
||||
cls.api_client,
|
||||
|
|
@ -230,8 +230,8 @@ class TestISO(cloudstackTestCase):
|
|||
cls.iso_1 = Iso.create(
|
||||
cls.api_client,
|
||||
cls.services["iso_1"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
try:
|
||||
cls.iso_1.download(cls.api_client)
|
||||
|
|
@ -242,8 +242,8 @@ class TestISO(cloudstackTestCase):
|
|||
cls.iso_2 = Iso.create(
|
||||
cls.api_client,
|
||||
cls.services["iso_2"],
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
try:
|
||||
cls.iso_2.download(cls.api_client)
|
||||
|
|
@ -448,8 +448,8 @@ class TestISO(cloudstackTestCase):
|
|||
list_iso_response = list_isos(
|
||||
self.apiclient,
|
||||
id=self.iso_2.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_iso_response, list),
|
||||
|
|
|
|||
|
|
@ -145,8 +145,8 @@ class TestPublicIP(cloudstackTestCase):
|
|||
cls.account_network = Network.create(
|
||||
cls.api_client,
|
||||
cls.services["network"],
|
||||
cls.account.account.name,
|
||||
cls.account.account.domainid
|
||||
cls.account.name,
|
||||
cls.account.domainid
|
||||
)
|
||||
cls.user_network = Network.create(
|
||||
cls.api_client,
|
||||
|
|
@ -158,9 +158,9 @@ class TestPublicIP(cloudstackTestCase):
|
|||
# Create Source NAT IP addresses
|
||||
account_src_nat_ip = PublicIPAddress.create(
|
||||
cls.api_client,
|
||||
cls.account.account.name,
|
||||
cls.account.name,
|
||||
cls.zone.id,
|
||||
cls.account.account.domainid
|
||||
cls.account.domainid
|
||||
)
|
||||
user_src_nat_ip = PublicIPAddress.create(
|
||||
cls.api_client,
|
||||
|
|
@ -197,9 +197,9 @@ class TestPublicIP(cloudstackTestCase):
|
|||
|
||||
ip_address = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
self.zone.id,
|
||||
self.account.account.domainid
|
||||
self.account.domainid
|
||||
)
|
||||
list_pub_ip_addr_resp = list_publicIP(
|
||||
self.apiclient,
|
||||
|
|
@ -321,8 +321,8 @@ class TestPortForwarding(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls._cleanup = [
|
||||
|
|
@ -358,8 +358,8 @@ class TestPortForwarding(cloudstackTestCase):
|
|||
|
||||
src_nat_ip_addrs = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -481,9 +481,9 @@ class TestPortForwarding(cloudstackTestCase):
|
|||
|
||||
ip_address = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
self.zone.id,
|
||||
self.account.account.domainid,
|
||||
self.account.domainid,
|
||||
self.services["server"]
|
||||
)
|
||||
self.cleanup.append(ip_address)
|
||||
|
|
@ -554,9 +554,9 @@ class TestPortForwarding(cloudstackTestCase):
|
|||
self.debug("SSHing into VM with IP address %s with NAT IP %s" %
|
||||
(
|
||||
self.virtual_machine.ipaddress,
|
||||
ip_address.ipaddress.ipaddress
|
||||
ip_address.ipaddress
|
||||
))
|
||||
self.virtual_machine.get_ssh_client(ip_address.ipaddress.ipaddress)
|
||||
self.virtual_machine.get_ssh_client(ip_address.ipaddress)
|
||||
except Exception as e:
|
||||
self.fail(
|
||||
"SSH Access failed for %s: %s" % \
|
||||
|
|
@ -581,7 +581,7 @@ class TestPortForwarding(cloudstackTestCase):
|
|||
self.virtual_machine.ipaddress)
|
||||
|
||||
remoteSSHClient(
|
||||
ip_address.ipaddress.ipaddress,
|
||||
ip_address.ipaddress,
|
||||
self.virtual_machine.ssh_port,
|
||||
self.virtual_machine.username,
|
||||
self.virtual_machine.password
|
||||
|
|
@ -621,23 +621,23 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.vm_2 = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.non_src_nat_ip = PublicIPAddress.create(
|
||||
cls.api_client,
|
||||
cls.account.account.name,
|
||||
cls.account.name,
|
||||
cls.zone.id,
|
||||
cls.account.account.domainid,
|
||||
cls.account.domainid,
|
||||
cls.services["server"]
|
||||
)
|
||||
# Open up firewall port for SSH
|
||||
|
|
@ -680,8 +680,8 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
|
||||
src_nat_ip_addrs = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(src_nat_ip_addrs, list),
|
||||
|
|
@ -693,8 +693,8 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
# Check if VM is in Running state before creating LB rule
|
||||
vm_response = VirtualMachine.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -720,7 +720,7 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
src_nat_ip_addr.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.cleanup.append(lb_rule)
|
||||
|
||||
|
|
@ -889,8 +889,8 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
# Check if VM is in Running state before creating LB rule
|
||||
vm_response = VirtualMachine.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -916,7 +916,7 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
self.non_src_nat_ip.ipaddress.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.cleanup.append(lb_rule)
|
||||
|
||||
|
|
@ -974,12 +974,12 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
try:
|
||||
self.debug("SSHing into IP address: %s after adding VMs (ID: %s , %s)" %
|
||||
(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.vm_1.id,
|
||||
self.vm_2.id
|
||||
))
|
||||
ssh_1 = remoteSSHClient(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.services['lbrule']["publicport"],
|
||||
self.vm_1.username,
|
||||
self.vm_1.password
|
||||
|
|
@ -993,12 +993,12 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
|
||||
self.debug("SSHing again into IP address: %s with VMs (ID: %s , %s) added to LB rule" %
|
||||
(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.vm_1.id,
|
||||
self.vm_2.id
|
||||
))
|
||||
ssh_2 = remoteSSHClient(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.services['lbrule']["publicport"],
|
||||
self.vm_1.username,
|
||||
self.vm_1.password
|
||||
|
|
@ -1022,11 +1022,11 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
|
||||
self.debug("SSHing into IP address: %s after removing VM (ID: %s) from LB rule" %
|
||||
(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.vm_2.id
|
||||
))
|
||||
ssh_1 = remoteSSHClient(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.services['lbrule']["publicport"],
|
||||
self.vm_1.username,
|
||||
self.vm_1.password
|
||||
|
|
@ -1036,7 +1036,7 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
self.debug("Hostnames after removing VM2: %s" % str(hostnames))
|
||||
except Exception as e:
|
||||
self.fail("%s: SSH failed for VM with IP Address: %s" %
|
||||
(e, self.non_src_nat_ip.ipaddress.ipaddress))
|
||||
(e, self.non_src_nat_ip.ipaddress))
|
||||
|
||||
self.assertIn(
|
||||
self.vm_1.name,
|
||||
|
|
@ -1048,11 +1048,11 @@ class TestLoadBalancingRule(cloudstackTestCase):
|
|||
with self.assertRaises(Exception):
|
||||
self.fail("SSHing into IP address: %s after removing VM (ID: %s) from LB rule" %
|
||||
(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.vm_1.id
|
||||
))
|
||||
ssh_1 = remoteSSHClient(
|
||||
self.non_src_nat_ip.ipaddress.ipaddress,
|
||||
self.non_src_nat_ip.ipaddress,
|
||||
self.services['lbrule']["publicport"],
|
||||
self.vm_1.username,
|
||||
self.vm_1.password
|
||||
|
|
@ -1093,15 +1093,15 @@ class TestRebootRouter(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
|
||||
src_nat_ip_addrs = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
try:
|
||||
src_nat_ip_addr = src_nat_ip_addrs[0]
|
||||
|
|
@ -1129,7 +1129,7 @@ class TestRebootRouter(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
src_nat_ip_addr.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
)
|
||||
lb_rule.assign(self.apiclient, [self.vm_1])
|
||||
self.nat_rule = NATRule.create(
|
||||
|
|
@ -1159,8 +1159,8 @@ class TestRebootRouter(cloudstackTestCase):
|
|||
#Retrieve router for the user account
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(routers, list),
|
||||
|
|
@ -1254,8 +1254,8 @@ class TestAssignRemoveLB(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
|
||||
|
|
@ -1263,8 +1263,8 @@ class TestAssignRemoveLB(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
|
||||
|
|
@ -1272,8 +1272,8 @@ class TestAssignRemoveLB(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
|
||||
|
|
@ -1297,8 +1297,8 @@ class TestAssignRemoveLB(cloudstackTestCase):
|
|||
|
||||
src_nat_ip_addrs = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(src_nat_ip_addrs, list),
|
||||
|
|
@ -1320,8 +1320,8 @@ class TestAssignRemoveLB(cloudstackTestCase):
|
|||
# Check if VM is in Running state before creating LB rule
|
||||
vm_response = VirtualMachine.list(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
@ -1346,7 +1346,7 @@ class TestAssignRemoveLB(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
self.non_src_nat_ip.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
)
|
||||
lb_rule.assign(self.apiclient, [self.vm_1, self.vm_2])
|
||||
|
||||
|
|
@ -1514,28 +1514,28 @@ class TestReleaseIP(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
|
||||
self.ip_address = PublicIPAddress.create(
|
||||
self.apiclient,
|
||||
self.account.account.name,
|
||||
self.account.name,
|
||||
self.zone.id,
|
||||
self.account.account.domainid
|
||||
self.account.domainid
|
||||
)
|
||||
|
||||
ip_addrs = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
try:
|
||||
self.ip_addr = ip_addrs[0]
|
||||
except Exception as e:
|
||||
raise Exception("Failed: During acquiring source NAT for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
|
||||
self.nat_rule = NATRule.create(
|
||||
self.apiclient,
|
||||
|
|
@ -1547,7 +1547,7 @@ class TestReleaseIP(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
self.ip_addr.id,
|
||||
accountid=self.account.account.name
|
||||
accountid=self.account.name
|
||||
)
|
||||
self.cleanup = [
|
||||
self.virtual_machine,
|
||||
|
|
@ -1652,15 +1652,15 @@ class TestDeleteAccount(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["server"],
|
||||
templateid=template.id,
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id
|
||||
)
|
||||
|
||||
src_nat_ip_addrs = list_publicIP(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
|
||||
try:
|
||||
|
|
@ -1674,7 +1674,7 @@ class TestDeleteAccount(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["lbrule"],
|
||||
src_nat_ip_addr.id,
|
||||
self.account.account.name
|
||||
self.account.name
|
||||
)
|
||||
self.lb_rule.assign(self.apiclient, [self.vm_1])
|
||||
|
||||
|
|
@ -1717,8 +1717,8 @@ class TestDeleteAccount(cloudstackTestCase):
|
|||
try:
|
||||
list_lb_reponse = list_lb_rules(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
list_lb_reponse,
|
||||
|
|
@ -1729,14 +1729,14 @@ class TestDeleteAccount(cloudstackTestCase):
|
|||
|
||||
raise Exception(
|
||||
"Exception raised while fetching LB rules for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
# ListPortForwardingRules should not
|
||||
# list associated rules with deleted account
|
||||
try:
|
||||
list_nat_reponse = list_nat_rules(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
list_nat_reponse,
|
||||
|
|
@ -1747,13 +1747,13 @@ class TestDeleteAccount(cloudstackTestCase):
|
|||
|
||||
raise Exception(
|
||||
"Exception raised while fetching NAT rules for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
#Retrieve router for the user account
|
||||
try:
|
||||
routers = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
routers,
|
||||
|
|
@ -1764,7 +1764,7 @@ class TestDeleteAccount(cloudstackTestCase):
|
|||
|
||||
raise Exception(
|
||||
"Exception raised while fetching routers for account: %s" %
|
||||
self.account.account.name)
|
||||
self.account.name)
|
||||
return
|
||||
|
||||
def tearDown(self):
|
||||
|
|
|
|||
|
|
@ -181,8 +181,8 @@ class TestDeployVM(cloudstackTestCase):
|
|||
self.test_network = Network.create(
|
||||
self.apiclient,
|
||||
self.services["network"],
|
||||
self.account.account.name,
|
||||
self.account.account.domainid,
|
||||
self.account.name,
|
||||
self.account.domainid,
|
||||
)
|
||||
self.cleanup.insert(0, self.test_network)
|
||||
except Exception as ex:
|
||||
|
|
@ -198,8 +198,8 @@ class TestDeployVM(cloudstackTestCase):
|
|||
self.virtual_machine = VirtualMachine.create(
|
||||
self.apiclient,
|
||||
self.services["small"],
|
||||
accountid=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
accountid=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
serviceofferingid=self.service_offering.id,
|
||||
mode=self.services['mode']
|
||||
)
|
||||
|
|
|
|||
|
|
@ -102,8 +102,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id
|
||||
)
|
||||
cls.cleanup = [
|
||||
|
|
@ -143,8 +143,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Find router associated with user account
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -205,8 +205,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Find router associated with user account
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -284,8 +284,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Find router associated with user account
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -302,8 +302,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
while True:
|
||||
networks = list_networks(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(networks, list),
|
||||
|
|
@ -332,8 +332,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Get router details after restart
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -364,8 +364,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
while True:
|
||||
networks = list_networks(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(networks, list),
|
||||
|
|
@ -394,8 +394,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
# Get router details after restart
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -462,8 +462,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -528,8 +528,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -609,8 +609,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -653,8 +653,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -698,8 +698,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_router_response, list),
|
||||
|
|
@ -755,8 +755,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
|
||||
list_vms = list_virtual_machines(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_vms, list),
|
||||
|
|
@ -809,8 +809,8 @@ class TestRouterServices(cloudstackTestCase):
|
|||
#Check status of network router
|
||||
list_router_response = list_routers(
|
||||
self.apiclient,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
if isinstance(list_router_response, list):
|
||||
break
|
||||
|
|
|
|||
|
|
@ -137,8 +137,8 @@ class TestScaleVm(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services["small"],
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.small_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
cls.services["account"],
|
||||
domainid=cls.domain.id
|
||||
)
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -159,8 +159,8 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -235,8 +235,8 @@ class TestCreateTemplate(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
self.services["template_1"],
|
||||
self.volume.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.cleanup.append(template)
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ class TestTemplates(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
|
|
@ -343,8 +343,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["virtual_machine"],
|
||||
templateid=template.id,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -393,15 +393,15 @@ class TestTemplates(cloudstackTestCase):
|
|||
cls.api_client,
|
||||
cls.services["template_1"],
|
||||
cls.volume.id,
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls.template_2 = Template.create(
|
||||
cls.api_client,
|
||||
cls.services["template_2"],
|
||||
cls.volume.id,
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls._cleanup = [
|
||||
cls.service_offering,
|
||||
|
|
@ -474,8 +474,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
templatefilter=\
|
||||
self.services["templatefilter"],
|
||||
id=self.template_1.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
if isinstance(list_template_response, list):
|
||||
break
|
||||
|
|
@ -540,8 +540,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
templatefilter=\
|
||||
self.services["templatefilter"],
|
||||
id=self.template_1.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
# Verify template is deleted properly using ListTemplates
|
||||
self.assertEqual(
|
||||
|
|
@ -626,8 +626,8 @@ class TestTemplates(cloudstackTestCase):
|
|||
self.apiclient,
|
||||
templatefilter='featured',
|
||||
id=self.template_2.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid
|
||||
)
|
||||
self.assertEqual(
|
||||
isinstance(list_template_response, list),
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class TestCreateVolume(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -134,8 +134,8 @@ class TestCreateVolume(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -167,8 +167,8 @@ class TestCreateVolume(cloudstackTestCase):
|
|||
self.apiClient,
|
||||
v,
|
||||
zoneid=self.zone.id,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
diskofferingid=self.disk_offering.id
|
||||
)
|
||||
self.debug("Created a volume with ID: %s" % volume.id)
|
||||
|
|
@ -177,8 +177,8 @@ class TestCreateVolume(cloudstackTestCase):
|
|||
volume = Volume.create_custom_disk(
|
||||
self.apiClient,
|
||||
self.services,
|
||||
account=self.account.account.name,
|
||||
domainid=self.account.account.domainid,
|
||||
account=self.account.name,
|
||||
domainid=self.account.domainid,
|
||||
)
|
||||
self.debug("Created a volume with custom offering: %s" % volume.id)
|
||||
self.volumes.append(volume)
|
||||
|
|
@ -320,7 +320,7 @@ class TestVolumes(cloudstackTestCase):
|
|||
domainid=cls.domain.id
|
||||
)
|
||||
|
||||
cls.services["account"] = cls.account.account.name
|
||||
cls.services["account"] = cls.account.name
|
||||
cls.service_offering = ServiceOffering.create(
|
||||
cls.api_client,
|
||||
cls.services["service_offering"]
|
||||
|
|
@ -328,8 +328,8 @@ class TestVolumes(cloudstackTestCase):
|
|||
cls.virtual_machine = VirtualMachine.create(
|
||||
cls.api_client,
|
||||
cls.services,
|
||||
accountid=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid,
|
||||
accountid=cls.account.name,
|
||||
domainid=cls.account.domainid,
|
||||
serviceofferingid=cls.service_offering.id,
|
||||
mode=cls.services["mode"]
|
||||
)
|
||||
|
|
@ -337,8 +337,8 @@ class TestVolumes(cloudstackTestCase):
|
|||
cls.volume = Volume.create(
|
||||
cls.api_client,
|
||||
cls.services,
|
||||
account=cls.account.account.name,
|
||||
domainid=cls.account.account.domainid
|
||||
account=cls.account.name,
|
||||
domainid=cls.account.domainid
|
||||
)
|
||||
cls._cleanup = [
|
||||
cls.resized_disk_offering,
|
||||
|
|
|
|||
Loading…
Reference in New Issue