You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by sanju1010 <gi...@git.apache.org> on 2016/04/06 12:45:24 UTC

[GitHub] cloudstack pull request: New test to validate starting vm after ni...

Github user sanju1010 commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1326#discussion_r58685208
  
    --- Diff: test/integration/component/test_add_remove_network.py ---
    @@ -1021,6 +1021,103 @@ def test_29_remove_nic_CS22503(self):
                 self.fail("Failed to delete the nic from vm")
             return
     
    +    @attr(tags=["advanced"], required_hardware="true")
    +    def test_30_remove_nic_reattach(self):
    +        """
    +         Test to verify vm start after NIC removal and reattach
    +
    +         # 1.Create vm which has 3 nics(e.g. #0,#1,#2)
    +         # 2.Stop the vm
    +         # 3.Remove second nic(#1)
    +         # 4.Add/Reattach same network(#1)
    +         # 5.Start the instance
    +        """
    +        self.ntwk2 = Network.create(
    +            self.apiclient,
    +            self.services["isolated_network"],
    +            self.account.name,
    +            self.account.domainid,
    +            networkofferingid=self.isolated_network_offering.id
    +        )
    +        self.ntwk3 = Network.create(
    +            self.apiclient,
    +            self.services["isolated_network"],
    +            self.account.name,
    +            self.account.domainid,
    +            networkofferingid=self.isolated_network_offering.id
    +        )
    +        self.test_vm = VirtualMachine.create(
    +            self.apiclient,
    +            self.services["virtual_machine"],
    +            accountid=self.account.name,
    +            domainid=self.account.domainid,
    +            serviceofferingid=self.service_offering.id,
    +            mode=self.zone.networktype,
    +            networkids=[self.isolated_network.id, self.ntwk2.id, self.ntwk3.id]
    +        )
    +        self.assertIsNotNone(self.test_vm, "Failed to create vm with 3 nics")
    +        map(lambda x: self.cleanup.append(x), [self.test_vm, self.ntwk2, self.ntwk3])
    +        vm_res = VirtualMachine.list(
    +            self.apiclient,
    +            id=self.test_vm.id
    +        )
    +        self.assertEqual(validateList(vm_res)[0], PASS, "Invalid list vm response")
    +        self.nics = vm_res[0].nic
    +        self.assertEqual(
    +            validateList(self.nics)[0],
    +            PASS,
    +            "vm response does not conain nics info"
    --- End diff --
    
    @GabrielBrascher , I have corrected the type. Can you please review and give LGTM ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---