Add ability to compose java command according to version 80/35280/7
authorVratko Polak <vrpolak@cisco.com>
Wed, 24 Feb 2016 15:35:58 +0000 (16:35 +0100)
committerVratko Polak <vrpolak@cisco.com>
Wed, 24 Feb 2016 15:35:58 +0000 (16:35 +0100)
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>
csit/libraries/NetconfKeywords.robot
csit/libraries/NexusKeywords.robot
csit/suites/bgpcep/pcepuser/pcepuser.robot
csit/suites/bgpcep/tcpmd5user/tcpmd5user.robot
csit/suites/bgpcep/throughpcep/cases.robot
csit/suites/netconf/restperfclient/performance.robot

index 36731719f9e4bee877cdc449912c98000543daaf..234f99d8f10404ca4e6bee78344e7e235670ee80 100644 (file)
@@ -152,7 +152,7 @@ Install_And_Start_Testtool
     ${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}
index f93f707f406a42d62742d460abe2b0991ea1f6b6..850711e5d0c9066e2a05298459b1da230320fd58 100644 (file)
@@ -102,3 +102,20 @@ Deploy_Test_Tool
     ${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}
index fa1e7625b145020e24a30a8bc2254dc3a50eeae7..c1d37b19a5eb38e631c43bcd4db951f25a634ce2 100644 (file)
@@ -34,7 +34,7 @@ Topology_Precondition
 
 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
index bc717f4d590342f109d258fe767fefe9f1a3af13..d3cad0f210e46f7edadabe38ff9924d83c5d235b 100644 (file)
@@ -41,7 +41,7 @@ Topology_Precondition
 
 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
index 0249d67b7916b753c963acc788d5b0f1a1c3c57c..8bd6077aa230732e7078de5007c0c84a19961dd2 100644 (file)
@@ -218,7 +218,7 @@ Topology_Precondition
 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.
index fb77e16382bd414e4922958d72c1f2339d70b81d..411321a23ec665cfc50ceff33c3b3333b20ecfb4 100644 (file)
@@ -69,7 +69,7 @@ Deploy_And_Run_RestPerfClient
     ${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}