This fixes Boron csit jobs which download Java tools from Nexus.
UscUtils not edited, as their jar presumably does not depend on {stream}.
Change-Id: I1e61ad44b810838d333fde56cfe5edca906fda9f
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
${filename}= NexusKeywords.Deploy_Test_Tool netconf netconf-testtool
${schemas_option}= NetconfKeywords__Deploy_Additional_Schemas ${schemas}
# 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}
+ ${command}= NexusKeywords.Compose_Full_Java_Command ${java_options} -jar ${filename} ${tool_options} --device-count ${device-count} --debug ${debug} ${schemas_option} --md-sal ${mdsal}
BuiltIn.Log Running testtool: ${command}
${logfile}= Utils.Get_Log_File_Name testtool
BuiltIn.Set_Suite_Variable ${testtool_log} ${logfile}
${name_suffix}= BuiltIn.Set_Variable -${suffix}.jar
${filename}= Deploy_Artifact ${component} ${artifact} ${name_prefix} ${name_suffix}
[Return] ${filename}
+
+Compose_Base_Java_Command
+ [Arguments] ${openjdk}=${JDKVERSION}
+ [Documentation] Return string suitable for launching Java programs over SSHLibrary, depending on JRE version needed.
+ ... Not directly related to nexus, but different versioned Java artifacts may need this.
+ BuiltIn.Return_From_Keyword_If """${openjdk}""" == "openjdk8" /usr/lib/jvm/java-1.8.0/bin/java
+ BuiltIn.Return_From_Keyword_If """${openjdk}""" == "openjdk7" /usr/lib/jvm/java-1.7.0/bin/java
+ BuiltIn.Return_From_Keyword java
+
+Compose_Full_Java_Command
+ [Arguments] ${options} ${openjdk}=${JDKVERSION}
+ [Documentation] Return full Bash command to run Java with given options.
+ ... The options may include JVM options, application command line arguments, Bash redirects and other constructs.
+ ${base_command} = Compose_Base_Java_Command openjdk=${openjdk}
+ ${full_command} = BuiltIn.Set_Variable ${base_command} ${options}
+ BuiltIn.Log ${full_command}
+ [Return] ${full_command}
Start_Pcc_Mock
[Documentation] Execute pcc-mock on Mininet, fail is Open is not sent, keep it running for next tests.
- ${command}= Set_Variable java -jar ${filename} --local-address ${MININET} --remote-address ${CONTROLLER} 2>&1 | tee pccmock.log
+ ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --local-address ${MININET} --remote-address ${CONTROLLER} 2>&1 | tee pccmock.log
Log ${command}
Write ${command}
Read_Until started, sent proposal Open
Start_Secure_Pcc_Mock
[Documentation] Execute pcc-mock on Mininet with password set, fail if pcc-mock promptly exits. Keep pcc-mock running for next test cases.
- ${command}= BuiltIn.Set_Variable java -jar ${filename} --password topsecret --reconnect 1 --local-address ${MININET} --remote-address ${CONTROLLER} 2>&1 | tee pccmock.log
+ ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --password topsecret --reconnect 1 --local-address ${MININET} --remote-address ${CONTROLLER} 2>&1 | tee pccmock.log
BuiltIn.Log ${command}
SSHLibrary.Write ${command}
Read_And_Fail_If_Prompt_Is_Seen
Start_Pcc_Mock
[Documentation] Launch pcc-mock on background so simulated PCCs start connecting to controller.
SSHLibrary.Switch_Connection pccmock
- ${command} = BuiltIn.Set_Variable java -jar ${mock_location} --local-address ${FIRST_PCC_IP} --remote-address ${CONTROLLER} --pcc ${PCCS} --lsp ${LSPS} &> ${LOG_PATH}/${LOG_NAME}
+ ${command} = NexusKeywords.Compose_Full_Java_Command -jar ${mock_location} --local-address ${FIRST_PCC_IP} --remote-address ${CONTROLLER} --pcc ${PCCS} --lsp ${LSPS} &> ${LOG_PATH}/${LOG_NAME}
BuiltIn.Log ${command}
SSHLibrary.Write ${command}
# The pccmock SSH session is left alive, but no data will be exchanged for a while.
${options}= BuiltIn.Set_Variable ${options} --destination /restconf/config/network-topology:network-topology/topology/topology-netconf/node/${DEVICE_NAME}/yang-ext:mount/car:cars
${options}= BuiltIn.Set_Variable ${options} --edit-content request1.json
${options}= BuiltIn.Set_Variable ${options} --auth ${ODL_RESTCONF_USER} ${ODL_RESTCONF_PASSWORD}
- ${command} BuiltIn.Set_Variable java -Xmx1G -XX:MaxPermSize=256M -jar ${filename} ${options}
+ ${command}= NexusKeywords.Compose_Full_Java_Command -Xmx1G -XX:MaxPermSize=256M -jar ${filename} ${options}
BuiltIn.Log Running restperfclient: ${command}
${restperfclientlog}= Utils.Get_Log_File_Name restperfclient
BuiltIn.Set_Suite_Variable ${restperfclientlog} ${restperfclientlog}