示例#1
0
 def testAckService(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.node = 'node2201-node2208'
     opts.ack_service = "Swapping"
     Manager(opts)
示例#2
0
 def testAckService(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = 'cubone'
     opts.node = 'node610-617'
     opts.ack_service = "Swapping"
     Manager(opts)
示例#3
0
 def testManagerSetOffline(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.node = TEST_NODE
     opts.setoffline = True
     Manager(opts).doit()
示例#4
0
 def testManagerSetOffline(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = 'cubone'
     opts.node = 'node610'
     opts.setoffline = True
     Manager(opts).doit()
示例#5
0
 def testAck(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.node = 'node2201-node2208'
     opts.setoffline = True
     opts.ack = True
     Manager(opts)
示例#6
0
 def testAck(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = 'cubone'
     opts.node = 'node610-617'
     opts.setoffline = True
     opts.ack = True
     Manager(opts)
示例#7
0
 def testManagerSetOnline(self):
     """
     test the setonline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = 'cubone'
     opts.node = 'node610'
     opts.setonline = True
     #TODO: fails, since no worker nodes can be found
     Manager(opts).doit()
示例#8
0
 def testDowntime(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.node = 'node2201-node2208'
     opts.setoffline = True
     opts.downtime = "2 m"
     Manager(opts)  # should fail
     opts.downtime = "2h"
     Manager(opts)
示例#9
0
 def testDowntime(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = 'cubone'
     opts.node = 'node610-617'
     opts.setoffline = True
     opts.downtime = "2 m"
     Manager(opts)  # should fail
     opts.downtime = "2h"
     Manager(opts)
示例#10
0
 def testManagerLEDs(self):
     """
     test the Ledon, ledoff and ledstatus option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.node = TEST_NODE
     opts.ledon = True
     Manager(opts).doit()
     # TODO: get led status and test if it's on
     opts.ledon = False
     opts.ledoff = True
     Manager(opts).doit()
示例#11
0
    def testManagerCreatorNodesFromID(self):
        """
        test the manager constructor with a nodename option
        """
        opts = Options()
        opts.cluster = TEST_CLUSTER
        opts.node = 'nosuchnodeid3234#%'
        opts.setonline = True

        try:
            Manager(opts)
            self.fail("manager didn't fail with unknown node selected")
        except NodeException:
            pass
        else:
            self.fail("manager didn't fail with a NodeException when an unknown node was selected")
        opts.node = 'node2201,201,magikarp'
        Manager(opts)
        opts.node = 'node2201-node2205'
        Manager(opts)
        opts.node = 'node2208,node2203-node2205,magikarp'
        Manager(opts)
示例#12
0
    def testManagerCreatorNodesFromID(self):
        """
        test the manager constructor with a nodename option
        """
        opts = Options()
        opts.cluster = 'cubone'
        opts.node = 'nosuchnodeid3234#%'
        opts.setonline = True

        try:
            Manager(opts)
            self.fail("manager didn't fail with unknown node selected")
        except NodeException:
            pass
        else:
            self.fail("manager didn't fail with a NodeException when an unknown node was selected")
        opts.node = '32x,node120'
        try:
            Manager(opts)
            self.fail("manager didn't fail with unknown node selected")
        except NodeException:
            pass
        else:
            self.fail("manager didn't fail with a NodeException when an unknown node was selected")

        opts.node = 'node323,node120Xde#'
        try:
            Manager(opts)
            self.fail("manager didn't fail with unknown node selected")
        except NodeException:
            pass
        else:
            self.fail("manager didn't fail with a NodeException when an unknown node was selected")
        opts.node = 'node323,node120'
        try:
            Manager(opts)
            self.fail("manager didn't fail with unknown node selected")
        except NodeException:
            pass
        else:
            self.fail("manager didn't fail with a NodeException when an unknown node was selected")
        opts.node = 'node613,610,magikarp'
        Manager(opts)
        opts.node = 'node613-node615'
        Manager(opts)
        opts.node = 'node610,node613-node615,magikarp'
        Manager(opts)