예제 #1
0
파일: edf.py 프로젝트: RSpliet/schedcat
    def test_qpa_known_unschedulable(self):
        qpa = edf.native.QPATest(1)
        ts1 = tasks.TaskSystem([
            tasks.SporadicTask(331, 15000, deadline=2688),
            tasks.SporadicTask(3654, 77000, deadline=3849)
            ])
        self.assertFalse(qpa.is_schedulable(sched.get_native_taskset(ts1)))

        ts2 =  tasks.TaskSystem([tasks.SporadicTask(331, 15000, deadline=2688),
            tasks.SporadicTask(413, 34000, deadline=1061),
            tasks.SporadicTask(3654, 77000, deadline=3849),
            tasks.SporadicTask(349, 70000, deadline=20189),
            tasks.SporadicTask(1113, 83000, deadline=10683),
            ])
        self.assertFalse(qpa.is_schedulable(sched.get_native_taskset(ts2)))
예제 #2
0
    def test_qpa_known_unschedulable(self):
        qpa = edf.native.QPATest(1)
        ts1 = tasks.TaskSystem([
            tasks.SporadicTask(331, 15000, deadline=2688),
            tasks.SporadicTask(3654, 77000, deadline=3849)
        ])
        self.assertFalse(qpa.is_schedulable(sched.get_native_taskset(ts1)))

        ts2 = tasks.TaskSystem([
            tasks.SporadicTask(331, 15000, deadline=2688),
            tasks.SporadicTask(413, 34000, deadline=1061),
            tasks.SporadicTask(3654, 77000, deadline=3849),
            tasks.SporadicTask(349, 70000, deadline=20189),
            tasks.SporadicTask(1113, 83000, deadline=10683),
        ])
        self.assertFalse(qpa.is_schedulable(sched.get_native_taskset(ts2)))
예제 #3
0
파일: apa.py 프로젝트: RSpliet/schedcat
    def test_infeasible_bad_task(self):
        self.ts.append(tasks.SporadicTask(110, 100))
        self.ts[3].affinity = set([1, 2, 3])
        aff = sched.get_native_affinities(self.ts)
        ts  = sched.get_native_taskset(self.ts)

        sol = sched.native.apa_implicit_deadline_feasible(ts, aff)

        self.assertIsNone(sol)
예제 #4
0
    def test_infeasible_bad_task(self):
        self.ts.append(tasks.SporadicTask(110, 100))
        self.ts[3].affinity = set([1, 2, 3])
        aff = sched.get_native_affinities(self.ts)
        ts = sched.get_native_taskset(self.ts)

        sol = sched.native.apa_implicit_deadline_feasible(ts, aff)

        self.assertIsNone(sol)
예제 #5
0
파일: apa.py 프로젝트: RSpliet/schedcat
    def test_feasible(self):
        aff = sched.get_native_affinities(self.ts)
        ts  = sched.get_native_taskset(self.ts)

        sol = sched.native.apa_implicit_deadline_feasible(ts, aff)

        self.assertIsNotNone(sol)
        self.assertEqual(sol.get_fraction(0, 1), 1)
        self.assertEqual(sol.get_fraction(0, 2), 0)
        self.assertEqual(sol.get_fraction(1, 1), 0)
        self.assertEqual(sol.get_fraction(1, 2), 1)
        self.assertAlmostEqual(sol.get_fraction(2, 1), 0.6)
        self.assertAlmostEqual(sol.get_fraction(2, 2), 0.4)
예제 #6
0
    def test_feasible(self):
        aff = sched.get_native_affinities(self.ts)
        ts = sched.get_native_taskset(self.ts)

        sol = sched.native.apa_implicit_deadline_feasible(ts, aff)

        self.assertIsNotNone(sol)
        self.assertEqual(sol.get_fraction(0, 1), 1)
        self.assertEqual(sol.get_fraction(0, 2), 0)
        self.assertEqual(sol.get_fraction(1, 1), 0)
        self.assertEqual(sol.get_fraction(1, 2), 1)
        self.assertAlmostEqual(sol.get_fraction(2, 1), 0.6)
        self.assertAlmostEqual(sol.get_fraction(2, 2), 0.4)
