Пример #1
0
    def test_infeasible_blocking(self):
        # made up values, to see if they get picked up
        self.ts[0].blocked = 5
        self.assertFalse(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.ts[0].blocked = 2
        self.ts[3].blocked = 10
        self.assertFalse(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.ts[3].blocked = 3
        self.assertTrue(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.assertEqual(self.ts[0].response_time,  3)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  3)
        self.assertEqual(self.ts[3].response_time, 18)
Пример #2
0
    def test_times3(self):
        self.assertTrue(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.assertEqual(self.ts[0].response_time,  1)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  3)
        self.assertEqual(self.ts[3].response_time, 14)
Пример #3
0
    def test_infeasible_blocking(self):
        # made up values, to see if they get picked up
        self.ts[0].blocked = 5
        self.assertFalse(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.ts[0].blocked = 2
        self.ts[3].blocked = 10
        self.assertFalse(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.ts[3].blocked = 3
        self.assertTrue(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.assertEqual(self.ts[0].response_time,  3)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  3)
        self.assertEqual(self.ts[3].response_time, 18)
Пример #4
0
    def test_times3(self):
        self.assertTrue(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.assertEqual(self.ts[0].response_time,  1)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  3)
        self.assertEqual(self.ts[3].response_time, 14)
Пример #5
0
    def test_times4(self):
        # with slack, we need one fewer core
        self.assertTrue(ber.bound_response_times(2, self.ts))

        self.assertEqual(self.ts[0].response_time,  1)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  4)
        self.assertEqual(self.ts[3].response_time, 15)
Пример #6
0
    def test_times4(self):
        # with slack, we need one fewer core
        self.assertTrue(ber.bound_response_times(2, self.ts))

        self.assertEqual(self.ts[0].response_time,  1)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  4)
        self.assertEqual(self.ts[3].response_time, 15)
Пример #7
0
    def test_blocking(self):
        # made up values, to see if they get picked up
        self.ts[0].blocked = 2
        self.ts[2].blocked = 3
        self.ts[3].hp_direct_blocked = 4

        self.assertTrue(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.assertEqual(self.ts[0].response_time,  3)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  6)
        self.assertEqual(self.ts[3].response_time, 12)
Пример #8
0
    def test_blocking(self):
        # made up values, to see if they get picked up
        self.ts[0].blocked = 2
        self.ts[2].blocked = 3
        self.ts[3].hp_direct_blocked = 4

        self.assertTrue(ber.bound_response_times(3, self.ts, dont_use_slack=True))

        self.assertEqual(self.ts[0].response_time,  3)
        self.assertEqual(self.ts[1].response_time,  1)
        self.assertEqual(self.ts[2].response_time,  6)
        self.assertEqual(self.ts[3].response_time, 12)