Example #1
0
    def setUp(self):
        super(DomainAdminTests, self).setUp()

        # Client used during tests
        self.client = utils.create_client_domain(self.d1admin.name,
                                                 'd1admin',
                                                 self.d1.name,
                                                 'http://localhost:5000/v3')
    def setUp(self):
        super(ProjectAdminTests, self).setUp()

        # Client used during tests
        self.client = utils.create_client_domain(self.d1admin.name,
                                                 'd1admin',
                                                 self.d1.name,
                                                 'http://10.1.0.22:5000/v3')
    def setUp(self):
        """
        Assumes the pre existence of the cloud_admin rule:
        "cloud_admin": "rule:admin_required and domain_id:admin_domain_id"

        projects: p1, p2
        domains: d1, d2
        groups: g1, g2
        users: p1admin, p1member, p2admin, p2member

        d1admin -> admin -> d1
        p1admin -> admin -> p1
        p1member -> member -> p1
        p2admin -> admin -> p2
        p2member -> member -> p2

        """

        # Authenticate with admin
        self.admin_client = utils.create_client_domain(
            'cloud_admin',
            'cloud_admin',
            'cloud_admin_domain',
            'http://localhost:5000/v3')
        self.admin = utils.find_user(self.admin_client, 'cloud_admin')

        self._create_roles()
        self._create_domains()
        self._create_projects()
        self._create_users()
        self._create_groups()

        # Add users to groups
        self.admin_client.users.add_to_group(self.p1member, self.g1)
        self.admin_client.users.add_to_group(self.p2member, self.g2)

        self._grant_roles()