Пример #1
0
    def cleanup(self):
        """Delete tenants and users, using pool of threads."""

        concurrent = self.config["concurrent"]

        # Delete users
        users_chunks = utils.chunks(self.context["users"], concurrent)
        utils.run_concurrent(concurrent, UserGenerator, "_delete_users",
                             [(self.endpoint, users)
                              for users in users_chunks])

        # Delete tenants
        tenants_chunks = utils.chunks(self.context["tenants"], concurrent)
        utils.run_concurrent(concurrent, UserGenerator, "_delete_tenants",
                             [(self.endpoint, tenants)
                              for tenants in tenants_chunks])
Пример #2
0
    def cleanup(self):
        """Delete tenants and users, using pool of threads."""

        concurrent = self.config["concurrent"]

        # Delete users
        users_chunks = utils.chunks(self.context["users"], concurrent)
        utils.run_concurrent(
            concurrent,
            self._delete_users,
            [(self.endpoint, users) for users in users_chunks])

        # Delete tenants
        tenants_chunks = utils.chunks(self.context["tenants"], concurrent)
        utils.run_concurrent(
            concurrent,
            self._delete_tenants,
            [(self.endpoint, tenants) for tenants in tenants_chunks])
Пример #3
0
    def setup(self):
        """Create tenants and users, using pool of threads."""

        users_num = self.config["users_per_tenant"]
        run_id = str(uuid.uuid4())

        args = [(self.endpoint, users_num, run_id, i)
                for i in range(self.config["tenants"])]

        LOG.debug("Creating %d users using %s threads" % (
                users_num * self.config["tenants"], self.config["concurrent"]))

        for tenant, users in utils.run_concurrent(
                self.config["concurrent"],
                self._create_tenant_users,
                args):
            self.context["tenants"].append(tenant)
            self.context["users"] += users
Пример #4
0
    def setup(self):
        """Create tenants and users, using pool of threads."""

        users_num = self.config["users_per_tenant"]

        args = [(self.endpoint, users_num, self.task["uuid"], i)
                for i in range(self.config["tenants"])]

        LOG.debug(
            "Creating %d users using %s threads" %
            (users_num * self.config["tenants"], self.config["concurrent"]))

        for tenant, users in utils.run_concurrent(self.config["concurrent"],
                                                  UserGenerator,
                                                  "_create_tenant_users",
                                                  args):
            self.context["tenants"].append(tenant)
            self.context["users"] += users
Пример #5
0
    def setup(self):
        """Create tenants and users, using pool of threads."""

        users_num = self.config["users_per_tenant"]

        args = [(self.endpoint, users_num, self.task["uuid"], i)
                for i in range(self.config["tenants"])]

        LOG.debug("Creating %d users using %s threads" % (
                users_num * self.config["tenants"], self.config["concurrent"]))

        for tenant, users in utils.run_concurrent(
                self.config["concurrent"],
                UserGenerator,
                "_create_tenant_users",
                args):
            self.context["tenants"].append(tenant)
            self.context["users"] += users