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