CLOUDSTACK-9401 : Marvin tests for Internal DNS verification with NuageVsp

This commit is contained in:
Prashanth Manthena 2016-07-01 15:22:50 +02:00 committed by Prashanth Manthena
parent 4e6c7e179a
commit a97d54f306
9 changed files with 2294 additions and 1162 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,523 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
""" Component tests for Internal DNS functionality with Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import nuageTestCase
from marvin.cloudstackAPI import updateZone
from marvin.lib.base import Account, Network
# Import System Modules
from nose.plugins.attrib import attr
class TestNuageInternalDns(nuageTestCase):
DNS = "06"
HOSTNAME = "0c"
DOMAINNAME = "0f"
@classmethod
def setUpClass(cls):
super(TestNuageInternalDns, cls).setUpClass()
cls.dnsdata = cls.test_data["nuagevsp"]
return
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.account = Account.create(
self.apiclient,
self.test_data["account"],
admin=True,
domainid=self.domain.id
)
self.test_data["virtual_machine"]["displayname"] = "vm1"
self.test_data["virtual_machine"]["name"] = "vm1"
self.cleanup = [self.account]
return
# Creates and verifies the firewall rule
def create_and_verify_fw(self, vm, public_ip, network):
self.debug("Create and verify firewall rule")
self.create_StaticNatRule_For_VM(vm, public_ip, network)
# VSD verification
self.verify_vsd_floating_ip(network, vm, public_ip.ipaddress)
fw_rule = self.create_FirewallRule(
public_ip, self.test_data["ingress_rule"])
self.verify_vsd_firewall_rule(fw_rule)
def verify_vsd_dhcp_option(self, dhcp_type, value, subnet_or_vm_interface,
is_vm_interface=False):
self.debug("Verifying the creation and value of DHCP option type - %s "
"in VSD" % dhcp_type)
found_dhcp_type = False
if is_vm_interface:
dhcp_options = self.vsd.get_vm_interface_dhcpoptions(
filter=self.get_externalID_filter(subnet_or_vm_interface.id))
else:
dhcp_options = self.vsd.get_subnet_dhcpoptions(
filter=self.get_externalID_filter(subnet_or_vm_interface.id))
for dhcp_option in dhcp_options:
self.debug("dhcptype option is %s:" % dhcp_option.actual_type)
self.debug("dhcptype expected value is option is %s:" % dhcp_type)
if dhcp_option.type == dhcp_type:
found_dhcp_type = True
if isinstance(dhcp_option.actual_values, list):
self.debug("dhcptype actual value is %s:" %
dhcp_option.actual_values)
if value in dhcp_option.actual_values:
self.debug("Excepted DHCP option value found in VSD")
else:
self.fail("Excepted DHCP option value not found in "
"VSD")
else:
self.assertEqual(dhcp_options.actual_values, value,
"Expected DHCP option value is not same "
"in both CloudStack and VSD"
)
if not found_dhcp_type:
self.fail("Expected DHCP option type and value not found in the "
"VSD")
self.debug("Successfully verified the creation and value of DHCP "
"option type - %s in VSD" % dhcp_type)
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_01_Isolated_Network_with_zone(self):
""" Verify InternalDns on Isolated Network
"""
# Validate the following
# 1. Create an Isolated network - network1 (10.1.1.1/24) by using DNS
# network offering.
# 2. Deploy vm1 in network1.
# 3. Verify dhcp option 06 and 0f for subnet
# 4. Verify dhcp option 06,15 and 0f for vm Interface.
# update Network Domain at zone level
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
cmd.domain = "isolated.com"
self.apiclient.updateZone(cmd)
self.debug("Creating and enabling Nuage Vsp Isolated Network "
"offering...")
network_offering = self.create_NetworkOffering(
self.dnsdata["isolated_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
network_1 = self.create_Network(network_offering)
vm_1 = self.create_VM(network_1)
# VSD verification
self.verify_vsd_network(self.domain.id, network_1)
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, "isolated.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, "isolated.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
@attr(tags=["advanced", "nuagevsp"], required_hardware="true")
def test_02_Isolated_Network(self):
""" Verify InternalDns on Isolated Network with ping by hostname
"""
# Validate the following
# 1. Create an Isolated network - network1 (10.1.1.1/24) by using DNS
# network offering.
# 2. Deploy vm1 in network1.
# 3. Verify dhcp option 06 and 0f for subnet
# 4. Verify dhcp option 06,15 and 0f for vm Interface.
# 5. Deploy VM2 in network1.
# 6. Verify end to end by pinging with hostname
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
cmd.domain = "isolated.com"
self.apiclient.updateZone(cmd)
self.debug("Creating and enabling Nuage Vsp Isolated Network "
"offering...")
network_offering = self.create_NetworkOffering(
self.dnsdata["isolated_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
network_1 = self.create_Network(network_offering)
vm_1 = self.create_VM(network_1)
# VSD verification
self.verify_vsd_network(self.domain.id, network_1)
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, "isolated.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, "isolated.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
self.test_data["virtual_machine"]["displayname"] = "vm2"
self.test_data["virtual_machine"]["name"] = "vm2"
vm_2 = self.create_VM(network_1)
self.test_data["virtual_machine"]["displayname"] = "vm1"
self.test_data["virtual_machine"]["name"] = "vm1"
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, "isolated.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True)
public_ip_1 = self.acquire_PublicIPAddress(network_1)
self.create_and_verify_fw(vm_1, public_ip_1, network_1)
vm_public_ip = public_ip_1.ipaddress.ipaddress
try:
vm_1.ssh_ip = vm_public_ip
vm_1.ssh_port = self.test_data["virtual_machine"]["ssh_port"]
vm_1.username = self.test_data["virtual_machine"]["username"]
vm_1.password = self.test_data["virtual_machine"]["password"]
self.debug("SSHing into VM: %s with %s" %
(vm_1.ssh_ip, vm_1.password))
ssh = vm_1.get_ssh_client(ipaddress=vm_public_ip)
except Exception as e:
self.fail("SSH into VM failed with exception %s" % e)
cmd = 'ping -c 2 vm2'
self.debug("ping vm2 by hostname with command: " + cmd)
outputlist = ssh.execute(cmd)
self.debug("command is executed properly " + cmd)
completeoutput = str(outputlist).strip('[]')
self.debug("complete output is " + completeoutput)
expectedlist = ['2 received', 'vm2.isolated.com', vm_2.ipaddress]
for item in expectedlist:
if item in completeoutput:
self.debug("excepted value found in vm: " + item)
else:
self.fail("excepted value not found in vm: " + item)
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_03_Update_Network_with_Domain(self):
""" Verify update NetworkDomain for InternalDns on Isolated Network
"""
# Validate the following
# 1. Create an Isolated network - network1 (10.1.1.1/24) by using DNS
# network offering.
# 2. Deploy vm1 in network1.
# 3. Verify dhcp option 06 and 0f for subnet
# 4. Verify dhcp option 06,15 and 0f for vm Interface.
# 5. Update Network domain and verify it is properly updated
# update Network Domain at zone level
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
cmd.domain = "isolated.com"
self.apiclient.updateZone(cmd)
self.debug("Creating and enabling Nuage Vsp Isolated Network "
"offering...")
network_offering = self.create_NetworkOffering(
self.dnsdata["isolated_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
network_1 = self.create_Network(network_offering)
vm_1 = self.create_VM(network_1)
# VSD verification
self.verify_vsd_network(self.domain.id, network_1)
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, "isolated.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, "isolated.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
update_response = Network.update(
network_1, self.apiclient, id=network_1.id,
networkdomain="update.com", changecidr=False)
completeoutput = str(update_response).strip('[]')
self.debug("network update response is " + completeoutput)
self.assertEqual("update.com", update_response.networkdomain,
"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, "update.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, "update.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
@attr(tags=["advanced", "nuagevsp"], required_hardware="true")
def test_04_Update_Network_with_Domain(self):
""" Verify update NetworkDomain for InternalDns on Isolated Network
with ping VM
"""
# Validate the following
# 1. Create an Isolated network - network1 (10.1.1.1/24) by using DNS
# network offering.
# 2. Deploy vm1 in network1.
# 3. Verify dhcp option 06 and 0f for subnet
# 4. Verify dhcp option 06,15 and 0f for vm Interface.
# 5. Update Network domain and verify it is properly updated
# update Network Domain at zone level
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
cmd.domain = "isolated.com"
self.apiclient.updateZone(cmd)
self.debug("Creating and enabling Nuage Vsp Isolated Network "
"offering...")
network_offering = self.create_NetworkOffering(
self.dnsdata["isolated_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
network_1 = self.create_Network(network_offering)
vm_1 = self.create_VM(network_1)
# VSD verification
self.verify_vsd_network(self.domain.id, network_1)
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, "isolated.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, "isolated.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
update_response = Network.update(
network_1, self.apiclient, id=network_1.id,
networkdomain="update.com", changecidr=False)
completeoutput = str(update_response).strip('[]')
self.debug("network update response is " + completeoutput)
self.assertEqual("update.com", update_response.networkdomain,
"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, "update.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, "update.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
# stop and start VM to get new DHCP option
try:
vm_1.stop(self.apiclient)
except Exception as e:
self.fail("Failed to stop the virtual instances, %s" % e)
try:
vm_1.start(self.apiclient)
except Exception as e:
self.fail("Failed to start the virtual instances, %s" % e)
self.test_data["virtual_machine"]["displayname"] = "vm2"
self.test_data["virtual_machine"]["name"] = "vm2"
vm_2 = self.create_VM(network_1)
self.test_data["virtual_machine"]["displayname"] = "vm1"
self.test_data["virtual_machine"]["name"] = "vm1"
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, "update.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True)
public_ip_1 = self.acquire_PublicIPAddress(network_1)
self.create_and_verify_fw(vm_1, public_ip_1, network_1)
vm_public_ip = public_ip_1.ipaddress.ipaddress
try:
vm_1.ssh_ip = vm_public_ip
vm_1.ssh_port = self.test_data["virtual_machine"]["ssh_port"]
vm_1.username = self.test_data["virtual_machine"]["username"]
vm_1.password = self.test_data["virtual_machine"]["password"]
self.debug("SSHing into VM: %s with %s" %
(vm_1.ssh_ip, vm_1.password))
ssh = vm_1.get_ssh_client(ipaddress=vm_public_ip)
except Exception as e:
self.fail("SSH into VM failed with exception: %s " % e)
cmd = 'ping -c 2 vm2'
self.debug("ping vm2 by hostname with command: " + cmd)
outputlist = ssh.execute(cmd)
self.debug("command is executed properly " + cmd)
completeoutput = str(outputlist).strip('[]')
self.debug("complete output is " + completeoutput)
expectedlist = ['2 received', 'vm2.update.com', vm_2.ipaddress]
for item in expectedlist:
if item in completeoutput:
self.debug("excepted value found in vm: " + item)
else:
self.fail("excepted value not found in vm: " + item)
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_05_VPC_Network_With_InternalDns(self):
""" Verify InternalDns on VPC Network
"""
# Validate the following
# 1. Create a VPC and tier network by using DNS network offering.
# 2. Deploy vm1 in tier network.
# 3. Verify dhcp option 06 and 0f for subnet
# 4. Verify dhcp option 06,15 and 0f for vm Interface.
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
cmd.domain = "vpc.com"
self.apiclient.updateZone(cmd)
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)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
self.dnsdata["vpc_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
network_1 = self.create_Network(
network_offering, gateway='10.1.1.1', vpc=vpc)
vm_1 = self.create_VM(network_1)
# VSD verification
self.verify_vsd_network(self.domain.id, network_1, vpc)
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.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.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
@attr(tags=["advanced", "nuagevsp"], required_hardware="true")
def test_06_VPC_Network_With_InternalDns(self):
""" Verify InternalDns on VPC Network by ping with hostname
"""
# Validate the following
# 1. Create a VPC and Tier network by using DNS network offering.
# 2. Deploy vm1 in Tier network network1.
# 3. Verify dhcp option 06 and 0f for subnet
# 4. Verify dhcp option 06,15 and 0f for vm Interface.
# 5. Deploy Vm2.
# 6. Verify end to end by pinging with hostname
cmd = updateZone.updateZoneCmd()
cmd.id = self.zone.id
cmd.domain = "vpc.com"
self.apiclient.updateZone(cmd)
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)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
self.dnsdata["vpc_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
network_1 = self.create_Network(
network_offering, gateway='10.1.1.1', vpc=vpc)
vm_1 = self.create_VM(network_1)
# VSD verification
self.verify_vsd_network(self.domain.id, network_1, vpc)
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.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.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
self.test_data["virtual_machine"]["displayname"] = "vm2"
self.test_data["virtual_machine"]["name"] = "vm2"
vm_2 = self.create_VM(network_1)
self.test_data["virtual_machine"]["displayname"] = "vm1"
self.test_data["virtual_machine"]["name"] = "vm1"
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.com", nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True)
public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc)
self.create_StaticNatRule_For_VM(vm_1, public_ip_1, network_1)
# Adding Network ACL rule in the Public tier
self.debug("Adding Network ACL rule to make the created NAT rule "
"(SSH) accessible...")
public_ssh_rule = self.create_NetworkAclRule(
self.test_data["ingress_rule"], network=network_1)
# VSD verification
self.verify_vsd_firewall_rule(public_ssh_rule)
vm_public_ip = public_ip_1.ipaddress.ipaddress
try:
vm_1.ssh_ip = vm_public_ip
vm_1.ssh_port = self.test_data["virtual_machine"]["ssh_port"]
vm_1.username = self.test_data["virtual_machine"]["username"]
vm_1.password = self.test_data["virtual_machine"]["password"]
self.debug("SSHing into VM: %s with %s" %
(vm_1.ssh_ip, vm_1.password))
ssh = vm_1.get_ssh_client(ipaddress=vm_public_ip)
except Exception as e:
self.fail("SSH into VM failed with exception %s" % e)
cmd = 'ping -c 2 vm2'
self.debug("ping vm2 by hostname with command: " + cmd)
outputlist = ssh.execute(cmd)
self.debug("command is executed properly " + cmd)
completeoutput = str(outputlist).strip('[]')
self.debug("complete output is " + completeoutput)
expectedlist = ['2 received', 'vm2.vpc.com', vm_2.ipaddress]
for item in expectedlist:
if item in completeoutput:
self.debug("excepted value found in vm: " + item)
else:
self.fail("excepted value not found in vm: " + item)

View File

@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.
""" Component tests for user data and password reset functionality with Nuage VSP SDN plugin
""" Component tests for user data and password reset functionality with
Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import nuageTestCase
@ -31,7 +32,8 @@ import base64
class TestNuagePasswordReset(nuageTestCase):
"""Test user data and password reset functionality with Nuage VSP SDN plugin
"""Test user data and password reset functionality with
Nuage VSP SDN plugin
"""
@classmethod
@ -60,22 +62,26 @@ class TestNuagePasswordReset(nuageTestCase):
if isinstance(list_volume, list):
self.volume = list_volume[0]
else:
raise Exception("Exception: Unable to find root volume for VM with ID - %s" % vm.id)
self.pw_enabled_template = Template.create(self.api_client,
self.test_data["template"],
self.volume.id,
account=self.account.name,
domainid=self.account.domainid
)
raise Exception("Exception: Unable to find root volume for VM "
"with ID - %s" % vm.id)
self.pw_enabled_template = Template.create(
self.api_client,
self.test_data["template"],
self.volume.id,
account=self.account.name,
domainid=self.account.domainid
)
self.assertEqual(self.pw_enabled_template.passwordenabled, True,
"template is not passwordenabled"
"Template is not password enabled"
)
self.cleanup.append(self.pw_enabled_template)
self.debug("Created guest VM template")
# updateTemplate - Updates value of the guest VM template's password enabled setting
# updateTemplate - Updates value of the guest VM template's password
# enabled setting
def updateTemplate(self, value):
self.debug("Updating value of guest VM template's password enabled setting")
self.debug("Updating value of guest VM template's password enabled "
"setting")
cmd = updateTemplate.updateTemplateCmd()
cmd.id = self.template.id
cmd.passwordenabled = value
@ -96,7 +102,8 @@ class TestNuagePasswordReset(nuageTestCase):
user_data_url = 'curl "http://' + gateway + ':80/latest/user-data"'
return user_data_url
# create_and_verify_fw - Creates and verifies (Ingress) firewall rule with a Static NAT rule enabled public IP
# create_and_verify_fw - Creates and verifies (Ingress) firewall rule with
# a Static NAT rule enabled public IP
def create_and_verify_fw(self, vm, public_ip, network):
self.debug("Creating and verifying firewall rule")
self.create_StaticNatRule_For_VM(vm, public_ip, network)
@ -104,7 +111,8 @@ class TestNuagePasswordReset(nuageTestCase):
# VSD verification
self.verify_vsd_floating_ip(network, vm, public_ip.ipaddress)
fw_rule = self.create_FirewallRule(public_ip, self.test_data["ingress_rule"])
fw_rule = self.create_FirewallRule(
public_ip, self.test_data["ingress_rule"])
# VSD verification
self.verify_vsd_firewall_rule(fw_rule)
@ -122,14 +130,17 @@ class TestNuagePasswordReset(nuageTestCase):
if vm.state != 'Stopped':
raise Exception("Failed to stop VM (ID: %s) " % self.vm.id)
else:
raise Exception("Invalid response from list_virtual_machines VM (ID: %s) " % self.vm.id)
raise Exception("Invalid response from list_virtual_machines VM "
"(ID: %s) " % self.vm.id)
self.debug("Stopped VM")
# install_cloud_set_guest_password_script - Installs the cloud-set-guest-password script from people.apache.org in
# the given VM (SSH client)
# install_cloud_set_guest_password_script - Installs the
# cloud-set-guest-password script from people.apache.org in the given VM
# (SSH client)
def install_cloud_set_guest_password_script(self, ssh_client):
self.debug("Installing cloud-set-guest-password script")
cmd = "cd /etc/init.d;wget http://people.apache.org/~tsp/cloud-set-guest-password"
cmd = "cd /etc/init.d;wget http://people.apache.org/~tsp/" \
"cloud-set-guest-password"
result = self.execute_cmd(ssh_client, cmd)
self.debug("wget file cloud-set-guest-password: " + result)
if "200 OK" not in result:
@ -145,53 +156,71 @@ class TestNuagePasswordReset(nuageTestCase):
@attr(tags=["advanced", "nuagevsp"], required_hardware="true")
def test_nuage_UserDataPasswordReset(self):
"""Test user data and password reset functionality with Nuage VSP SDN plugin
"""Test user data and password reset functionality with
Nuage VSP SDN plugin
"""
# 1. Create an Isolated Network with Nuage VSP Isolated Network offering, check if it is successfully created
# and is in the "Allocated" state.
# 1. Create an Isolated Network with Nuage VSP Isolated Network
# offering, check if it is successfully created and is in the
# "Allocated" state.
# 2. Set password enabled to false in the guest VM template.
# 3. Deploy a VM in the created Isolated network with user data, check if the Isolated network state is changed
# to "Implemented", and both the VM & VR are successfully deployed and are in the "Running" state.
# 4. Verify that the guest VM template is not password enabled by checking the deployed VM's password
# (password == "password").
# 5. SSH into the deployed VM and verify its user data (expected user data == actual user data).
# 6. Check for cloud-set-guest-password script in the deployed VM for testing password reset functionality.
# 7. if cloud-set-guest-password script does not exist in the deployed VM:
# 7.1 Install the cloud-set-guest-password script from people.apache.org in the deployed VM.
# 7.2 Stop the deployed VM, and create a new password enabled guest VM template with it.
# 7.3 Deploy a new VM in the created Isolated network with the newly created guest VM template,
# check if the VM is successfully deployed and is in the "Running" state.
# 7.4 Verify that the new guest VM template is password enabled by checking the newly deployed VM's
# password (password != "password").
# 3. Deploy a VM in the created Isolated network with user data, check
# if the Isolated network state is changed to "Implemented", and
# both the VM & VR are successfully deployed and are in the
# "Running" state.
# 4. Verify that the guest VM template is not password enabled by
# checking the deployed VM's password (password == "password").
# 5. SSH into the deployed VM and verify its user data
# (expected user data == actual user data).
# 6. Check for cloud-set-guest-password script in the deployed VM for
# testing password reset functionality.
# 7. if cloud-set-guest-password script does not exist in the deployed
# VM:
# 7.1 Install the cloud-set-guest-password script from
# people.apache.org in the deployed VM.
# 7.2 Stop the deployed VM, and create a new password enabled
# guest VM template with it.
# 7.3 Deploy a new VM in the created Isolated network with the
# newly created guest VM template, check if the VM is
# successfully deployed and is in the "Running" state.
# 7.4 Verify that the new guest VM template is password enabled
# by checking the newly deployed VM's password
# (password != "password").
# 7.5 SSH into the newly deployed VM for verifying its password.
# 8. else cloud-set-guest-password script exists in the deployed VM:
# 8.1 Change password enabled to true in the guest VM template.
# 8.2 Verify that the guest VM template is password enabled.
# 9. Reset VM password, and start the VM.
# 10. Verify that the new guest VM template is password enabled by checking the VM's password
# (password != "password").
# 11. SSH into the VM for verifying its new password after its password reset.
# 12. Set password enabled to the default value in the guest VM template.
# 10. Verify that the new guest VM template is password enabled by
# checking the VM's password (password != "password").
# 11. SSH into the VM for verifying its new password after its password
# reset.
# 12. Set password enabled to the default value in the guest VM
# template.
# 13. Delete all the created objects (cleanup).
self.debug("Testing user data & password reset functionality in an Isolated network...")
self.debug("Testing user data & password reset functionality in an "
"Isolated network...")
self.debug("Creating an Isolated network...")
net_off = self.create_NetworkOffering(self.test_data["nuagevsp"]["isolated_network_offering"])
net_off = self.create_NetworkOffering(
self.test_data["nuagevsp"]["isolated_network_offering"])
self.network = self.create_Network(net_off)
self.validate_Network(self.network, state="Allocated")
self.debug("Setting password enabled to false in the guest VM template...")
self.debug("Setting password enabled to false in the guest VM "
"template...")
self.defaultTemplateVal = self.template.passwordenabled
if self.template.passwordenabled:
self.updateTemplate(False)
self.debug("Deploying a VM in the created Isolated network with user data...")
self.debug("Deploying a VM in the created Isolated network with user "
"data...")
expected_user_data = "hello world vm1"
user_data = base64.b64encode(expected_user_data)
self.test_data["virtual_machine_userdata"]["userdata"] = user_data
self.vm_1 = self.create_VM(self.network, testdata=self.test_data["virtual_machine_userdata"])
self.vm_1 = self.create_VM(
self.network, testdata=self.test_data["virtual_machine_userdata"])
self.validate_Network(self.network, state="Implemented")
vr = self.get_Router(self.network)
self.check_Router_state(vr, state="Running")
@ -202,11 +231,15 @@ class TestNuagePasswordReset(nuageTestCase):
self.verify_vsd_router(vr)
self.verify_vsd_vm(self.vm_1)
self.debug("verifying that the guest VM template is not password enabled...")
self.debug("VM - %s password - %s !" % (self.vm_1.name, self.vm_1.password))
self.assertEqual(self.vm_1.password, self.test_data["virtual_machine_userdata"]["password"],
"Password is enabled for the VM (vm_1)"
)
self.debug("verifying that the guest VM template is not password "
"enabled...")
self.debug("VM - %s password - %s !" %
(self.vm_1.name, self.vm_1.password))
self.assertEqual(
self.vm_1.password,
self.test_data["virtual_machine_userdata"]["password"],
"Password is enabled for the VM (vm_1)"
)
self.debug("SSHing into the VM for verifying its user data...")
public_ip_1 = self.acquire_PublicIPAddress(self.network)
@ -214,27 +247,35 @@ class TestNuagePasswordReset(nuageTestCase):
ssh = self.ssh_into_VM(self.vm_1, public_ip_1)
user_data_cmd = self.get_userdata_url(self.vm_1)
self.debug("Getting user data with command: " + user_data_cmd)
actual_user_data = base64.b64decode(self.execute_cmd(ssh, user_data_cmd))
self.debug("Actual user data - " + actual_user_data + ", Expected user data - " + expected_user_data)
actual_user_data = base64.b64decode(self.execute_cmd
(ssh, user_data_cmd))
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"
)
self.debug("Checking for cloud-set-guest-password script in the VM for testing password reset functionality...")
self.debug("Checking for cloud-set-guest-password script in the VM "
"for testing password reset functionality...")
ls_cmd = "ls /etc/init.d/cloud-set-guest-password"
ls_result = self.execute_cmd(ssh, ls_cmd)
ls_result = ls_result.lower()
self.debug("Response from ls_cmd: " + ls_result)
if "no such file" in ls_result:
self.debug("No cloud-set-guest-password script in the VM")
self.debug("Installing the cloud-set-guest-password script from people.apache.org in the VM...")
self.debug("Installing the cloud-set-guest-password script from "
"people.apache.org in the VM...")
self.install_cloud_set_guest_password_script(ssh)
self.debug("Stopping the VM, and creating a new password enabled guest VM template with it...")
self.debug("Stopping the VM, and creating a new password enabled "
"guest VM template with it...")
self.stop_vm(self.vm_1)
self.create_template(self.vm_1)
self.debug("Deploying a new VM in the created Isolated network with the newly created guest VM template...")
self.vm_2 = self.create_VM(self.network, testdata=self.test_data["virtual_machine_userdata"])
self.debug("Deploying a new VM in the created Isolated network "
"with the newly created guest VM template...")
self.vm_2 = self.create_VM(
self.network,
testdata=self.test_data["virtual_machine_userdata"])
self.debug("Starting the VM...")
vm_2a = self.vm_2.start(self.api_client)
self.vm_2.password = vm_2a.password.strip()
@ -243,11 +284,15 @@ class TestNuagePasswordReset(nuageTestCase):
# VSD verification
self.verify_vsd_vm(self.vm_2)
self.debug("verifying that the guest VM template is password enabled...")
self.debug("VM - %s password - %s !" % (self.vm_2.name, self.vm_2.password))
self.assertNotEqual(self.vm_2.password, self.test_data["virtual_machine_userdata"]["password"],
"Password is not enabled for the VM"
)
self.debug("verifying that the guest VM template is password "
"enabled...")
self.debug("VM - %s password - %s !" %
(self.vm_2.name, self.vm_2.password))
self.assertNotEqual(
self.vm_2.password,
self.test_data["virtual_machine_userdata"]["password"],
"Password is not enabled for the VM"
)
self.debug("SSHing into the VM for verifying its password...")
public_ip_2 = self.acquire_PublicIPAddress(self.network)
@ -272,14 +317,20 @@ class TestNuagePasswordReset(nuageTestCase):
self.debug("Starting the VM")
vm_test.start(self.api_client)
self.debug("verifying that the guest VM template is password enabled...")
self.debug("VM - %s password - %s !" % (vm_test.name, vm_test.password))
self.assertNotEqual(vm_test.password, self.test_data["virtual_machine_userdata"]["password"],
"Password is not enabled for the VM"
)
self.debug("verifying that the guest VM template is password "
"enabled...")
self.debug("VM - %s password - %s !" %
(vm_test.name, vm_test.password))
self.assertNotEqual(
vm_test.password,
self.test_data["virtual_machine_userdata"]["password"],
"Password is not enabled for the VM"
)
self.debug("SSHing into the VM for verifying its new password after its password reset...")
self.debug("SSHing into the VM for verifying its new password after "
"its password reset...")
self.ssh_into_VM(vm_test, vm_test_public_ip)
self.debug("Setting password enabled to the default value in the guest VM template...")
self.debug("Setting password enabled to the default value in the "
"guest VM template...")
self.updateTemplate(self.defaultTemplateVal)

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.
""" Component tests for basic VPC Network functionality with Nuage VSP SDN plugin
""" Component tests for basic VPC Network functionality with
Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import nuageTestCase
@ -30,7 +31,7 @@ class TestNuageVpcNetwork(nuageTestCase):
@classmethod
def setUpClass(cls, zone=None):
super(TestNuageVpcNetwork, cls).setUpClass(zone=zone)
super(TestNuageVpcNetwork, cls).setUpClass()
return
def setUp(self):
@ -48,20 +49,26 @@ class TestNuageVpcNetwork(nuageTestCase):
""" Test basic VPC Network functionality with Nuage VSP SDN plugin
"""
# 1. Create Nuage VSP VPC offering, check if it is successfully created and enabled.
# 2. Create a VPC with Nuage VSP VPC offering, check if it is successfully created and enabled.
# 3. Create Nuage VSP VPC Network offering, check if it is successfully created and enabled.
# 1. Create Nuage VSP VPC offering, check if it is successfully
# created and enabled.
# 2. Create a VPC with Nuage VSP VPC offering, check if it is
# successfully created and enabled.
# 3. Create Nuage VSP VPC Network offering, check if it is successfully
# created and enabled.
# 4. Create an ACL list in the created VPC, and add an ACL item to it.
# 5. Create a VPC Network with Nuage VSP VPC Network offering and the created ACL list, check if it is
# successfully created, is in the "Implemented" state, and is added to the VPC VR.
# 6. Deploy a VM in the created VPC network, check if the VM is successfully deployed and is in the "Running"
# state.
# 7. Verify that the created ACL item is successfully implemented in Nuage VSP.
# 5. Create a VPC Network with Nuage VSP VPC Network offering and the
# created ACL list, check if it is successfully created, is in the
# "Implemented" state, and is added to the VPC VR.
# 6. Deploy a VM in the created VPC network, check if the VM is
# successfully deployed and is in the "Running" state.
# 7. Verify that the created ACL item is successfully implemented in
# Nuage VSP.
# 8. Delete all the created objects (cleanup).
# Creating a VPC offering
self.debug("Creating Nuage VSP VPC offering...")
vpc_offering = self.create_VpcOffering(self.test_data["nuagevsp"]["vpc_offering"])
vpc_offering = self.create_VpcOffering(
self.test_data["nuagevsp"]["vpc_offering"])
self.validate_VpcOffering(vpc_offering, state="Enabled")
# Creating a VPC
@ -71,18 +78,23 @@ class TestNuageVpcNetwork(nuageTestCase):
# Creating a network offering
self.debug("Creating Nuage VSP VPC Network offering...")
network_offering = self.create_NetworkOffering(self.test_data["nuagevsp"]["vpc_network_offering"])
network_offering = self.create_NetworkOffering(
self.test_data["nuagevsp"]["vpc_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
# Creating an ACL list
acl_list = self.create_NetworkAclList(name="acl", description="acl", vpc=vpc)
acl_list = self.create_NetworkAclList(
name="acl", description="acl", vpc=vpc)
# Creating an ACL item
acl_item = self.create_NetworkAclRule(self.test_data["ingress_rule"], acl_list=acl_list)
acl_item = self.create_NetworkAclRule(
self.test_data["ingress_rule"], acl_list=acl_list)
# Creating a VPC network in the VPC
self.debug("Creating a VPC network with Nuage VSP VPC Network offering...")
vpc_network = self.create_Network(network_offering, vpc=vpc, acl_list=acl_list)
self.debug("Creating a VPC network with Nuage VSP VPC Network "
"offering...")
vpc_network = self.create_Network(
network_offering, vpc=vpc, acl_list=acl_list)
self.validate_Network(vpc_network, state="Implemented")
vr = self.get_Router(vpc_network)
self.check_Router_state(vr, state="Running")
@ -99,18 +111,25 @@ class TestNuageVpcNetwork(nuageTestCase):
# VSD verification for ACL item
self.verify_vsd_firewall_rule(acl_item)
@attr(tags=["advanced", "nuagevsp", "multizone"], required_hardware="false")
@attr(
tags=["advanced", "nuagevsp", "multizone"], required_hardware="false")
def test_nuage_vpc_network_multizone(self):
""" Test basic VPC Network functionality with Nuage VSP SDN plugin on multiple zones
""" Test basic VPC Network functionality with Nuage VSP SDN plugin on
multiple zones
"""
# Repeat the tests in the above testcase "test_nuage_vpc_network" on multiple zones
# Repeat the tests in the above testcase "test_nuage_vpc_network" on
# multiple zones
self.debug("Testing basic VPC Network functionality with Nuage VSP SDN plugin on multiple zones...")
self.debug("Testing basic VPC Network functionality with Nuage VSP "
"SDN plugin on multiple zones...")
zones = Zone.list(self.api_client)
if len(zones) == 1:
self.skipTest("There is only one Zone configured: skipping test")
for zone in zones:
self.debug("Zone - %s" % zone.name)
self.setUpClass(zone=zone)
# Get Zone details
self.getZoneDetails()
# Configure VSD sessions
self.configureVSDSessions()
self.test_nuage_vpc_network()

