add ability for cbench to be run locally to the system executing robot framework 10/39810/2
authorJamo Luhrsen <jluhrsen@redhat.com>
Thu, 2 Jun 2016 23:56:44 +0000 (16:56 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Fri, 3 Jun 2016 01:34:51 +0000 (01:34 +0000)
Change-Id: I0efb64c93ff5ffc43bd456d1e66064a2cd01bb04
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
csit/suites/openflowplugin/Performance/010_Cbench.robot

index 145988426709538f402070a6f612f3541ca42bb0..99579e382ad674fe34a76e76edcb71fcca60eb2b 100644 (file)
@@ -8,6 +8,7 @@ Suite Setup       Cbench Suite Setup
 Test Teardown     Log Results As Zero If Cbench Timed Out
 Force Tags        cbench
 Library           String
+Library           Process
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/KarafKeywords.robot
 
@@ -47,7 +48,8 @@ Run Cbench And Log Results
     ##down can catch this problem and log the results as zero.    However, we need to know which
     ##file to log to, so setting it as a suite variable here.
     Set Suite Variable    ${output_filename}
-    ${output}=    Run Command On Remote System    ${cbench_system}    ${cbench_executable} -c ${ODL_SYSTEM_IP} ${cbench_args}    prompt_timeout=${test_timeout}
+    ${output}=    Run Keyword If    "${cbench_system}" == "localhost"    Run Process    ${cbench_executable}    -c    ${ODL_SYSTEM_IP}    ${cbench_args}
+    ...    ELSE    Run Command On Remote System    ${cbench_system}    ${cbench_executable} -c ${ODL_SYSTEM_IP} ${cbench_args}    prompt_timeout=${test_timeout}
     Log    ${output}
     Should Contain    ${output}    RESULT
     ${result_line}=    Get Lines Containing String    ${output}    RESULT
@@ -75,7 +77,8 @@ Cbench Suite Setup
     ##Setting the test timeout dynamically in case larger values on command line override default
     ${test_timeout}    Evaluate    (${loops} * ${duration_in_secs}) * 1.5
     Set Suite Variable    ${test_timeout}
-    Verify File Exists On Remote System    ${cbench_system}    ${cbench_executable}
+    Run Keyword If    "${cbench_system}" == "localhost"    File Should Exist    ${cbench_executable}
+    ...    ELSE    Verify File Exists On Remote System    ${cbench_system}    ${cbench_executable}
     Should Be True    ${loops} >= 2    If number of loops is less than 2, cbench will not run
     Verify Feature Is Installed    odl-openflowplugin-drop-test
     Issue Command On Karaf Console    dropallpacketsrpc on