| 1 |
#!/usr/bin/python |
| 2 |
|
| 3 |
from utils import * |
| 4 |
import random |
| 5 |
|
| 6 |
class BootTests(IloTestCase): |
| 7 |
def test_persistent_boot(self, ilo): |
| 8 |
old = ilo.get_persistent_boot() |
| 9 |
new = old[:] |
| 10 |
random.shuffle(new) |
| 11 |
try: |
| 12 |
ilo.set_persistent_boot(new) |
| 13 |
self.assertEqual(new, ilo.get_persistent_boot()) |
| 14 |
finally: |
| 15 |
ilo.set_persistent_boot(old) |
| 16 |
|
| 17 |
def test_one_time_boot(self, ilo): |
| 18 |
old = ilo.get_one_time_boot() |
| 19 |
all = ilo.get_persistent_boot() |
| 20 |
if old in all: |
| 21 |
all.remove(old) |
| 22 |
new = random.choice(all) |
| 23 |
try: |
| 24 |
ilo.set_one_time_boot(new) |
| 25 |
self.assertEqual(new, ilo.get_one_time_boot()) |
| 26 |
finally: |
| 27 |
ilo.set_one_time_boot(old) |
| 28 |
|
| 29 |
if __name__ == '__main__': |
| 30 |
unittest.main() |