Beispiel #1
0
    def setUp(self):
        django.setup()

        cpus = 50
        mem = 500
        disk = 50

        self.job_type_1 = job_test_utils.create_job_type(priority=1, cpus=cpus, mem=mem, disk=disk)
        self.job_type_2 = job_test_utils.create_job_type(priority=2, cpus=cpus, mem=mem, disk=disk)
        self.job_type_3 = job_test_utils.create_job_type(priority=3, cpus=cpus, mem=mem, disk=disk)
        self.job_type_4 = job_test_utils.create_job_type(priority=4, cpus=cpus, mem=mem, disk=disk)
        self.job_type_5 = job_test_utils.create_job_type(priority=5, cpus=cpus, mem=mem, disk=disk)

        resource_1 = shared_resource_test_utils.create_resource()
        resource_2 = shared_resource_test_utils.create_resource(is_global=False)
        resource_3 = shared_resource_test_utils.create_resource(limit=1000)

        shared_resource_test_utils.create_requirement(job_type=self.job_type_1, shared_resource=resource_1)
        shared_resource_test_utils.create_requirement(job_type=self.job_type_2, shared_resource=resource_2)
        shared_resource_test_utils.create_requirement(job_type=self.job_type_3, shared_resource=resource_3, usage=400)
        shared_resource_test_utils.create_requirement(job_type=self.job_type_4, shared_resource=resource_3, usage=200)
        shared_resource_test_utils.create_requirement(job_type=self.job_type_5, shared_resource=resource_3, usage=100)

        self.trigger_event_1 = trigger_test_utils.create_trigger_event()

        self.node_1 = node_test_utils.create_node()
        self.node_2 = node_test_utils.create_node()
        self.node_3 = node_test_utils.create_node()
Beispiel #2
0
    def setUp(self):
        django.setup()

        self.resource_no_limit = shared_resource_test_utils.create_resource()
        self.resource_1 = shared_resource_test_utils.create_resource(
            limit=RESOURCE_LIMIT)
        self.resource_2 = shared_resource_test_utils.create_resource(
            limit=RESOURCE_LIMIT)
        self.resource_restricted = shared_resource_test_utils.create_resource(
            limit=RESOURCE_LIMIT, is_global=False)

        self.job_type_1 = job_test_utils.create_job_type()
        self.job_type_1a = job_test_utils.create_job_type()
        self.job_type_2 = job_test_utils.create_job_type()
        self.non_global_job = job_test_utils.create_job_type()

        shared_resource_test_utils.create_requirement(
            job_type=self.job_type_1,
            shared_resource=self.resource_1,
            usage=JOB_TYPE_1_USAGE)
        shared_resource_test_utils.create_requirement(
            job_type=self.job_type_1a,
            shared_resource=self.resource_1,
            usage=JOB_TYPE_1A_USAGE)
        shared_resource_test_utils.create_requirement(
            job_type=self.non_global_job,
            shared_resource=self.resource_restricted,
            usage=JOB_TYPE_3_USAGE)

        self.global_job_types = [self.job_type_1, self.job_type_2]
        self.node_without_special_access = node_test_utils.create_node()

        self.node_with_special_access = node_test_utils.create_node()
        self.resource_restricted.nodes.add(self.node_with_special_access)
Beispiel #3
0
    def setUp(self):
        django.setup()

        self.resource_no_limit = shared_resource_test_utils.create_resource()
        self.resource_1 = shared_resource_test_utils.create_resource(limit=RESOURCE_LIMIT)
        self.resource_2 = shared_resource_test_utils.create_resource(limit=RESOURCE_LIMIT)
        self.resource_restricted = shared_resource_test_utils.create_resource(limit=RESOURCE_LIMIT, is_global=False)

        self.job_type_1 = job_test_utils.create_job_type()
        self.job_type_1a = job_test_utils.create_job_type()
        self.job_type_2 = job_test_utils.create_job_type()
        self.non_global_job = job_test_utils.create_job_type()

        shared_resource_test_utils.create_requirement(job_type=self.job_type_1, shared_resource=self.resource_1,
                                                      usage=JOB_TYPE_1_USAGE)
        shared_resource_test_utils.create_requirement(job_type=self.job_type_1a, shared_resource=self.resource_1,
                                                      usage=JOB_TYPE_1A_USAGE)
        shared_resource_test_utils.create_requirement(job_type=self.non_global_job,
                                                      shared_resource=self.resource_restricted, usage=JOB_TYPE_3_USAGE)

        self.global_job_types = [self.job_type_1, self.job_type_2]
        self.node_without_special_access = node_test_utils.create_node()

        self.node_with_special_access = node_test_utils.create_node()
        self.resource_restricted.nodes.add(self.node_with_special_access)