Esempio n. 1
0
    def setUp(self):
        print "Instantiating"
        self.server = rsyslog.Rsyslog(self.config)

        print "Checking configuration"
        rc = self.server.check()
        if rc:
            raise "Failed configuration check: %d" % rc

        print "Cleaning up environment"
        #rsyslog.deleteIgnoreError(self.logFile)
        rsyslog.deleteIgnoreError(self.queue)
        rsyslog.deleteIgnoreError(self.qi)
        rsyslog.mkdirIgnoreError(self.baseDir)

        self.output = open(self.logFile, 'w+')

        print "Starting rsyslogd with config %s" % self.baseName

        self.server.start()
        self.server.waitOutput('worker IDLE, waiting for work')
        print "Started rsyslogd with config %s" % self.baseName
        self.server.process.stdout.close()
        self.server.process.stderr.close()
        self.server.process.stdin.close()
Esempio n. 2
0
    def setUp(self):
        # start client
        # start server
        rsyslog.deleteIgnoreError(self.INPUT_FILE)
        rsyslog.deleteIgnoreError(self.OUTPUT_FILE)
        rsyslog.deleteIgnoreError(self.STATE_FILE)
        rsyslog.deleteIgnoreError(self.QUEUE)
        rsyslog.deleteIgnoreError(self.QI)

        self.input = open(self.INPUT_FILE, 'w+')
        self.output = open(self.OUTPUT_FILE, 'w+')

        self.server = rsyslog.Rsyslog(self.SERVER_CONF)
        self.server.start()
        self.server.waitOutput('worker IDLE, waiting for work')

        self.client = rsyslog.Rsyslog(self.CLIENT_CONF)
        self.client.start()
        self.client.waitOutput('worker IDLE, waiting for work')