示例#1
0
 def testManagerPowercutOptions(self):
     """
     test the powercut option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.worker = True
     opts.powercut = True
     Manager(opts)
示例#2
0
 def testManagerSetOfflineOption(self):
     """
     test the setoffline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.worker = True
     opts.setoffline = True
     Manager(opts)
示例#3
0
 def testManagerTestrun(self):
     """
     test the setonline option parameter
     """
     opts = Options()  # default options object
     opts.cluster = TEST_CLUSTER
     opts.worker = True
     opts.testrun = True
     Manager(opts).doit()
示例#4
0
    def testManagerCreatorActionOptions(self):
        """
        test the manager constructor
        """
#        debug = True cluster = None chassis = None down = False all = False
#        idle = False offline = False node = ""
        opts = Options()  # default options object
        opts.cluster = TEST_CLUSTER
        opts.quattor = True
        opts.all = True
        opts.forced = True
        opts.state = True
        manager = Manager(opts)
        manager.doit()
        opts.non_threaded = True
        manager = Manager(opts)
        opts.non_threaded = False
        manager = Manager(opts)
        manager.doit()

        opts.non_threaded = False
        opts.poweron = True
        Manager(opts).doit()

        opts.postpoweron = True
        Manager(opts)  # should create a manager

        opts.postpoweron = False
        opts.hardreboot = True
        Manager(opts)

        opts.hardreboot = False
        opts.softreboot = True
        Manager(opts)

        opts.all = False
        opts.worker = True
        opts.forced = False

        opts.pbsmomstatus = True
        Manager(opts).doit()

        opts.pbsmomrestart = True
        Manager(opts)  # should create a manager

        opts.pbsmomstop = True
        Manager(opts)  # should create a manager

        opts.pbsmomcleanup = True
        Manager(opts)  # should create a manager

        opts.runcmd = "echo hello"
        Manager(opts).doit()  # should create a manager
示例#5
0
    def testManagerhasSpecials(self):
        """
        test on inclusion of special nodes
        """
        opts = Options()
        opts.cluster = TEST_CLUSTER

        manager = Manager(opts)
        self.assertFalse(manager.hasSpecials())
        opts.worker = True
        manager = Manager(opts)
        self.assertFalse(manager.hasSpecials())
        opts.all_nodes = True
        manager = Manager(opts)
        self.assertTrue(manager.hasSpecials())  # should have special nodes with force (the master)

        opts = Options()
        opts.cluster = TEST_CLUSTER
        opts.master = "master1"
        self.assertTrue(Manager(opts).hasSpecials())  # should create a manager
示例#6
0
    def testManagerhasSpecials(self):
        """
        test on inclusion of special nodes
        """
        opts = Options()
        opts.cluster = 'cubone'

        manager = Manager(opts)
        self.assertFalse(manager.hasSpecials())
        opts.worker = True
        #self.assertRaises(Exception, Manager, opts)
        manager = Manager(opts)
        self.assertFalse(manager.hasSpecials())
        opts.all_nodes = True
        manager = Manager(opts)
        self.assertTrue(manager.hasSpecials())  # should have special nodes with force (the master)

        opts = Options()
        opts.cluster = 'cubone'
        opts.master = "master7"
        self.assertTrue(Manager(opts).hasSpecials())  # should create a manager