summaryrefslogtreecommitdiffstats
path: root/agents/autodetect/autodetect_test.py
blob: a18aaed0640b9a901656252d6054a4c25642cb06 (plain)
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
31
32
33
#!/usr/bin/python

import unittest
import autodetect as detect

class TestDetectDevice(unittest.TestCase):
    options = {}

    def setUp(self):
        self.options = {}
        self.options["--ssh-path"] = "/usr/bin/ssh"
        self.options["--telnet-path"] = "/usr/bin/telnet"
        self.options["--login-timeout"] = "10"
        self.options["--shell-timeout"] = "5"
        self.options["--power-timeout"] = "10"
        self.options["eol"] = "\r\n"

    def test_bladecenter(self):
        self.options["--username"] = "rhts"
        self.options["--password"] = "100yard-"
        self.options["--ip"] = "blade-mm.englab.brq.redhat.com"

        (found_cmd_prompt, conn) = detect.detect_login_telnet(self.options)
        res = detect.detect_device(conn, self.options, found_cmd_prompt)
        self.assertEqual('fence_bladecenter', res)

    def test_apc5(self):
        self.assertEqual('foo', 'foo')
        self.options["c"] = "c"
        print self.options

if __name__ == "__main__":
    unittest.main()