Esempio n. 1
0
 def test_process_exec_response(self):
     exeThread = ExecThread(None, 'dummy')
     exeThread.setTimeout(0)
     msg_header = '[AGENT_MESSAGE]{"errorMsg": "'
     msg_line1 = 'line 1'
     msg_line2 = 'line 2'
     msg_line3 = 'line 3'
     msg_footer = '"}'
     exeThread.processExecResponse(msg_header)
     exeThread.processExecResponse(msg_line1)
     exeThread.processExecResponse(msg_line2)
     exeThread.processExecResponse(msg_line3)
     exeThread.processExecResponse(msg_footer)
Esempio n. 2
0
 def test_process_exec_response(self):
     exeThread = ExecThread(None, 'dummy')
     exeThread.setTimeout(0)
     msg_header = '[AGENT_MESSAGE]{"errorMsg": "' 
     msg_line1 = 'line 1'
     msg_line2 = 'line 2'
     msg_line3 = 'line 3'
     msg_footer = '"}'
     exeThread.processExecResponse(msg_header)
     exeThread.processExecResponse(msg_line1)
     exeThread.processExecResponse(msg_line2)
     exeThread.processExecResponse(msg_line3)
     exeThread.processExecResponse(msg_footer)
Esempio n. 3
0
 
 print int(time.time()) % 2
 
 response = json.loads(ERROR)
 isValid = ExecThread.validateResponse(response)
 
 errorMsgRe = re.compile('.*errorMsg\".*:.*\"(.*)\"}')
 match = errorMsgRe.match(ERROR)
 if (match != None):
     errorMsg = match.group(1)
 
 errorlines = ERROR.split('\n')
 errorjoin = None
 ethread = ExecThread(NullThreadMgr, 'agent')
 for line in errorlines:
     ethread.processExecResponse(line)
     line = line.rstrip('\n')
     errorjoin = line if not errorjoin else (errorjoin + '\\n' + line)
 threadjson = ethread.getResponse()
 
 exc = AgentException('1', 'test');
 errorMsg = exc.getMsg()
 
 
 config = ConfigParser.RawConfigParser()
 config.read('fact.prop')
 
 env_vs = 'CRONUSAPP_HOME=%s LCM_CORRELATIONID=%s'.split(' ')
 text = 'some'
 text1 = text.split()
 
Esempio n. 4
0
    print int(time.time()) % 2

    response = json.loads(ERROR)
    isValid = ExecThread.validateResponse(response)

    errorMsgRe = re.compile('.*errorMsg\".*:.*\"(.*)\"}')
    match = errorMsgRe.match(ERROR)
    if (match != None):
        errorMsg = match.group(1)

    errorlines = ERROR.split('\n')
    errorjoin = None
    ethread = ExecThread(NullThreadMgr, 'agent')
    for line in errorlines:
        ethread.processExecResponse(line)
        line = line.rstrip('\n')
        errorjoin = line if not errorjoin else (errorjoin + '\\n' + line)
    threadjson = ethread.getResponse()

    exc = AgentException('1', 'test')
    errorMsg = exc.getMsg()

    config = ConfigParser.RawConfigParser()
    config.read('fact.prop')

    env_vs = 'CRONUSAPP_HOME=%s LCM_CORRELATIONID=%s'.split(' ')
    text = 'some'
    text1 = text.split()

    print os.path.dirname(