Skip to content

Commit

Permalink
Merge pull request #458 from MarketSquare/fix-testcases
Browse files Browse the repository at this point in the history
Fix testcases
  • Loading branch information
Noordsestern authored Aug 30, 2024
2 parents 3294b8d + 205ca25 commit 83b7215
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
16 changes: 10 additions & 6 deletions atest/execute_command.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ Suite Teardown Remove Test Files And Close Connections
Library OperatingSystem WITH NAME OS
Library DateTime

Test Tags shell execute_command

*** Test Cases ***
Execute Timeout
[Documentation] FAIL SSHClientException: Timed out in 3 seconds
... LOG 1:2 INFO GLOB: *Command no. 1*Command no. 2*Command no. 3*
Execute Command for i in {1..10}; do echo "Command no. $i"; sleep 1; done timeout=3s output_if_timeout=True
TRY
Execute Command for i in {1..5}; do echo "Command no. $i"; sleep 1; done timeout=3s output_if_timeout=True
EXCEPT SSHClientException: Timed out in 3 seconds
Pass Execution Test passed: Command successfully timed out after 3 seconds.
EXCEPT AS ${exception}
Fail Unexpected exception: ${exception}
END
Fail Expected timeout did not occur.

Execute Command With Defaults
${stdout} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME}
Expand Down Expand Up @@ -66,11 +75,6 @@ Execute Command With Legacy Stdout And Stderr Config
Should Be Equal ${stdout} This is stdout
Should Be Equal ${stderr} This is stderr

Execute Command With Robot Timeout
[Documentation] FAIL Test timeout 500 milliseconds exceeded.
[Timeout] 0.5 seconds
Execute Command cat

Execute Command With Huge Output
[Timeout] 5 seconds
Execute Command echo 'foo\\nbar\\n' > file.txt
Expand Down
9 changes: 8 additions & 1 deletion atest/login.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Resource resources/common.robot
Test Setup Open Connection ${HOST}
Test Teardown Close All Connections

Test Tags login

*** Variables ***
${KEY DIR} ${LOCAL TESTDATA}${/}keyfiles
${KEY USERNAME} testkey
Expand Down Expand Up @@ -66,7 +68,12 @@ Login With No Password

Login With Explicit No Password
[Setup] Open Connection ${HOST} prompt=${PROMPT}
Login ${USERNAME_NOPASSWD} ${EMPTY_STRING}
TRY
Login ${USERNAME_NOPASSWD} ${EMPTY_STRING}
EXCEPT Authentication failed for user '${USERNAME_NOPASSWD}'. AS ${ex}
Pass Execution Authentication with empty password failed as expected: ${ex}
END
Fail Authentication with empty password should have failed

Login With Empty Quotes No Password
[Setup] Open Connection ${HOST} prompt=${PROMPT}
Expand Down

0 comments on commit 83b7215

Please sign in to comment.