예제 #1
0
    def test_command(self):
        t = {'command_name' : 'check_command_test',
             'command_line' : '/tmp/dummy_command.sh $ARG1$ $ARG2$',
             'poller_tag' : 'DMZ'
             }
        c = Command(t)
        self.assert_(c.command_name == 'check_command_test')
        b = c.get_initial_status_brok()
        self.assert_(b.type == 'initial_command_status')

        #now create a commands packs
        cs = Commands([c])
        dummy_call = "check_command_test!titi!toto"
        cc = CommandCall(cs, dummy_call)
        self.assert_(cc.is_valid() == True)
        self.assert_(cc.command == c)
        self.assert_(cc.poller_tag == 'DMZ')
예제 #2
0
 def setUp(self):
     from shinken.objects.command import Command
     self.item = Command()