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)))
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)))
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)
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)
def test_qpa_schedulable(self): qpa = edf.native.QPATest(1) self.assertTrue(qpa.is_schedulable(sched.get_native_taskset(self.ts)))
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)))
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)))
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)
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)))
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)))
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)
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)))
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)
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)
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)
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)))
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)