예제 #7
0
 def test_qpa_schedulable(self):
     qpa = edf.native.QPATest(1)
     self.assertTrue(qpa.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #8
0
파일: edf.py 프로젝트: RSpliet/schedcat
 def test_george_np_not_schedulable(self):
     self.ts.append(tasks.SporadicTask(100, 1100))
     george_np = edf.native.George_NPTest(1)
     self.assertFalse(george_np.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #9
0
파일: edf.py 프로젝트: RSpliet/schedcat
 def test_george_np_schedulable(self):
     george_np = edf.native.George_NPTest(1)
     self.assertTrue(george_np.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #10
0
 def test_qpa_get_max_C_equal_D_cost_4(self):
     ts = sched.get_native_taskset(self.ts4)
     max_wcet = native.qpa_get_max_C_equal_D_cost(ts, 21, 30)
     self.assertEqual(max_wcet, 16)
예제 #11
0
파일: edf.py 프로젝트: RSpliet/schedcat
 def test_qpa_not_schedulable(self):
     self.ts.append(tasks.SporadicTask(   10,    100, deadline=15))
     qpa = edf.native.QPATest(1)
     self.assertFalse(qpa.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #12
0
파일: edf.py 프로젝트: RSpliet/schedcat
 def test_qpa_schedulable(self):
     qpa = edf.native.QPATest(1)
     self.assertTrue(qpa.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #13
0
 def test_george_np_not_schedulable(self):
     self.ts.append(tasks.SporadicTask(100, 1100))
     george_np = edf.native.George_NPTest(1)
     self.assertFalse(
         george_np.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #14
0
 def test_qpa_get_max_C_equal_D_cost_3(self):
     ts = sched.get_native_taskset(self.ts3)
     max_wcet = native.qpa_get_max_C_equal_D_cost(ts, 6, 12)
     self.assertEqual(max_wcet, 1)
예제 #15
0
 def test_qpa_not_schedulable(self):
     self.ts.append(tasks.SporadicTask(10, 100, deadline=15))
     qpa = edf.native.QPATest(1)
     self.assertFalse(qpa.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #16
0
파일: apa.py 프로젝트: RSpliet/schedcat
 def test_qpa_get_max_C_equal_D_cost_4(self):
     ts = sched.get_native_taskset(self.ts4)
     max_wcet = native.qpa_get_max_C_equal_D_cost(
         ts, 21, 30)
     self.assertEqual(max_wcet, 16)
예제 #17
0
파일: apa.py 프로젝트: RSpliet/schedcat
 def test_qpa_get_max_C_equal_D_cost_3(self):
     ts = sched.get_native_taskset(self.ts3)
     max_wcet = native.qpa_get_max_C_equal_D_cost(
         ts, 6, 12)
     self.assertEqual(max_wcet, 1)
예제 #18
0
파일: apa.py 프로젝트: RSpliet/schedcat
 def test_qpa_get_max_C_equal_D_cost_1(self):
     ts = sched.get_native_taskset(self.ts1[:1])
     max_wcet = native.qpa_get_max_C_equal_D_cost(
         ts, self.ts1[1].cost, self.ts1[1].period)
     self.assertEqual(max_wcet, 34)
예제 #19
0
 def test_george_np_schedulable(self):
     george_np = edf.native.George_NPTest(1)
     self.assertTrue(
         george_np.is_schedulable(sched.get_native_taskset(self.ts)))
예제 #20
0
 def test_qpa_get_max_C_equal_D_cost_1(self):
     ts = sched.get_native_taskset(self.ts1[:1])
     max_wcet = native.qpa_get_max_C_equal_D_cost(ts, self.ts1[1].cost,
                                                  self.ts1[1].period)
     self.assertEqual(max_wcet, 34)