Merge pull request #2743 from nuagenetworks/bugfix/marvin_config_drive

CLOUDSTACK-10380: Fix startvm giving another pw after pw reset
This commit is contained in:
Paul Angus 2018-09-26 10:21:52 -04:00 committed by GitHub
commit fe10e684f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 2156 additions and 2541 deletions

View File

@ -1336,7 +1336,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
//check if the there are no service provider other than virtualrouter.
for(Provider provider : providers) {
if (provider!=Provider.VirtualRouter)
if (provider != Provider.VirtualRouter)
throw new UnsupportedOperationException("Cannot update the network resources in sequence when providers other than virtualrouter are used");
}
//check if routers are in correct state before proceeding with the update

View File

@ -29,11 +29,11 @@ import java.util.Set;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import com.cloud.network.Network;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.NetworkVO;
import org.apache.log4j.Logger;
import com.cloud.server.ResourceTag.ResourceObjectType;
import com.cloud.tags.dao.ResourceTagDao;
import com.cloud.user.Account;
@ -368,9 +368,13 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
if (detailsStr == null) {
return;
}
final Map<String, Boolean> visibilityMap = _detailsDao.listDetailsVisibility(vm.getId());
List<UserVmDetailVO> details = new ArrayList<UserVmDetailVO>();
for (String key : detailsStr.keySet()) {
details.add(new UserVmDetailVO(vm.getId(), key, detailsStr.get(key), true));
for (Map.Entry<String, String> entry : detailsStr.entrySet()) {
boolean display = visibilityMap.getOrDefault(entry.getKey(), true);
details.add(new UserVmDetailVO(vm.getId(), entry.getKey(), entry.getValue(), display));
}
_detailsDao.saveDetails(details);

View File

@ -73,6 +73,8 @@ public interface ResourceDetailsDao<R extends ResourceDetail> extends GenericDao
public Map<String, String> listDetailsKeyPairs(long resourceId, boolean forDisplay);
Map<String, Boolean> listDetailsVisibility(long resourceId);
public void saveDetails(List<R> details);
public void addDetail(long resourceId, String key, String value, boolean display);

View File

@ -27,7 +27,7 @@ import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.TransactionLegacy;
public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends GenericDaoBase<R, Long> {
public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends GenericDaoBase<R, Long> implements ResourceDetailsDao<R> {
private SearchBuilder<R> AllFieldsSearch;
public ResourceDetailsDaoBase() {
@ -81,6 +81,18 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G
return details;
}
public Map<String, Boolean> listDetailsVisibility(long resourceId) {
SearchCriteria<R> sc = AllFieldsSearch.create();
sc.setParameters("resourceId", resourceId);
List<R> results = search(sc, null);
Map<String, Boolean> details = new HashMap<>(results.size());
for (R result : results) {
details.put(result.getName(), result.isDisplay());
}
return details;
}
public List<R> listDetails(long resourceId) {
SearchCriteria<R> sc = AllFieldsSearch.create();
sc.setParameters("resourceId", resourceId);

View File

@ -24,14 +24,12 @@ import java.util.Set;
import javax.inject.Inject;
import com.cloud.utils.net.NetUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.cloud.network.router.NetworkHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.log4j.Logger;
import org.cloud.network.router.deployment.RouterDeploymentDefinition;
import org.cloud.network.router.deployment.RouterDeploymentDefinitionBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.google.gson.Gson;
@ -83,6 +81,7 @@ import com.cloud.network.dao.OvsProviderDao;
import com.cloud.network.dao.VirtualRouterProviderDao;
import com.cloud.network.lb.LoadBalancingRule;
import com.cloud.network.lb.LoadBalancingRulesManager;
import com.cloud.network.router.NetworkHelper;
import com.cloud.network.router.VirtualRouter;
import com.cloud.network.router.VirtualRouter.Role;
import com.cloud.network.router.VpcVirtualNetworkApplianceManager;
@ -103,6 +102,7 @@ import com.cloud.utils.crypt.DBEncryptionUtil;
import com.cloud.utils.db.QueryBuilder;
import com.cloud.utils.db.SearchCriteria.Op;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.net.NetUtils;
import com.cloud.vm.DomainRouterVO;
import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext;
@ -703,7 +703,14 @@ NetworkMigrationResponder, AggregatedCommandExecutor, RedundantResource, DnsServ
// save the password in DB
for (final VirtualRouter router : routers) {
if (router.getState() == State.Running) {
return networkTopology.savePasswordToRouter(network, nic, uservm, router);
final boolean result = networkTopology.savePasswordToRouter(network, nic, uservm, router);
if (result) {
// Explicit password reset, while VM hasn't generated a password yet.
final UserVmVO userVmVO = _userVmDao.findById(vm.getId());
userVmVO.setUpdateParameters(false);
_userVmDao.update(userVmVO.getId(), userVmVO);
}
return result;
}
}
final String password = (String) uservm.getParameter(VirtualMachineProfile.Param.VmPassword);

View File

@ -39,6 +39,11 @@ import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
import org.apache.cloudstack.affinity.AffinityGroupService;
@ -91,10 +96,6 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
@ -688,10 +689,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
if (result) {
userVm.setPassword(password);
// update the password in vm_details table too
// Check if an SSH key pair was selected for the instance and if so
// use it to encrypt & save the vm password
encryptAndStorePassword(userVm, password);
} else {
throw new CloudRuntimeException("Failed to reset password for the virtual machine ");
}
@ -736,7 +733,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
} else {
final UserVmVO userVm = _vmDao.findById(vmId);
_vmDao.loadDetails(userVm);
userVm.setPassword(password);
// update the password in vm_details table too
// Check if an SSH key pair was selected for the instance and if so
// use it to encrypt & save the vm password
@ -850,8 +846,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
userVm.setPassword(password);
//update the encrypted password in vm_details table too
encryptAndStorePassword(userVm, password);
} else {
_vmDao.saveDetails(userVm);
}
_vmDao.saveDetails(userVm);
if (vmInstance.getState() == State.Stopped) {
s_logger.debug("Vm " + vmInstance + " is stopped, not rebooting it as a part of SSH Key reset");
@ -4461,6 +4458,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
password = DBEncryptionUtil.decrypt(vm.getDetail("password"));
} else {
password = _mgr.generateRandomPassword();
vm.setPassword(password);
}
}
@ -4499,11 +4497,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
// this value is not being sent to the backend; need only for api
// display purposes
if (template.getEnablePassword()) {
vm.setPassword((String)vmParamPair.second().get(VirtualMachineProfile.Param.VmPassword));
vm.setUpdateParameters(false);
if (vm.getDetail("password") != null) {
_vmDetailsDao.remove(_vmDetailsDao.findDetail(vm.getId(), "password").getId());
_vmDetailsDao.removeDetail(vm.getId(), "password");
}
vm.setUpdateParameters(false);
_vmDao.update(vm.getId(), vm);
}
}
@ -6180,7 +6177,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
vm.setUpdateParameters(false);
_vmDao.loadDetails(vm);
if (vm.getDetail("password") != null) {
_vmDetailsDao.remove(_vmDetailsDao.findDetail(vm.getId(), "password").getId());
_vmDetailsDao.removeDetail(vm.getId(), "password");
}
_vmDao.update(vm.getId(), vm);
}

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,19 @@
""" Custom base class for Nuage VSP SDN plugin specific Marvin tests
"""
import functools
import importlib
import logging
import socket
import sys
import time
# Import Local Modules
from bambou.nurest_object import NURESTObject
from marvin.cloudstackAPI import (restartVPC,
enableNuageUnderlayVlanIpRange,
disableNuageUnderlayVlanIpRange,
listNuageUnderlayVlanIpRanges)
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.lib.base import (Domain,
EgressFireWallRule,
@ -44,22 +55,10 @@ from marvin.lib.base import (Domain,
from marvin.lib.common import (get_domain,
get_template,
get_zone)
from marvin.cloudstackAPI import (restartVPC,
enableNuageUnderlayVlanIpRange,
disableNuageUnderlayVlanIpRange,
listNuageUnderlayVlanIpRanges)
from nuage_test_data import nuage_test_data
from nuage_vsp_statistics import VsdDataCollector
# Import System Modules
from retry import retry
import importlib
import functools
import logging
import socket
import time
import sys
from nuage_test_data import nuage_test_data
class needscleanup(object):
@ -89,38 +88,6 @@ class needscleanup(object):
return _wrapper
class gherkin(object):
"""Decorator to mark a method as Gherkin style.
Add extra colored logging
"""
BLACK = "\033[0;30m"
BLUE = "\033[0;34m"
GREEN = "\033[0;32m"
CYAN = "\033[0;36m"
RED = "\033[0;31m"
BOLDBLUE = "\033[1;34m"
NORMAL = "\033[0m"
def __init__(self, method):
self.method = method
def __get__(self, obj=None, objtype=None):
@functools.wraps(self.method)
def _wrapper(*args, **kwargs):
gherkin_step = self.method.__name__.replace("_", " ").capitalize()
obj.info("=G= %s%s%s" % (self.BOLDBLUE, gherkin_step, self.NORMAL))
try:
result = self.method(obj, *args, **kwargs)
obj.info("=G= %s%s: [SUCCESS]%s" %
(self.GREEN, gherkin_step, self.NORMAL))
return result
except Exception as e:
obj.info("=G= %s%s: [FAILED]%s%s" %
(self.RED, gherkin_step, self.NORMAL, e))
raise
return _wrapper
class nuageTestCase(cloudstackTestCase):
@classmethod
@ -291,7 +258,8 @@ class nuageTestCase(cloudstackTestCase):
address=cls.nuage_vsp_device.hostname,
user=cls.nuage_vsp_device.username,
password=cls.nuage_vsp_device.password,
version=cls.nuage_vsp_device.apiversion[1] + "." + cls.nuage_vsp_device.apiversion[3]
version=cls.nuage_vsp_device.apiversion[1] +
"." + cls.nuage_vsp_device.apiversion[3]
)
vsd_api_client.new_session()
cls.vsd = VSDHelpers(vsd_api_client)
@ -391,7 +359,7 @@ class nuageTestCase(cloudstackTestCase):
# create_Vpc - Creates VPC with the given VPC offering
@needscleanup
def create_Vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None,
def create_vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None,
account=None, networkDomain=None):
"""Creates VPC with the given VPC offering
:param vpc_offering: vpc offering
@ -466,7 +434,8 @@ class nuageTestCase(cloudstackTestCase):
@needscleanup
def create_Network(cls, nw_off, gateway="10.1.1.1",
netmask="255.255.255.0", vpc=None, acl_list=None,
testdata=None, account=None, vlan=None, externalid=None):
testdata=None, account=None, vlan=None,
externalid=None):
"""Creates Network with the given Network offering
:param nw_off: Network offering
:type nw_off: NetworkOffering
@ -502,7 +471,7 @@ class nuageTestCase(cloudstackTestCase):
vlan=vlan,
externalid=externalid,
vpcid=vpc.id if vpc else cls.vpc.id
if hasattr(cls, "vpc") else None,
if hasattr(cls, "vpc") and cls.vpc else None,
aclid=acl_list.id if acl_list else None
)
cls.debug("Created network with ID - %s" % network.id)
@ -513,12 +482,14 @@ class nuageTestCase(cloudstackTestCase):
if not hasattr(nw_off, "id"):
nw_off = self.create_NetworkOffering(nw_off)
self.debug("Updating Network with ID - %s" % network.id)
network.update(self.api_client,
networkofferingid=nw_off.id,
changecidr=False,
forced=forced
)
updated_network =\
network.update(self.api_client,
networkofferingid=nw_off.id,
changecidr=False,
forced=forced
)
self.debug("Updated network with ID - %s" % network.id)
return updated_network
# delete_Network - Deletes the given network
def delete_Network(self, network):
@ -640,7 +611,8 @@ class nuageTestCase(cloudstackTestCase):
networkid=network.id
if vpc is None else None,
vpcid=vpc.id if vpc else self.vpc.id
if hasattr(self, "vpc") else None
if hasattr(self, "vpc") and self.vpc
else None
)
self.debug("Associated public IP address - %s with network with ID - "
"%s" % (public_ip.ipaddress.ipaddress, network.id))
@ -733,7 +705,8 @@ class nuageTestCase(cloudstackTestCase):
traffictype=traffic_type
)
def ssh_into_VM(self, vm, public_ip, reconnect=True, negative_test=False, keypair=None):
def ssh_into_VM(self, vm, public_ip, reconnect=True, negative_test=False,
keypair=None):
"""Creates a SSH connection to the VM
:returns: the SSH connection
@ -753,7 +726,8 @@ class nuageTestCase(cloudstackTestCase):
ipaddress=public_ip.ipaddress.ipaddress,
reconnect=reconnect,
retries=3 if negative_test else 30,
keyPairFileLocation=keypair.private_key_file if keypair else None
keyPairFileLocation=keypair.private_key_file
if keypair else None
)
self.debug("Successful to SSH into VM with ID - %s on "
"public IP address - %s" %
@ -781,7 +755,6 @@ class nuageTestCase(cloudstackTestCase):
self.debug("SSH client executed command result is None")
return ret_data
def wget_from_server(self, public_ip, port=80, file_name="index.html",
disable_system_proxies=True):
"""Fetches file with the given file name from a web server
@ -825,10 +798,9 @@ class nuageTestCase(cloudstackTestCase):
name=provider_name,
physicalnetworkid=self.vsp_physical_network.id
)
self.assertEqual(isinstance(providers, list), True,
"List Network Service Provider should return a "
"valid list"
)
self.assertIsInstance(providers, list,
"List Network Service Provider should return a "
"valid list")
self.assertEqual(provider_name, providers[0].name,
"Name of the Network Service Provider should match "
"with the returned list data"
@ -873,7 +845,7 @@ class nuageTestCase(cloudstackTestCase):
self.debug("Successfully validated the creation and state of VPC "
"offering - %s" % vpc_offering.name)
def validate_Vpc(self, vpc, state=None):
def validate_vpc(self, vpc, state=None):
"""Validates the VPC
Fetches the vpc by id,
@ -989,7 +961,7 @@ class nuageTestCase(cloudstackTestCase):
self.debug("Successfully validated the deployment and state of VM - %s"
% vm.name)
def check_Router_state(self, router, state=None):
def check_Router_state(self, router=None, network=None, state=None):
"""Validates the Router state
:param router: cs object
:type router: Router
@ -997,12 +969,17 @@ class nuageTestCase(cloudstackTestCase):
:raise AssertionError when router isn't found,
or has an incorrect state."""
self.debug("Validating the deployment and state of Router - %s" %
router.name)
routers = Router.list(self.api_client,
id=router.id,
listall=True
)
if router:
self.debug("Validating the deployment and state of Router - %s" %
router.name)
routers = Router.list(self.api_client, id=router.id,
listall=True)
elif network:
routers = Router.list(self.api_client, networkid=network.id,
listall=True)
else:
raise AttributeError("Either router or network "
"has to be specified")
self.assertEqual(isinstance(routers, list), True,
"List router should return a valid list"
)
@ -1011,7 +988,9 @@ class nuageTestCase(cloudstackTestCase):
"Virtual router is not in the expected state"
)
self.debug("Successfully validated the deployment and state of Router "
"- %s" % router.name)
"- %s" % routers[0].name)
return routers[0]
def validate_PublicIPAddress(self, public_ip, network, static_nat=False,
vm=None):
@ -1245,7 +1224,6 @@ class nuageTestCase(cloudstackTestCase):
self.debug("Failed to get the subnet id due to %s" % e)
self.fail("Unable to get the subnet id, failing the test case")
def verify_vsd_shared_network(self, domain_id, network,
gateway="10.1.1.1"):
"""Verifies the given CloudStack domain and
@ -1324,6 +1302,8 @@ class nuageTestCase(cloudstackTestCase):
)
vm_info = VirtualMachine.list(self.api_client, id=vm.id)[0]
for nic in vm_info.nic:
if nic.type == "Shared":
continue
vsd_subnet = self.vsd.get_subnet(
filter=self.get_externalID_filter(nic.networkid))
vsd_vport = self.vsd.get_vport(

View File

@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import functools
from marvin.cloudstackAPI import createSSHKeyPair, deleteSSHKeyPair
@ -44,4 +45,54 @@ class MySSHKeyPair:
cmd.name = self.name
cmd.account = self.account
cmd.domainid = self.domainid
apiclient.deleteSSHKeyPair(cmd)
apiclient.deleteSSHKeyPair(cmd)
class GherkinMetaClass(type):
def __new__(mcs, name, bases, namespace):
namespace = {
k: gherkin(v)
if k.startswith('given_') or
k.startswith('when_') or
k.startswith('then_')
else v for k, v in namespace.items()
}
return super(GherkinMetaClass, mcs)\
.__new__(mcs, name, bases, namespace)
class gherkin(object):
"""Decorator to mark a method as Gherkin style.
Add extra colored logging
"""
BLACK = "\033[0;30m"
BLUE = "\033[0;34m"
GREEN = "\033[0;32m"
CYAN = "\033[0;36m"
RED = "\033[0;31m"
BOLDBLUE = "\033[1;34m"
NORMAL = "\033[0m"
def __init__(self, method):
self.method = method
def __get__(self, obj=None, objtype=None):
@functools.wraps(self.method)
def _wrapper(*args, **kwargs):
if self.method.__doc__:
gherkin_step = self.method.__doc__.format(*args, **kwargs)
else:
gherkin_step = self.method.__name__\
.replace("_", " ")\
.capitalize()
obj.info("=G= %s%s%s" % (self.BOLDBLUE, gherkin_step, self.NORMAL))
try:
result = self.method(obj, *args, **kwargs)
obj.info("=G= %s%s: [SUCCESS]%s" %
(self.GREEN, gherkin_step, self.NORMAL))
return result
except Exception as e:
obj.info("=G= %s%s: [FAILED]%s%s" %
(self.RED, gherkin_step, self.NORMAL, e))
raise
return _wrapper

File diff suppressed because it is too large Load Diff

View File

@ -19,11 +19,11 @@
Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import (nuageTestCase, gherkin)
from nuageTestCase import (nuageTestCase)
from nuage_lib import gherkin
from marvin.cloudstackAPI import updateVirtualMachine, updateZone
from marvin.lib.base import (Account,
Network,
VirtualMachine,
Configurations,
NetworkOffering)
# Import System Modules
@ -56,7 +56,7 @@ class TestNuageExtraDhcp(nuageTestCase):
cls.api_client.updateZone(cmd)
cls.vpc_offering = cls.create_VpcOffering(
cls.test_data["nuagevsp"]["vpc_offering_nuage_dhcp"])
cls.vpc1 = cls.create_Vpc(cls.vpc_offering, cidr="10.0.0.0/16",
cls.vpc1 = cls.create_vpc(cls.vpc_offering, cidr="10.0.0.0/16",
networkDomain="testvpc.com")
cls.vpc_network_offering = cls.create_NetworkOffering(
@ -423,7 +423,8 @@ class TestNuageExtraDhcp(nuageTestCase):
def verify_dhcp_on_vm(
self, dhcpleasefile, dhcp_option_map, ssh_client, cleanlease=True):
if self.isSimulator:
self.debug("Simulator Environment: Skipping VM DHCP option verification")
self.debug("Simulator Environment: "
"Skipping VM DHCP option verification")
return
cmd = 'cat /var/lib/dhclient/'+dhcpleasefile
@ -455,8 +456,7 @@ class TestNuageExtraDhcp(nuageTestCase):
self.debug("clear lease is done properly:" + completeoutput)
def update_zone_details(self, value):
"""Updates the VM data"""
# update Network Domain at zone level
"""Updates Network Domain at zone level"""
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
cmd.domain = value
@ -489,9 +489,9 @@ class TestNuageExtraDhcp(nuageTestCase):
self.validate_NetworkOffering(network_offering, state="Enabled")
self.validate_Network(network)
def validate_vpc(self, vpc, vpc_offering):
def validate_vpc_and_vpcoffering(self, vpc, vpc_offering):
self.debug("Validating vpc...")
self.validate_Vpc(vpc)
self.validate_vpc(vpc)
self.validate_VpcOffering(vpc_offering)
def verify_dhcp_options_on_vm(
@ -590,18 +590,18 @@ class TestNuageExtraDhcp(nuageTestCase):
self.validate_NetworkOffering(network_offering, state="Enabled")
return network_offering
def create_vpc(self, vpc_offering, cidr="10.0.0.0/16"):
def create_and_validate_vpc(self, vpc_offering, cidr="10.0.0.0/16"):
# Creating a VPC
self.debug("Creating a VPC with Nuage VSP VPC offering...")
vpc = self.create_Vpc(vpc_offering, cidr=cidr,
vpc = self.create_vpc(vpc_offering, cidr=cidr,
networkDomain="testvpc.com")
self.validate_Vpc(vpc, state="Enabled")
self.validate_vpc(vpc, state="Enabled")
return vpc
def create_vpc_with_tier(self, domain_name="testvpc.com"):
vpc_offering = self.create_vpc_offering_with_nuage_dhcp()
vpc = self.create_vpc(vpc_offering)
vpc = self.create_and_validate_vpc(vpc_offering)
vpc_network_offering = self.create_vpc_network_offering()
acl_list = self.create_acl_list_with_item(vpc)
@ -1267,8 +1267,9 @@ class TestNuageExtraDhcp(nuageTestCase):
self.when_i_stop_and_start_a_vm(vm1)
with self.assertRaises(Exception):
vm1.remove_nic(
self.api_client, [nic for nic in result.nic
if nic.networkid == network.id][0])
self.api_client,
[nic for nic in result.nic
if nic.networkid == network.id][0].id)
def validate_all_extra_dhcp_for_update_multinic(
self, network,
@ -1683,7 +1684,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_02_nuage_extra_dhcp_single_nic_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_deploy_vm(
@ -1710,7 +1711,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_05_nuage_extra_dhcp_update_vm_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_after_vm_update(
@ -1736,7 +1737,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_08_nuage_extra_dhcp_add_nic_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_after_plug_nic(
@ -1762,7 +1763,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_11_nuage_extra_dhcp_deploy_multi_nic_vm_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_for_multi_nic(
@ -1788,7 +1789,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_14_nuage_extra_dhcp_update_multi_nic_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_for_update_multinic(
@ -1814,7 +1815,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_17_nuage_extra_dhcp_remove_nic_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_for_remove_nic_from_vm(
@ -1841,7 +1842,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_20_nuage_nuage_extra_dhcp_vm_actions_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_for_vm_actions_in_network(
@ -1868,7 +1869,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_23_nuage_nuage_extra_dhcp_network_actions_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_for_network_actions_in_network(
@ -1895,7 +1896,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_26_nuage_nuage_extra_dhcp_nic_after_migrate_in_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_for_add_remove_nic_after_migrate(
@ -1929,7 +1930,7 @@ class TestNuageExtraDhcp(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_30_nuage_extra_dhcp_allocated_vpc(self):
self.update_zone_details("testvpc.com")
self.validate_vpc(self.vpc1, self.vpc_offering)
self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering)
self.validate_Network(self.vpc_network)
self.validate_all_extra_dhcp_for_network_in_allocated(

View File

@ -23,7 +23,6 @@ from marvin.cloudstackAPI import updateZone
from marvin.lib.base import Account, Network
# Import System Modules
from nose.plugins.attrib import attr
import time
UPDATED_DOMAIN_NAME = "update.com"
@ -124,7 +123,8 @@ class TestNuageInternalDns(nuageTestCase):
self.debug("command is executed properly " + cmd)
completeoutput = str(outputlist).strip('[]')
self.debug("complete output is " + completeoutput)
expectedlist = ['2 received', dst_vm.name + '.' + domain_name, dst_vm.ipaddress]
expectedlist = ['2 received', dst_vm.name + '.' + domain_name,
dst_vm.ipaddress]
for item in expectedlist:
if item in completeoutput:
self.debug("excepted value found in vm: " + item)
@ -163,7 +163,8 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -204,7 +205,8 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -264,7 +266,8 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -373,7 +376,8 @@ class TestNuageInternalDns(nuageTestCase):
"Network Domain is not updated as expected"
)
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -432,7 +436,8 @@ class TestNuageInternalDns(nuageTestCase):
"Network Domain is not updated as expected"
)
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -484,7 +489,7 @@ class TestNuageInternalDns(nuageTestCase):
vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"])
self.validate_VpcOffering(vpc_off, state="Enabled")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
@ -501,10 +506,12 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
@attr(tags=["advanced", "nuagevsp"], required_hardware="true")
@ -527,7 +534,7 @@ class TestNuageInternalDns(nuageTestCase):
vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"])
self.validate_VpcOffering(vpc_off, state="Enabled")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
@ -546,7 +553,8 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_dhcp_option(self.DOMAINNAME, "vpc.com", network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
self.test_data["virtual_machine"]["displayname"] = "vm2"
@ -557,7 +565,8 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_vm(vm_2)
for nic in vm_2.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True)
public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc)
@ -594,7 +603,7 @@ class TestNuageInternalDns(nuageTestCase):
vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"])
self.validate_VpcOffering(vpc_off, state="Enabled")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
@ -610,10 +619,12 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_vm(vm_1)
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
self.test_data["virtual_machine"]["displayname"] = "vm2"
@ -624,7 +635,8 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_vm(vm_2)
for nic in vm_2.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True)
public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc)

View File

@ -1154,7 +1154,7 @@ class TestNuageMigration(nuageTestCase):
@attr(tags=["migrateACS", "vpcnovms"],
required_hardware="false")
def test_10_migrate_native_vpc(self):
vpc = self.create_Vpc(self.native_vpc_offering)
vpc = self.create_vpc(self.native_vpc_offering)
network = self.create_Network(self.native_vpc_network_offering,
vpc=vpc)
self.create_VM(network)
@ -1222,8 +1222,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")
@ -1484,8 +1484,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")
@ -1802,8 +1802,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")
@ -1922,8 +1922,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")

View File

@ -120,7 +120,7 @@ class TestNuagePasswordReset(nuageTestCase):
# stop_vm - Stops the given VM, and verifies its state
def stop_vm(self, vm):
self.debug("Stoping VM")
self.debug("Stopping VM")
vm.stop(self.api_client)
list_vm_response = VirtualMachine.list(self.api_client,
id=vm.id
@ -139,8 +139,8 @@ class TestNuagePasswordReset(nuageTestCase):
# (SSH client)
def install_cloud_set_guest_password_script(self, ssh_client):
if self.isSimulator:
self.debug( "Simulator Environment: Skipping installing"
" cloud-set-guest-password script")
self.debug("Simulator Environment: Skipping installing"
" cloud-set-guest-password script")
return
self.debug("Installing cloud-set-guest-password script")
cmd = "cd /etc/init.d;wget http://people.apache.org/~tsp/" \
@ -268,8 +268,7 @@ class TestNuagePasswordReset(nuageTestCase):
self.debug("Actual user data - " + actual_user_data +
", Expected user data - " + expected_user_data)
self.assertEqual(actual_user_data, expected_user_data,
"Un-expected VM (VM_1) user data"
)
"Un-expected VM (VM_1) user data")
self.debug("Checking for cloud-set-guest-password script in the "
"VM for testing password reset functionality...")
@ -330,12 +329,22 @@ class TestNuagePasswordReset(nuageTestCase):
vm_test_public_ip = public_ip_1
self.debug("Resetting password for VM - %s" % vm_test.name)
self.stop_vm(vm_test)
vm_test.password = vm_test.resetPassword(self.api_client)
self.debug("Password reset to - %s" % vm_test.password)
self.debug("Starting the VM")
vm_test.start(self.api_client)
self.debug("until CLOUDSTACK-10380 is fixed, redo resetPassword")
self.stop_vm(vm_test)
self.debug("Resetting password again for VM - %s" % vm_test.name)
vm_test.password = vm_test.resetPassword(self.api_client)
self.debug("VM - %s password - %s !" %
(vm_test.name, vm_test.password))
self.debug("Starting the VM again")
vm_test.start(self.api_client)
self.debug("verifying that the guest VM template is password "
"enabled...")
self.debug("VM - %s password - %s !" %

View File

@ -460,19 +460,19 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC with Source NAT service provider as "
"VpcVirtualRouter...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider VpcVirtualRouter for "
"service Source NAT for VPCs")
self.debug("Creating a VPC without Source NAT service...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_3, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support VPCs without Source NAT "
"service")
@ -714,8 +714,8 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offering
self.debug("Creating Nuage VSP VPC Network offering with Source NAT "
@ -887,8 +887,8 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating VPC network offering
self.debug("Creating Nuage VSP VPC Network offering with Source NAT "
@ -1321,8 +1321,8 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating VPC network offering
self.debug("Creating Nuage VSP VPC Network offering with Source NAT "

View File

@ -849,19 +849,19 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider VpcVirtualRouter for "
"service Static NAT for VPCs")
self.debug("Creating a VPC without Static NAT service...")
vpc_2 = self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_2, state="Enabled")
vpc_2 = self.create_vpc(vpc_off_3, cidr='10.1.0.0/16')
self.validate_vpc(vpc_2, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "
@ -1194,8 +1194,8 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offering
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "
@ -1406,8 +1406,8 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offering
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "
@ -1696,7 +1696,8 @@ class TestNuageStaticNat(nuageTestCase):
# from the deployed VM
if not self.isSimulator:
with self.assertRaises(Exception):
self.verify_StaticNAT_Internet_traffic(vm, network_1, public_ip_1)
self.verify_StaticNAT_Internet_traffic(vm, network_1,
public_ip_1)
self.debug("Static NAT rule not enabled in this VM NIC")
self.verify_StaticNAT_Internet_traffic(vm, network_2, public_ip_2)
@ -1991,8 +1992,8 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating VPC network offering
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "
@ -2088,6 +2089,7 @@ class TestNuageStaticNat(nuageTestCase):
self.debug("Restarting the created VPC network with cleanup...")
Network.restart(vpc_tier, self.api_client, cleanup=True)
self.validate_Network(vpc_tier, state="Implemented")
vpc_vr = self.get_Router(vpc_tier)
self.check_Router_state(vpc_vr, state="Running")
self.check_VM_state(vpc_vm, state="Running")

View File

@ -375,25 +375,25 @@ class TestNuageInternalLb(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with LB service provider as "
"InternalLbVm...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC with LB service provider as "
"VpcVirtualRouter...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider VpcVirtualRouter for "
"service LB for VPCs")
self.debug("Creating a VPC with LB service provider as Netscaler...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_3, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider Netscaler for service "
"LB for VPCs")
self.debug("Creating a VPC without LB service...")
vpc_2 = self.create_Vpc(vpc_off_4, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_2, state="Enabled")
vpc_2 = self.create_vpc(vpc_off_4, cidr='10.1.0.0/16')
self.validate_vpc(vpc_2, state="Enabled")
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_02_nuage_internallb_vpc_network_offering(self):
@ -438,8 +438,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with LB Service "
@ -594,12 +594,12 @@ class TestNuageInternalLb(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with Internal LB service...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC without Internal LB service...")
vpc_2 = self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_2, state="Enabled")
vpc_2 = self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.validate_vpc(vpc_2, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -794,8 +794,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1148,8 +1148,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1477,8 +1477,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1742,8 +1742,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1881,8 +1881,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vsd_firewall_rule(public_ssh_rule)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restart Internal tier (cleanup = false)
# InternalLbVm gets destroyed and deployed again in the Internal tier
@ -1921,13 +1922,15 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restart Internal tier (cleanup = true)
# InternalLbVm gets destroyed and deployed again in the Internal tier
self.debug("Restarting the Internal tier with cleanup...")
Network.restart(internal_tier, self.api_client, cleanup=True)
self.validate_Network(internal_tier, state="Implemented")
vr = self.get_Router(internal_tier)
self.check_Router_state(vr, state="Running")
self.check_VM_state(internal_vm, state="Running")
self.check_VM_state(internal_vm_1, state="Running")
@ -1960,8 +1963,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restart Public tier (cleanup = false)
# This restart has no effect on the InternalLbVm functionality
@ -2011,6 +2015,7 @@ class TestNuageInternalLb(nuageTestCase):
self.debug("Restarting the Public tier with cleanup...")
Network.restart(public_tier, self.api_client, cleanup=True)
self.validate_Network(public_tier, state="Implemented")
vr = self.get_Router(public_tier)
self.check_Router_state(vr, state="Running")
self.check_VM_state(public_vm, state="Running")
self.validate_PublicIPAddress(
@ -2040,8 +2045,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Stopping VMs in the Internal tier
# wget traffic test fails as all the VMs in the Internal tier are in
@ -2072,8 +2078,10 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vsd_lb_device(int_lb_vm)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm, should_fail=True)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# Starting VMs in the Internal tier
# wget traffic test succeeds as all the VMs in the Internal tier are
@ -2112,8 +2120,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restarting VPC (cleanup = false)
# VPC VR gets destroyed and deployed again in the VPC
@ -2160,8 +2169,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restarting VPC (cleanup = true)
# VPC VR gets destroyed and deployed again in the VPC
@ -2217,9 +2227,13 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_lb_wget_file(
wget_file, [internal_vm, internal_vm_1, internal_vm_2])
def verify_internal_lb_wget_traffic(self, int_lb_rule_1, internal_vm, internal_vm_1, internal_vm_2, public_ip, public_vm, should_fail=False):
def verify_internal_lb_wget_traffic(self, int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=False):
if self.isSimulator:
self.debug("Simulator Environment: not running wget traffic tests.")
self.debug("Simulator Environment: "
"not running wget traffic tests.")
return
ssh_client = self.ssh_into_VM(public_vm, public_ip)
tries = 0
@ -2240,8 +2254,8 @@ class TestNuageInternalLb(nuageTestCase):
with self.assertRaises(Exception):
self.verify_lb_wget_file(
wget_file, [internal_vm, internal_vm_1, internal_vm_2])
self.debug("Failed to wget file as all the VMs in the Internal tier "
"are in stopped state")
self.debug("Failed to wget file as all the VMs in the Internal "
"tier are in stopped state")
else:
self.verify_lb_wget_file(
wget_file, [internal_vm, internal_vm_1, internal_vm_2])
@ -2278,8 +2292,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -2429,8 +2443,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vsd_firewall_rule(public_ssh_rule)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# # Stopping the InternalLbVm when the VPC VR is in Stopped state
self.stop_InternalLbVm(int_lb_vm)
@ -2449,8 +2464,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm,
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Stopped state
@ -2471,8 +2487,9 @@ class TestNuageInternalLb(nuageTestCase):
# Internal LB (wget) traffic test
# Bug CLOUDSTACK-9837
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Starting the VPC VR
# VPC VR has no effect on the InternalLbVm functionality
@ -2503,48 +2520,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm, should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Running state
self.start_InternalLbVm(int_lb_vm)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Running")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
# # Force Stopping the InternalLbVm when the VPC VR is in Running state
self.stop_InternalLbVm(int_lb_vm, force=True)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Stopped")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm, stopped=True)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm,
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Running state
@ -2564,5 +2542,49 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# # Force Stopping the InternalLbVm when the VPC VR is in Running state
self.stop_InternalLbVm(int_lb_vm, force=True)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Stopped")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm, stopped=True)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Running state
self.start_InternalLbVm(int_lb_vm)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Running")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)

View File

@ -20,7 +20,7 @@ Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import nuageTestCase
from marvin.lib.base import Account, VPC
from marvin.lib.base import Account
# Import System Modules
from nose.plugins.attrib import attr
@ -75,8 +75,8 @@ class TestNuageVpcNetwork(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Nuage VSP VPC offering...")
vpc = self.create_Vpc(vpc_offering, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_offering, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating a network offering
self.debug("Creating Nuage VSP VPC Network offering...")

View File

@ -158,7 +158,7 @@ class TestNuageDomainTemplate(nuageTestCase):
for i in range(0, 3):
cls.domain_template_list.append("domain_template_" + str(i))
for account in [cls.account_root, cls.account_d1, cls.account_d11]:
vpc = cls.create_Vpc(
vpc = cls.create_vpc(
cls.vpc_offering, cidr='10.1.0.0/16', account=account)
cls.create_Network(
cls.network_offering,
@ -350,7 +350,7 @@ class TestNuageDomainTemplate(nuageTestCase):
# 7. Delete all the created objects (cleanup).
# Creating VPC
vpc_1 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_1 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
with self.assertRaises(Exception):
@ -426,7 +426,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC
vpc_2 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_2 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
self.validate_NuageVspDomainTemplate(self.domain_template_list[0])
@ -481,7 +481,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[1])
# Creating VPC
vpc_3 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_3 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
self.validate_NuageVspDomainTemplate(self.domain_template_list[0])
@ -523,7 +523,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC and VPC network (tier)
vpc = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_tier = self.create_Network(self.network_offering, vpc=vpc)
# VSD verification
@ -669,7 +669,7 @@ class TestNuageDomainTemplate(nuageTestCase):
# Creating VPC
with self.assertRaises(Exception):
self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
self.debug("VPC creation fails as there is no domain template with "
"name invalid_domain_template in VSD as mentioned in "
"global setting nuagevsp.vpc.domaintemplate.name")
@ -685,7 +685,7 @@ class TestNuageDomainTemplate(nuageTestCase):
self.validate_NuageVspDomainTemplate(self.domain_template_list[0])
# Creating VPC and VPC networks (tiers)
vpc_1 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_1 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_1_tier_1 = self.create_Network(
self.network_offering, gateway='10.1.1.1', vpc=vpc_1)
vpc_1_tier_2 = self.create_Network(
@ -700,7 +700,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC and VPC networks (tiers)
vpc_2 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_2 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_2_tier_1 = self.create_Network(
self.network_offering, gateway='10.1.1.1', vpc=vpc_2)
vpc_2_tier_2 = self.create_Network(
@ -715,7 +715,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC
vpc_3 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_3 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
self.validate_NuageVspDomainTemplate(self.domain_template_list[1])

View File

@ -343,8 +343,8 @@ class TestNuageManagedSubnets(nuageTestCase):
self.api_client.updateZone(cmd)
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
acl_list = self.create_NetworkAclList(
name="acl", description="acl", vpc=vpc)
self.create_NetworkAclRule(
@ -354,8 +354,8 @@ class TestNuageManagedSubnets(nuageTestCase):
self.debug("Creating another VPC with Static NAT service provider "
"as VpcVirtualRouter")
vpc2 = self.create_Vpc(self.nuage_vpc_offering, cidr='10.2.0.0/16')
self.validate_Vpc(vpc2, state="Enabled")
vpc2 = self.create_vpc(self.nuage_vpc_offering, cidr='10.2.0.0/16')
self.validate_vpc(vpc2, state="Enabled")
acl_list2 = self.create_NetworkAclList(
name="acl", description="acl", vpc=vpc2)
self.create_NetworkAclRule(
@ -447,8 +447,8 @@ class TestNuageManagedSubnets(nuageTestCase):
self.debug("Creating another VPC with Static NAT service provider "
"as VpcVirtualRouter With same CIDR")
vpc3 = self.create_Vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_Vpc(vpc3, state="Enabled")
vpc3 = self.create_vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_vpc(vpc3, state="Enabled")
acl_list3 = self.create_NetworkAclList(
name="acl", description="acl", vpc=vpc3)
self.create_NetworkAclRule(

View File

@ -350,10 +350,13 @@ class VirtualMachine:
self.username = services["username"]
else:
self.username = 'root'
if "password" in services:
self.password = services["password"]
else:
self.password = 'password'
if "password" not in items:
if "password" in services:
self.password = services["password"]
else:
self.password = 'password'
if "ssh_port" in services:
self.ssh_port = services["ssh_port"]
else:

View File

@ -345,14 +345,16 @@ def get_template(
return list_templatesout[0]
def get_test_template(apiclient, zone_id=None, hypervisor=None):
def get_test_template(apiclient, zone_id=None, hypervisor=None, test_templates=None):
"""
@Name : get_test_template
@Desc : Retrieves the test template used to running tests. When the template
is missing it will be download at most one in a zone for a hypervisor.
@Input : returns a template
"""
test_templates = test_data["test_templates"]
if test_templates is None:
test_templates = test_data["test_templates"]
if hypervisor is None:
return FAILED

View File

@ -54,10 +54,12 @@ setup(name="Marvin",
"pyvmomi >= 5.5.0",
"netaddr >= 0.7.14",
"dnspython",
"ipmisim >= 0.7"
"ipmisim >= 0.7",
"retries",
"PyCrypt"
],
extras_require={
"nuagevsp": ["vspk", "PyYAML", "futures", "netaddr", "retries", "jpype1"]
"nuagevsp": ["vspk", "PyYAML", "futures", "netaddr", "jpype1"]
},
py_modules=['marvin.marvinPlugin'],
zip_safe=False,