Beispiel #1
0
 def set_up(self):
     self.client = create_client(is_admin=False)
     self.mgmt_client = create_client(is_admin=True)
     flavor_name = test_config.values.get('instance_flavor_name', 'm1.tiny')
     flavors = self.client.find_flavors_by_name(flavor_name)
     self.flavor_id = flavors[0].id
     self.name = "TEST_" + str(datetime.now())
     # Get the resize to flavor.
     flavor2_name = test_config.values.get('instance_bigger_flavor_name',
                                           'm1.small')
     flavors2 = self.client.find_flavors_by_name(flavor2_name)
     self.new_flavor_id = flavors2[0].id
     assert_not_equal(self.flavor_id, self.new_flavor_id)
 def set_up(self):
     self.client = create_client(is_admin=False)
     self.mgmt_client = create_client(is_admin=True)
     flavor_name = test_config.values.get('instance_flavor_name', 'm1.tiny')
     flavors = self.client.find_flavors_by_name(flavor_name)
     self.flavor_id = flavors[0].id
     self.name = "TEST_" + str(datetime.now())
     # Get the resize to flavor.
     flavor2_name = test_config.values.get('instance_bigger_flavor_name',
                                           'm1.small')
     flavors2 = self.client.find_flavors_by_name(flavor2_name)
     self.new_flavor_id = flavors2[0].id
     assert_not_equal(self.flavor_id, self.new_flavor_id)
Beispiel #3
0
 def set_up(self):
     if not FAKE_MODE:
         raise SkipTest("This test only works in fake mode.")
     self.client = create_client(is_admin=True)
     self.mgmt = self.client.management
     # Fake nova will fail a server ending with 'test_SERVER_ERROR'."
     response = self.client.instances.create('test_SERVER_ERROR', 1,
                                             {'size': 1}, [])
     poll_until(lambda: self.client.instances.get(response.id),
                lambda instance: instance.status == 'ERROR',
                time_out=10)
     self.id = response.id
    def set_up(self):
        self.client = create_client(is_admin=False)
        self.name = 'test_createInstance_container'
        self.flavor = 1
        self.volume_size = 1
        db_name = 'test_db'
        self.databases = [{"name": db_name}]
        users = []
        users.append({
            "name": "lite",
            "password": "******",
            "databases": [{
                "name": db_name
            }]
        })

        #create the Instance
        self.instance = InstanceGenerator(self.client,
                                          name=self.name,
                                          flavor=self.flavor,
                                          volume_size=self.volume_size,
                                          databases=self.databases,
                                          users=users)
        inst = self.instance.create_instance()

        #wait for the instance
        self.instance.wait_for_build_to_finish()

        #get the active instance
        instance.get_active_instance

        #list out the databases for our instance and verify the db name
        dbs = self.client.databases.list(inst.id)
        self.client.assert_http_code(200)

        assert_equal(len(dbs), 1)
        assert_equal(dbs[0].name, self.instance.db_name)

        instance = self.client.instance.delete(inst.id)
        self.client.assert_http_code(202)
Beispiel #5
0
    def set_up(self):
        self.client = create_client(is_admin=False)
        self.name = 'test_createInstance_container'
        self.flavor = 1
        self.volume_size = 1
        db_name = 'test_db'
        self.databases = [
                {
                    "name": db_name
                }
            ]
        users = []
        users.append({"name": "lite", "password": "******",
                      "databases": [{"name": db_name}]})

        #create the Instance
        self.instance = InstanceGenerator(self.client, name=self.name,
            flavor=self.flavor, volume_size=self.volume_size,
            databases=self.databases, users=users)
        inst = self.instance.create_instance()

        #wait for the instance
        self.instance.wait_for_build_to_finish()

        #get the active instance
        instance.get_active_instance

        #list out the databases for our instance and verify the db name
        dbs = self.client.databases.list(inst.id)
        self.client.assert_http_code(200)

        assert_equal(len(dbs), 1)
        assert_equal(dbs[0].name, self.instance.db_name)

        instance = self.client.instance.delete(inst.id)
        self.client.assert_http_code(202)
Beispiel #6
0
def mgmt_index_requires_admin_account():
    """ Verify that an admin context is required to call this function. """
    client = create_client(is_admin=False)
    assert_raises(exceptions.Unauthorized, client.management.index)
 def setup(self):
     self.client = create_client(is_admin=False)
Beispiel #8
0
 def setup(self):
     self.client = create_client(is_admin=False)