To prevent suites using the test tool overwriting the log
file of the test tool(s) they use, add the name of the
suite to the name of the log file produced by the test
tool. This currently affects suites using the "testtool"
tool (CRUD and scaling suites). The core code in this change
was packaged into the keyword Utils.Get_Log_File_Name because
the functionality is going to be needed in the RestPerfClient
suite as well.
Change-Id: Idf5fbed8baf4b150d66e91c95c2bcaa6dbeab90b
Signed-off-by: Jozef Behran <jbehran@cisco.com>
Resource NetconfViaRestconf.robot
Resource NexusKeywords.robot
Resource SSHKeywords.robot
Resource NetconfViaRestconf.robot
Resource NexusKeywords.robot
Resource SSHKeywords.robot
*** Variables ***
${TESTTOOL_DEFAULT_JAVA_OPTIONS} -Xmx1G -XX:MaxPermSize=256M -Dorg.apache.sshd.registerBouncyCastle=false
*** Variables ***
${TESTTOOL_DEFAULT_JAVA_OPTIONS} -Xmx1G -XX:MaxPermSize=256M -Dorg.apache.sshd.registerBouncyCastle=false
# Start the testtool
${command} BuiltIn.Set_Variable java ${java_options} -jar ${filename} ${tool_options} --device-count ${device-count} --debug ${debug} ${schemas_option} --md-sal ${mdsal}
BuiltIn.Log Running testtool: ${command}
# Start the testtool
${command} BuiltIn.Set_Variable java ${java_options} -jar ${filename} ${tool_options} --device-count ${device-count} --debug ${debug} ${schemas_option} --md-sal ${mdsal}
BuiltIn.Log Running testtool: ${command}
- SSHLibrary.Write ${command} >testtool.log 2>&1
+ ${logfile}= Utils.Get_Log_File_Name testtool
+ BuiltIn.Set_Suite_Variable ${testtool_log} ${logfile}
+ SSHLibrary.Write ${command} >${logfile} 2>&1
# Store information needed by other keywords.
BuiltIn.Set_Suite_Variable ${NetconfKeywords__testtool_device_count} ${device-count}
# Wait for the testtool to boot up.
# Store information needed by other keywords.
BuiltIn.Set_Suite_Variable ${NetconfKeywords__testtool_device_count} ${device-count}
# Wait for the testtool to boot up.
# TODO: Maybe this keyword's content shall be moved into SSHUtils and named somewhat like
# "Interrupt_Program_And_Download_Its_Log" which will get an argument stating the name of
# the log file to get.
# TODO: Maybe this keyword's content shall be moved into SSHUtils and named somewhat like
# "Interrupt_Program_And_Download_Its_Log" which will get an argument stating the name of
# the log file to get.
- SSHLibrary.Get_File testtool.log
+ SSHLibrary.Get_File ${testtool_log}
NetconfKeywords__Check_Netconf_Test_Timeout_Not_Expired
[Arguments] ${deadline_Date}
NetconfKeywords__Check_Netconf_Test_Timeout_Not_Expired
[Arguments] ${deadline_Date}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} ${status_code}
[Return] ${resp}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} ${status_code}
[Return] ${resp}
+
+Get Log File Name
+ [Arguments] ${testtool}
+ [Documentation] Get the name of the suite sanitized to be usable as a part of filename.
+ ... These names are used to constructs names of the log files produced
+ ... by the testing tools so two suites using a tool wont overwrite the
+ ... log files if they happen to run in one job.
+ ${name}= BuiltIn.Evaluate """${SUITE_NAME}""".replace(" ","-").replace("/","-").replace(".","-")
+ [Return] ${testtool}--${name}.log