Example #1
0
 def setUp(self):
     super(WorkloadTestCase, self).setUp()
     self.env = db.env_create(self.id(), "INIT", "", {}, {}, {}, [])
     self.task = db.task_create({"env_uuid": self.env["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
Example #2
0
 def setUp(self):
     super(WorkloadTestCase, self).setUp()
     self.deploy = db.deployment_create({})
     self.task = db.task_create({"deployment_uuid": self.deploy["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
Example #3
0
 def setUp(self):
     super(WorkloadTestCase, self).setUp()
     self.deploy = db.deployment_create({})
     self.task = db.task_create({"deployment_uuid": self.deploy["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
Example #4
0
 def setUp(self):
     super(WorkloadTestCase, self).setUp()
     self.env = db.env_create(self.id(), "INIT", "", {}, {}, {}, [])
     self.task = db.task_create({"env_uuid": self.env["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
Example #5
0
 def setUp(self):
     super(WorkloadDataTestCase, self).setUp()
     self.env = db.env_create(self.id(), "INIT", "", {}, {}, {}, [])
     self.task = db.task_create({"env_uuid": self.env["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
     self.workload = db.workload_create(
         self.task_uuid, self.subtask_uuid, name="atata", description="foo",
         position=0, args={}, contexts={}, sla={}, runner={},
         runner_type="r", hooks={})
     self.workload_uuid = self.workload["uuid"]
Example #6
0
 def setUp(self):
     super(WorkloadDataTestCase, self).setUp()
     self.deploy = db.deployment_create({})
     self.task = db.task_create({"deployment_uuid": self.deploy["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
     self.key = {"name": "atata", "description": "tatata",
                 "pos": 0, "kw": {"runner": {"r": "R", "type": "T"}}}
     self.workload = db.workload_create(self.task_uuid, self.subtask_uuid,
                                        self.key)
     self.workload_uuid = self.workload["uuid"]
Example #7
0
 def setUp(self):
     super(WorkloadDataTestCase, self).setUp()
     self.deploy = db.deployment_create({})
     self.task = db.task_create({"deployment_uuid": self.deploy["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
     self.workload = db.workload_create(
         self.task_uuid, self.subtask_uuid, name="atata", description="foo",
         position=0, args={}, context={}, sla={}, runner={},
         runner_type="r", hooks={})
     self.workload_uuid = self.workload["uuid"]
Example #8
0
    def __init__(self, task=None, fake=False, **attributes):
        """Task object init

        :param task: dictionary like object, that represents a task
        :param fake: if True, will be created task object with random UUID and
            parameters, passed in 'attributes'. Does not create database
            record. Used for special purposes, like task config validation.
        """

        self.fake = fake
        if fake:
            self.task = task or {"uuid": str(uuid.uuid4())}
            self.task.update(attributes)
        else:
            self.task = task or db.task_create(attributes)
Example #9
0
    def __init__(self, task=None, fake=False, **attributes):
        """Task object init

        :param task: dictionary like object, that represents a task
        :param fake: if True, will be created task object with random UUID and
            parameters, passed in 'attributes'. Does not create database
            record. Used for special purposes, like task config validation.
        """

        self.fake = fake
        if fake:
            self.task = task or {"uuid": str(uuid.uuid4())}
            self.task.update(attributes)
        else:
            self.task = task or db.task_create(attributes)
Example #10
0
    def __init__(self, task=None, temporary=False, **attributes):
        """Task object init

        :param task: dictionary like object, that represents a task
        :param temporary: whenever this param is True the task will be created
            with a random UUID and no database record. Used for special
            purposes, like task config validation.
        """

        self.is_temporary = temporary

        if self.is_temporary:
            self.task = task or {"uuid": str(uuid.uuid4())}
            self.task.update(attributes)
        else:
            self.task = task or db.task_create(attributes)
Example #11
0
    def __init__(self, task=None, temporary=False, **attributes):
        """Task object init

        :param task: dictionary like object, that represents a task
        :param temporary: whenever this param is True the task will be created
            with a random UUID and no database record. Used for special
            purposes, like task config validation.
        """

        self.is_temporary = temporary

        if self.is_temporary:
            self.task = task or {"uuid": str(uuid.uuid4())}
            self.task.update(attributes)
        else:
            self.task = task or db.task_create(attributes)
Example #12
0
 def setUp(self):
     super(WorkloadDataTestCase, self).setUp()
     self.env = db.env_create(self.id(), "INIT", "", {}, {}, {}, [])
     self.task = db.task_create({"env_uuid": self.env["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
     self.workload = db.workload_create(self.task_uuid,
                                        self.subtask_uuid,
                                        name="atata",
                                        description="foo",
                                        position=0,
                                        args={},
                                        contexts={},
                                        sla={},
                                        runner={},
                                        runner_type="r",
                                        hooks={})
     self.workload_uuid = self.workload["uuid"]
Example #13
0
 def setUp(self):
     super(WorkloadDataTestCase, self).setUp()
     self.deploy = db.deployment_create({})
     self.task = db.task_create({"deployment_uuid": self.deploy["uuid"]})
     self.task_uuid = self.task["uuid"]
     self.subtask = db.subtask_create(self.task_uuid, title="foo")
     self.subtask_uuid = self.subtask["uuid"]
     self.workload = db.workload_create(self.task_uuid,
                                        self.subtask_uuid,
                                        name="atata",
                                        description="foo",
                                        position=0,
                                        args={},
                                        contexts={},
                                        sla={},
                                        runner={},
                                        runner_type="r",
                                        hooks={})
     self.workload_uuid = self.workload["uuid"]
Example #14
0
 def setUp(self):
     super(SubtaskTestCase, self).setUp()
     self.env = db.env_create(self.id(), "INIT", "", {}, {}, {}, [])
     self.task = db.task_create({"env_uuid": self.env["uuid"]})
Example #15
0
 def setUp(self):
     super(SubtaskTestCase, self).setUp()
     self.env = db.env_create(self.id(), "INIT", "", {}, {}, {}, [])
     self.task = db.task_create({"env_uuid": self.env["uuid"]})
Example #16
0
 def _create_task(self, values=None):
     values = values or {}
     if "deployment_uuid" not in values:
         values["deployment_uuid"] = self.deploy["uuid"]
     return db.task_create(values)
Example #17
0
 def setUp(self):
     super(SubtaskTestCase, self).setUp()
     self.deploy = db.deployment_create({})
     self.task = db.task_create({"deployment_uuid": self.deploy["uuid"]})
Example #18
0
 def _create_task(self, values=None):
     values = values or {}
     if "env_uuid" not in values:
         values["env_uuid"] = self.env["uuid"]
     return db.task_create(values)
Example #19
0
 def _create_task(self, values=None):
     values = values or {}
     if "env_uuid" not in values:
         values["env_uuid"] = self.env["uuid"]
     return db.task_create(values)
Example #20
0
 def _create_task(self, values=None):
     values = values or {}
     if "deployment_uuid" not in values:
         values["deployment_uuid"] = self.deploy["uuid"]
     return db.task_create(values)
Example #21
0
 def setUp(self):
     super(SubtaskTestCase, self).setUp()
     self.deploy = db.deployment_create({})
     self.task = db.task_create({"deployment_uuid": self.deploy["uuid"]})