Ejemplo n.º 1
0
    def test_18_deployvm_user(self):

	"""
        # Validate that Regular should be able to deploy vm for himslef
	"""
	self.apiclient.connection.apiKey = self.user_d1a_apikey
        self.apiclient.connection.securityKey = self.user_d1a_secretkey
	vmData={"name":"d1a-d1a","displayname":"d1a-d1a"}

	vm  = VirtualMachine.create(
            self.apiclient,
	    vmData,
            zoneid=self.zone.id,
            serviceofferingid=self.service_offering.id,
            templateid=self.template.id,	
	    networkids=self.network_d1a.id,
        )
 	self.assertEqual(vm.state.lower() == RUNNING.lower(),
                    True,
                    "User is not able to deploy vm for himself")
Ejemplo n.º 2
0
    def test_11_deployvm_admin(self):

	"""
        # Validate that Admin should be able to deploy VM in the networks he owns
	"""
	self.apiclient.connection.apiKey = self.user_root_apikey
        self.apiclient.connection.securityKey = self.user_root_secretkey
	vmData = {"name":"root-root","dispayname":"root-root"}

	vm  = VirtualMachine.create(
            self.apiclient,
	    vmData,
            zoneid=self.zone.id,
            serviceofferingid=self.service_offering.id,
            templateid=self.template.id,	
	    networkids=self.network_root.id
        )

 	self.assertEqual(vm.state.lower() == RUNNING.lower(),
                    True,
                    "Admin User is not able to deploy VM in his own network")
Ejemplo n.º 3
0
    def test_16_deployvm_domaindmin_foruserinsubdomain(self):

	"""
        # Validate that Domain admin should be able to deploy vm for users in his sub domain
	"""
	self.apiclient.connection.apiKey = self.user_d1_apikey
        self.apiclient.connection.securityKey = self.user_d1_secretkey
	vmData={"name":"d11a-d1","displayname":"d111a-d1"}

	vm  = VirtualMachine.create(
            self.apiclient,
	    vmData,
            zoneid=self.zone.id,
            serviceofferingid=self.service_offering.id,
            templateid=self.template.id,	
	    networkids=self.network_d11a.id,
	    accountid=self.account_d11a.name,
            domainid=self.account_d11a.domainid
        )
 	self.assertEqual(vm.state.lower() == RUNNING.lower() and vm.account== self.account_d11a.name and vm.domainid == self.account_d11a.domainid,
                    True,
                    "Domain admin User is not able to deploy vm for himself")
Ejemplo n.º 4
0
    def test_12_deployvm_admin_foruserinsamedomain(self):

	"""
        # Validate that Admin should be able to deploy Vm  for users in his domain
	"""
	self.apiclient.connection.apiKey = self.user_root_apikey
        self.apiclient.connection.securityKey = self.user_root_secretkey
	vmData={"name":"roota-root","displayname":"roota-root"}

	vm  = VirtualMachine.create(
            self.apiclient,
	    vmData,
            zoneid=self.zone.id,
            serviceofferingid=self.service_offering.id,
            templateid=self.template.id,	
	    networkids=self.network_roota.id,
	    accountid=self.account_roota.name,
            domainid=self.account_roota.domainid
        )

 	self.assertEqual(vm.state.lower() == RUNNING.lower() and vm.account== self.account_roota.name and vm.domainid == self.account_roota.domainid,
                    True,
                    "Admin User is not able to deploy VM for users in his domain")