Beispiel #1
0
 def testShouldHaveUsernameandAtLeastOneHostnameSetUp(self):
     self._setUpConfigFile()
     properties = Property(self.configfile)
     properties.parse_properties()
     logging.debug(properties.get_keys())
     defaults = self._getDefaults()
     defaults.properties = properties
     logtailer = SSHLogTailer(defaults)
     self.assertTrue(logtailer.sanityCheck())
Beispiel #2
0
 def testShouldHaveUsernameandAtLeastOneHostnameSetUp(self):
     self._setUpConfigFile()
     properties = Property(self.configfile)
     properties.parse_properties()
     logging.debug(properties.get_keys())
     defaults = self._getDefaults()
     defaults.properties = properties
     logtailer = SSHLogTailer(defaults)
     self.assertTrue(logtailer.sanityCheck())
Beispiel #3
0
 def testshouldBuildCommandTailBasedOnHostnamesDict(self):
     self._setUpConfigFile()
     properties = Property(self.configfile)
     properties.parse_properties()
     logging.debug(properties.get_keys())
     defaults = self._getDefaults()
     defaults.properties = properties
     logtailer = SSHLogTailer(defaults)
     logtailer.sanityCheck()
     command = "tail -F /var/log/anylog555 /var/log/anylog1"
     logtailer.createCommands()
     self.assertEquals(command, logtailer.hostnames['hostname0']['command'])
Beispiel #4
0
 def testItShouldhaveBuildADictWithAllParamsIfAllParametersOk(self):
     self._setUpConfigFile()
     properties = Property(self.configfile)
     properties.parse_properties()
     logging.debug(properties.get_keys())
     defaults = self._getDefaults()
     defaults.properties = properties
     logtailer = SSHLogTailer(defaults)
     logtailer.sanityCheck()
     self.assertEquals(3, len(logtailer.hostnames.keys()))
     self.assertEquals('username',
                       logtailer.hostnames['hostname0']['username'])
Beispiel #5
0
 def testshouldBuildCommandTailBasedOnHostnamesDict(self):
     self._setUpConfigFile()
     properties = Property(self.configfile)
     properties.parse_properties()
     logging.debug(properties.get_keys())
     defaults = self._getDefaults()
     defaults.properties = properties
     logtailer = SSHLogTailer(defaults)
     logtailer.sanityCheck()
     command = "tail -F /var/log/anylog555 /var/log/anylog1"
     logtailer.createCommands()
     self.assertEquals(command,logtailer.hostnames['hostname0']['command'])
Beispiel #6
0
 def testItShouldhaveBuildADictWithAllParamsIfAllParametersOk(self):
     self._setUpConfigFile()
     properties = Property(self.configfile)
     properties.parse_properties()
     logging.debug(properties.get_keys())
     defaults = self._getDefaults()
     defaults.properties = properties
     logtailer = SSHLogTailer(defaults)
     logtailer.sanityCheck()
     self.assertEquals(3,len(logtailer.hostnames.keys()))
     self.assertEquals('username',
             logtailer.hostnames['hostname0']['username'])