コード例 #1
0
 def setUpClass(cls):
     raise nose.SkipTest("Until Bug 1046870 is fixed")
     super(ServersNegativeTest, cls).setUpClass()
     cls.client = cls.servers_client
     cls.img_client = cls.images_client
     cls.alt_os = openstack.AltManager()
     cls.alt_client = cls.alt_os.servers_client
コード例 #2
0
    def setUpClass(cls):
        super(ServerDetailsNegativeTest, cls).setUpClass()
        cls.client = cls.servers_client
        cls.servers = []

        if compute.MULTI_USER:
            if cls.config.compute.allow_tenant_isolation:
                creds = cls._get_isolated_creds()
                username, tenant_name, password = creds
                cls.alt_manager = openstack.Manager(username=username,
                                                    password=password,
                                                    tenant_name=tenant_name)
            else:
                # Use the alt_XXX credentials in the config file
                cls.alt_manager = openstack.AltManager()
            cls.alt_client = cls.alt_manager.servers_client
コード例 #3
0
ファイル: test_images.py プロジェクト: mindpool/tempest
    def setUpClass(cls):
        raise nose.SkipTest("Until Bug 1046870 is fixed")
        super(ImagesTestXML, cls).setUpClass()
        cls.client = cls.images_client
        cls.servers_client = cls.servers_client

        cls.image_ids = []

        if compute.MULTI_USER:
            if cls.config.compute.allow_tenant_isolation:
                creds = cls._get_isolated_creds()
                username, tenant_name, password = creds
                cls.alt_manager = openstack.Manager(username=username,
                                                    password=password,
                                                    tenant_name=tenant_name)
            else:
                # Use the alt_XXX credentials in the config file
                cls.alt_manager = openstack.AltManager()
            cls.alt_client = cls.alt_manager.images_client
コード例 #4
0
    def setUpClass(cls):
        super(ListServersNegativeTest, cls).setUpClass()
        cls.client = cls.servers_client
        cls.servers = []

        if compute.MULTI_USER:
            if cls.config.compute.allow_tenant_isolation:
                creds = cls._get_isolated_creds()
                username, tenant_name, password = creds
                cls.alt_manager = openstack.Manager(username=username,
                                                    password=password,
                                                    tenant_name=tenant_name)
            else:
                # Use the alt_XXX credentials in the config file
                cls.alt_manager = openstack.AltManager()
            cls.alt_client = cls.alt_manager.servers_client

        # Under circumstances when there is not a tenant/user
        # created for the test case, the test case checks
        # to see if there are existing servers for the
        # either the normal user/tenant or the alt user/tenant
        # and if so, the whole test is skipped. We do this
        # because we assume a baseline of no servers at the
        # start of the test instead of destroying any existing
        # servers.
        resp, body = cls.client.list_servers()
        servers = body['servers']
        num_servers = len(servers)
        if num_servers > 0:
            username = cls.os.username
            tenant_name = cls.os.tenant_name
            msg = ("User/tenant %(username)s/%(tenant_name)s already have "
                   "existing server instances. Skipping test.") % locals()
            raise nose.SkipTest(msg)

        resp, body = cls.alt_client.list_servers()
        servers = body['servers']
        num_servers = len(servers)
        if num_servers > 0:
            username = cls.alt_manager.username
            tenant_name = cls.alt_manager.tenant_name
            msg = ("Alt User/tenant %(username)s/%(tenant_name)s already have "
                   "existing server instances. Skipping test.") % locals()
            raise nose.SkipTest(msg)

        # The following servers are created for use
        # by the test methods in this class. These
        # servers are cleaned up automatically in the
        # tearDownClass method of the super-class.
        cls.existing_fixtures = []
        cls.deleted_fixtures = []
        for x in xrange(2):
            srv = cls.create_server()
            cls.existing_fixtures.append(srv)

        srv = cls.create_server()
        cls.client.delete_server(srv['id'])
        # We ignore errors on termination because the server may
        # be put into ERROR status on a quick spawn, then delete,
        # as the compute node expects the instance local status
        # to be spawning, not deleted. See LP Bug#1061167
        cls.client.wait_for_server_termination(srv['id'], ignore_error=True)
        cls.deleted_fixtures.append(srv)
コード例 #5
0
    def setUpClass(cls):
        if not compute.MULTI_USER:
            msg = "Need >1 user"
            raise nose.SkipTest(msg)

        super(AuthorizationTest, cls).setUpClass()

        cls.client = cls.os.servers_client
        cls.images_client = cls.os.images_client
        cls.keypairs_client = cls.os.keypairs_client
        cls.security_client = cls.os.security_groups_client
        cls.console_outputs_client = cls.os.console_outputs_client

        if cls.config.compute.allow_tenant_isolation:
            creds = cls._get_isolated_creds()
            username, tenant_name, password = creds
            cls.alt_manager = openstack.Manager(username=username,
                                                password=password,
                                                tenant_name=tenant_name)
        else:
            # Use the alt_XXX credentials in the config file
            cls.alt_manager = openstack.AltManager()

        cls.alt_client = cls.alt_manager.servers_client
        cls.alt_images_client = cls.alt_manager.images_client
        cls.alt_keypairs_client = cls.alt_manager.keypairs_client
        cls.alt_security_client = cls.alt_manager.security_groups_client
        cls.alt_console_outputs_client = cls.alt_manager.console_outputs_client

        cls.alt_security_client._set_auth()
        name = rand_name('server')
        resp, server = cls.client.create_server(name, cls.image_ref,
                                                cls.flavor_ref)
        cls.client.wait_for_server_status(server['id'], 'ACTIVE')
        resp, cls.server = cls.client.get_server(server['id'])

        name = rand_name('image')
        resp, body = cls.client.create_image(server['id'], name)
        image_id = parse_image_id(resp['location'])
        cls.images_client.wait_for_image_resp_code(image_id, 200)
        cls.images_client.wait_for_image_status(image_id, 'ACTIVE')
        resp, cls.image = cls.images_client.get_image(image_id)

        cls.keypairname = rand_name('keypair')
        resp, keypair = \
            cls.keypairs_client.create_keypair(cls.keypairname)

        name = rand_name('security')
        description = rand_name('description')
        resp, cls.security_group = \
        cls.security_client.create_security_group(name, description)

        parent_group_id = cls.security_group['id']
        ip_protocol = 'tcp'
        from_port = 22
        to_port = 22
        resp, cls.rule =\
        cls.security_client.create_security_group_rule(\
                                        parent_group_id,
                                        ip_protocol, from_port,
                                        to_port)
コード例 #6
0
 def setUpClass(cls):
     super(ServersNegativeTest, cls).setUpClass()
     cls.client = cls.servers_client
     cls.img_client = cls.images_client
     cls.alt_os = openstack.AltManager()
     cls.alt_client = cls.alt_os.servers_client