File: test_boot.py

package info (click to toggle)
python-hpilo 4.4.3-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,784 kB
  • sloc: python: 3,418; ruby: 467; makefile: 122; sh: 31
file content (30 lines) | stat: -rw-r--r-- 804 bytes parent folder | download | duplicates (3)
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()