cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shwetaag <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1401: automated 9277 9276 9275 9274 9273 9179 9178 ...
Date Fri, 17 Feb 2017 08:37:50 GMT
Github user shwetaag commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1401#discussion_r101708208
  
    --- Diff: test/integration/component/test_escalations_instances.py ---
    @@ -2068,6 +2068,94 @@ def test_13_vm_nics(self):
                     "VM NIC is not same as expected"
                 )
             return
    +    @attr(tags=["advanced", "basic"], required_hardware="true")
    +    def test_14_Create_vm_with_same_sshkey(self):
    +        """
    +        @Desc: Test to verify API call Register ssh key pair fails when uses same public
key for differnet key name
    +        """
    +
    +
    +        # Listing all the SSH Key pairs
    +        list_keypairs_before = SSHKeyPair.list(
    +            self.userapiclient
    +        )
    +        list_keypairs_before_size = 0
    +        if list_keypairs_before is not None:
    +            list_keypairs_before_size = len(list_keypairs_before)
    +
    +        # Registering first Key pair
    +        new_keypair1 = SSHKeyPair.register(
    +            self.userapiclient,
    +            name="keypair1",
    +            publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2")
    +        self.assertIsNotNone(
    +            new_keypair1,
    +            "New Key pair generation failed"
    +        )
    +        self.assertEquals(
    +            "keypair1",
    +            new_keypair1.name,
    +            "Key Pair not created with given name"
    +        )
    +        # Listing all the SSH Key pairs again
    +        list_keypairs_after = SSHKeyPair.list(
    +            self.userapiclient
    +        )
    +        status = validateList(list_keypairs_after)
    +        self.assertEquals(
    +            PASS,
    +            status[0],
    +            "Listing of Key pairs failed"
    +        )
    +        # Verifying that list size is increased by 1
    +        self.assertEquals(
    +            list_keypairs_before_size + 1,
    +            len(list_keypairs_after),
    +            "List count is not matching"
    +        )
    +        try:
    +
    +            # Registering second key pair using same public key
    +            new_keypair2 = SSHKeyPair.register(
    +                self.userapiclient,
    +                name="keypair2",
    +                publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2")
    +            self.fail("SSH Key creation passed using same public key ")
    +        except CloudstackAPIException  as e:
    +            self.assertRaises("Exception Raised : %s" % e)
    --- End diff --
    
    Moved assertRaise in the end of the test case to execute the case completely


---
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.
---

Mime
View raw message