Ejemplo n.º 1
0
    def test_customized_tempest_conf(self,
                                     get_services,
                                     get_external_network_id,
                                     get_smallest_image,
                                     get_smallest_flavor):

        get_services.return_value = {'image': 'url'}
        get_external_network_id.return_value = 32
        get_smallest_image.return_value = 23
        get_smallest_flavor.return_value = 42

        users = {'admin_user': {'username': '******',
                                'password': '******',
                                'tenant_name': 'admin_tenant'},
                 'first_user': {'username': '******',
                                'password': '******',
                                'tenant_name': 'tenant'},
                 'second_user': {'username': '******',
                                 'password': '******',
                                 'tenant_name': 'tenant'}}

        content = utils.customized_tempest_conf(users, "http://keystone_url")

        self.assertIn("[DEFAULT]", content)
        self.assertIn("use_stderr = False", content)
        self.assertIn("log_file = tempest.log", content)
        self.assertIn("[compute]", content)
        self.assertIn("image_ref = 23", content)
        self.assertIn("image_ref_alt = 23", content)
        self.assertIn("allow_tenant_isolation = False", content)
        self.assertIn("flavor_ref = 42", content)
        self.assertIn("flavor_ref_alt = 42", content)
        self.assertIn("[network]", content)
        self.assertIn("public_network_id = 32", content)
        self.assertIn("[object_storage]", content)
        self.assertIn("operator_role = admin_tenant", content)
        self.assertIn("[service_available]", content)
        self.assertIn("cinder = False", content)
        self.assertIn("glance = True", content)
        self.assertIn("swift = False", content)
        self.assertIn("nova = False", content)
        self.assertIn("neutron = False", content)
        self.assertIn("[identity]", content)
        #self.assertIn("uri = keystone_url", content)
        self.assertIn("username = user", content)
        self.assertIn("alt_username = user", content)
        self.assertIn("admin_username = admin", content)
        self.assertIn("password = password", content)
        self.assertIn("alt_password = password", content)
        self.assertIn("admin_password = admin_password", content)
        self.assertIn("tenant_name = \"tenant\"", content)
        self.assertIn("alt_tenant_name = \"tenant\"", content)
        self.assertIn("admin_tenant_name = \"admin_tenant\"", content)
        self.assertIn("admin_role = \"admin_tenant\"", content)