コード例 #1
0
    def test_cannot_update_sg_id(self):
        sg_obj = SecurityGroup('%s-sg' % self.id())
        self.api.security_group_create(sg_obj)
        sg_obj = self.api.security_group_read(id=sg_obj.uuid)

        sg_obj.set_security_group_id(8000042)
        with ExpectedException(PermissionDenied):
            self.api.security_group_update(sg_obj)

        # test can update with same value, needed internally
        # TODO(ethuleau): not sure why it's needed
        sg_obj = self.api.security_group_read(id=sg_obj.uuid)
        sg_obj.set_security_group_id(sg_obj.security_group_id)
        self.api.security_group_update(sg_obj)
コード例 #2
0
    def test_cannot_update_sg_id(self):
        sg_obj = SecurityGroup('%s-sg' % self.id())
        self.api.security_group_create(sg_obj)
        sg_obj = self.api.security_group_read(id=sg_obj.uuid)

        sg_obj.set_security_group_id(8000042)
        with ExpectedException(PermissionDenied):
            self.api.security_group_update(sg_obj)

        # test can update with same value, needed internally
        # TODO(ethuleau): not sure why it's needed
        sg_obj = self.api.security_group_read(id=sg_obj.uuid)
        sg_obj.set_security_group_id(sg_obj.security_group_id)
        self.api.security_group_update(sg_obj)
コード例 #3
0
    def test_cannot_set_sg_id(self):
        sg_obj = SecurityGroup('%s-sg' % self.id())

        sg_obj.set_security_group_id(8000042)
        with ExpectedException(PermissionDenied):
            self.api.security_group_create(sg_obj)
コード例 #4
0
    def test_cannot_set_sg_id(self):
        sg_obj = SecurityGroup('%s-sg' % self.id())

        sg_obj.set_security_group_id(8000042)
        with ExpectedException(PermissionDenied):
            self.api.security_group_create(sg_obj)