View File

@ -45,89 +45,110 @@ class TestNuageVsp(nuageTestCase):
self.cleanup = [self.account]
return
# validate_NuageVspDevice - Validates the addition of Nuage VSP device in the Nuage VSP Physical Network
# validate_NuageVspDevice - Validates the addition of Nuage VSP device in
# the Nuage VSP Physical Network
def validate_NuageVspDevice(self):
"""Validates the addition of Nuage VSP device in the Nuage VSP Physical Network"""
self.debug("Validating the addition of Nuage VSP device in the Nuage VSP Physical Network - %s" %
self.vsp_physical_network.id)
nuage_vsp_device = Nuage.list(self.api_client,
physicalnetworkid=self.vsp_physical_network.id
)
"""Validates the addition of Nuage VSP device in the
Nuage VSP Physical Network"""
self.debug("Validating the addition of Nuage VSP device in the Nuage "
"VSP Physical Network - %s" % self.vsp_physical_network.id)
nuage_vsp_device = Nuage.list(
self.api_client,
physicalnetworkid=self.vsp_physical_network.id
)
self.assertEqual(isinstance(nuage_vsp_device, list), True,
"List Nuage VSP device should return a valid list"
)
self.debug("Successfully validated the addition of Nuage VSP device in the Nuage VSP Physical Network - %s" %
self.debug("Successfully validated the addition of Nuage VSP device "
"in the Nuage VSP Physical Network - %s" %
self.vsp_physical_network.id)
# delete_NuageVspDevice - Deletes the Nuage VSP device in the Nuage VSP Physical Network
# delete_NuageVspDevice - Deletes the Nuage VSP device in the Nuage VSP
# Physical Network
def delete_NuageVspDevice(self):
"""Deletes the Nuage VSP device in the Nuage VSP Physical Network"""
self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical Network - %s" %
self.vsp_physical_network.id)
nuage_vsp_device = Nuage.list(self.api_client,
physicalnetworkid=self.vsp_physical_network.id
)[0]
self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical "
"Network - %s" % self.vsp_physical_network.id)
nuage_vsp_device = Nuage.list(
self.api_client,
physicalnetworkid=self.vsp_physical_network.id)[0]
cmd = deleteNuageVspDevice.deleteNuageVspDeviceCmd()
cmd.vspdeviceid = nuage_vsp_device.vspdeviceid
self.api_client.deleteNuageVspDevice(cmd)
self.debug("Successfully deleted the Nuage VSP device in the Nuage VSP Physical Network - %s" %
self.vsp_physical_network.id)
self.debug("Successfully deleted the Nuage VSP device in the Nuage "
"VSP Physical Network - %s" % self.vsp_physical_network.id)
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_nuage_vsp_device(self):
""" Test Nuage VSP device in the Nuage VSP Physical Network
"""
# 1. Verify that the Nuage VSP network service provider is successfully created and enabled in the Nuage VSP
# Physical Network.
# 2. Verify that the Nuage VSP device is successfully created in the Nuage VSP Physical Network.
# 3. Delete the Nuage VSP device in the Nuage VSP Physical Network, verify that the Nuage VSP device is
# successfully deleted in the Nuage VSP Physical Network.
# 4. Add the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials, verify that the
# Nuage VSP device failed to add in the Nuage VSP Physical Network.
# 5. Add the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials, verify that the
# Nuage VSP device is successfully added in the Nuage VSP Physical Network.
# 1. Verify that the Nuage VSP network service provider is successfully
# created and enabled in the Nuage VSP Physical Network.
# 2. Verify that the Nuage VSP device is successfully created in the
# Nuage VSP Physical Network.
# 3. Delete the Nuage VSP device in the Nuage VSP Physical Network,
# verify that the Nuage VSP device is successfully deleted in the
# Nuage VSP Physical Network.
# 4. Add the Nuage VSP device in the Nuage VSP Physical Network with
# invalid VSD credentials, verify that the Nuage VSP device failed
# to add in the Nuage VSP Physical Network.
# 5. Add the Nuage VSP device in the Nuage VSP Physical Network with
# valid VSD credentials, verify that the Nuage VSP device is
# successfully added in the Nuage VSP Physical Network.
# Nuage VSP network service provider validation
self.debug("Validating the Nuage VSP network service provider in the Nuage VSP Physical Network...")
self.debug("Validating the Nuage VSP network service provider in the "
"Nuage VSP Physical Network...")
self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")
# Nuage VSP device validation
self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
"Network...")
self.validate_NuageVspDevice()
# Nuage VSP device deletion
self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical Network...")
self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical "
"Network...")
self.delete_NuageVspDevice()
# Nuage VSP device validation
self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
"Network...")
with self.assertRaises(Exception):
self.validate_NuageVspDevice()
self.debug("Successfully deleted the Nuage VSP device in the Nuage VSP Physical Network")
self.debug("Successfully deleted the Nuage VSP device in the Nuage "
"VSP Physical Network")
# Adding the Nuage VSP device with invalid VSD credentials
self.debug("Adding the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials...")
self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
"Network with invalid VSD credentials...")
vsd_info = self.nuage_vsp_device.__dict__
invalid_vsd_info = copy.deepcopy(vsd_info)
invalid_vsd_info["password"] = ""
with self.assertRaises(Exception):
Nuage.add(self.api_client, invalid_vsd_info, self.vsp_physical_network.id)
self.debug("Failed to add the Nuage VSP device in the Nuage VSP Physical Network due to invalid VSD "
"credentials")
Nuage.add(
self.api_client, invalid_vsd_info,
self.vsp_physical_network.id)
self.debug("Failed to add the Nuage VSP device in the Nuage VSP "
"Physical Network due to invalid VSD credentials")
# Nuage VSP device validation
self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
self.debug("Validating the Nuage VSP device in the Nuage VSP "
"Physical Network...")
with self.assertRaises(Exception):
self.validate_NuageVspDevice()
self.debug("The Nuage VSP device is not added in the Nuage VSP Physical Network")
self.debug("The Nuage VSP device is not added in the Nuage VSP "
"Physical Network")
# Adding the Nuage VSP device with valid VSD credentials
self.debug("Adding the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials...")
self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
"Network with valid VSD credentials...")
Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)
# Nuage VSP device validation
self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
"Network...")
self.validate_NuageVspDevice()
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
@ -135,26 +156,32 @@ class TestNuageVsp(nuageTestCase):
""" Test Nuage VSP SDN plugin with basic Isolated Network functionality
"""
# 1. Verify that the Nuage VSP network service provider is successfully created and enabled.
# 2. Create and enable Nuage VSP Isolated Network offering, check if it is successfully created and enabled.
# 3. Create an Isolated Network with Nuage VSP Isolated Network offering, check if it is successfully created
# and is in the "Allocated" state.
# 4. Deploy a VM in the created Isolated network, check if the Isolated network state is changed to
# "Implemented", and both the VM & VR are successfully deployed and are in the "Running" state.
# 5. Deploy one more VM in the created Isolated network, check if the VM is successfully deployed and is in the
# "Running" state.
# 6. Delete the created Isolated Network after destroying its VMs, check if the Isolated network is successfully
# deleted.
# 1. Verify that the Nuage VSP network service provider is successfully
# created and enabled.
# 2. Create and enable Nuage VSP Isolated Network offering, check if it
# is successfully created and enabled.
# 3. Create an Isolated Network with Nuage VSP Isolated Network
# offering, check if it is successfully created and is in the
# "Allocated" state.
# 4. Deploy a VM in the created Isolated network, check if the Isolated
# network state is changed to "Implemented", and both the VM & VR
# are successfully deployed and are in the "Running" state.
# 5. Deploy one more VM in the created Isolated network, check if the
# VM is successfully deployed and is in the "Running" state.
# 6. Delete the created Isolated Network after destroying its VMs,
# check if the Isolated network is successfully deleted.
# 7. Delete all the created objects (cleanup).
# Creating a network offering
self.debug("Creating and enabling Nuage VSP Isolated Network offering...")
self.debug("Creating and enabling Nuage VSP Isolated Network "
"offering...")
network_offering = self.create_NetworkOffering(
self.test_data["nuagevsp"]["isolated_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
# Creating a network
self.debug("Creating an Isolated Network with Nuage VSP Isolated Network offering...")
self.debug("Creating an Isolated Network with Nuage VSP Isolated "
"Network offering...")
network = self.create_Network(network_offering)
self.validate_Network(network, state="Allocated")
@ -178,7 +205,8 @@ class TestNuageVsp(nuageTestCase):
self.verify_vsd_vm(vm_2)
# Deleting the network
self.debug("Deleting the Isolated Network with Nuage VSP Isolated Network offering...")
self.debug("Deleting the Isolated Network with Nuage VSP Isolated "
"Network offering...")
self.delete_VM(vm_1)
self.delete_VM(vm_2)
self.delete_Network(network)

View File

@ -37,7 +37,7 @@ def user(Name, DomainName, AcctType):
class cloudstackTestCase(unittest.case.TestCase):
clstestclient = None
def assertElementInList(inp, toverify, responsevar=None, pos=0,
def assertElementInList(self, inp, toverify, responsevar=None, pos=0,
assertmsg="TC Failed for reason"):
'''
@Name: assertElementInList

View File

@ -1731,7 +1731,7 @@ test_data = {
"name": 'nuage_marvin',
"displaytext": 'nuage_marvin',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall',
"supportedservices": 'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall,Dns',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList": {
@ -1740,7 +1740,8 @@ test_data = {
"SourceNat": 'NuageVsp',
"Firewall": 'NuageVsp',
"Connectivity": 'NuageVsp',
"UserData": 'VirtualRouter'
"UserData": 'VirtualRouter',
"Dns": 'VirtualRouter'
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "perzone"}
@ -1751,7 +1752,7 @@ test_data = {
"name": 'nuage_vpc_marvin',
"displaytext": 'nuage_vpc_marvin',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
"supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
@ -1762,7 +1763,8 @@ test_data = {
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
"UserData": "VpcVirtualRouter"
"UserData": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter"
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "perzone"}
@ -1772,7 +1774,7 @@ test_data = {
"name": "nuage_vpc_marvin_internal_lb",
"displaytext": "nuage_vpc_marvin_internal_lb",
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
"supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
@ -1784,7 +1786,8 @@ test_data = {
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
"UserData": "VpcVirtualRouter"
"UserData": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter"
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "perzone"},
@ -1795,20 +1798,21 @@ test_data = {
"vpc_offering": {
"name": 'Nuage VSP VPC offering',
"displaytext": 'Nuage VSP VPC offering',
"supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
"supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"serviceProviderList": {
"Dhcp": "NuageVsp",
"StaticNat": "NuageVsp",
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
"UserData": "VpcVirtualRouter"
"UserData": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter"
}
},
"vpc_offering_lb": {
"name": 'Nuage VSP VPC offering with Lb',
"displaytext": 'Nuage VSP VPC offering with Lb',
"supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
"supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"serviceProviderList": {
"Dhcp": "NuageVsp",
"Lb": "InternalLbVm",
@ -1816,7 +1820,8 @@ test_data = {
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
"UserData": "VpcVirtualRouter"
"UserData": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter"
}
}
}

View File

@ -56,6 +56,9 @@ setup(name="Marvin",
"dnspython",
"ipmisim >= 0.7"
],
extras_require={
"nuagevsp": ["libVSD", "PyYAML", "futures", "netaddr", "retries"]
},
py_modules=['marvin.marvinPlugin'],
zip_safe=False,
entry_points={