*** Settings *** Documentation Akas sanity test suite Library Collections Library OperatingSystem Library Process Library RequestsLibrary Library lib/ComplexRequests.py Test Tags core cli *** Variables *** ${BIN} release/akas ${SHA256_KEY_FILE} tests/files/sha256_keys01.txt ${AKAS_WAIT} 1s ${URL} http://localhost:5001/load *** Test Cases *** Test AKAS /load URL: default [Documentation] Load test Given Start Process ${BIN} serve --no-admin-key alias=akas And Sleep ${AKAS_WAIT} ${file} = Get File For Streaming Upload ${SHA256_KEY_FILE} VAR &{headers} Authorization=Bearer my-admin-key VAR &{dict} file=${file} When POST ${URL} headers=${headers} files=${dict} expected_status=200 Then Check Auth Access key=XX-XXX And Check Auth Access key=YY-XXX status=401 ${result} = And Terminate Process akas And Should Be Equal As Integers ${result.rc} 0 And Should Contain ${result.stdout} sha256_key: 92c55f4d88b1 - unknown-host - unknown-uri - access authorized And Should Contain ... ${result.stdout} ... sha256_key: 24328022c7341148e4d84fab687dff6bd1f7c836a73a307ceb3357a3b9bb2d9d - unknown-host - unknown-uri - access unauthorized [Teardown] Kill Akas Server Test AKAS /load URL: with length check [Documentation] Load test Given Start Process ${BIN} serve --no-admin-key --length 6 alias=akas And Sleep ${AKAS_WAIT} ${file} = Get File For Streaming Upload ${SHA256_KEY_FILE} VAR &{headers} Authorization=Bearer my-admin-key VAR &{dict} file=${file} When POST ${URL} headers=${headers} files=${dict} expected_status=200 Then Check Auth Access key=XY-ZZZ And Check Auth Access key=XX-ZZ status=401 ${result} = And Terminate Process akas And Should Be Equal As Integers ${result.rc} 0 And Should Contain ${result.stdout} ... key-invalid-length - unknown-host - unknown-uri - access unauthorized [Teardown] Kill Akas Server Test AKAS /load URL: with prefix check [Documentation] Load test Given Start Process ${BIN} serve --no-admin-key --prefix XX- alias=akas And Sleep ${AKAS_WAIT} ${file} = Get File For Streaming Upload ${SHA256_KEY_FILE} VAR &{headers} Authorization=Bearer my-admin-key VAR &{dict} file=${file} When POST ${URL} headers=${headers} files=${dict} expected_status=200 Then Check Auth Access key=XX-ZZ And Check Auth Access key=XY-ZZZ status=401 ${result} = And Terminate Process akas And Should Be Equal As Integers ${result.rc} 0 And Should Contain ${result.stdout} ... key-invalid-prefix - unknown-host - unknown-uri - access unauthorized [Teardown] Kill Akas Server *** Keywords *** Kill Akas Server [Documentation] A keyword for killing AKAS process if any Log To Console Terminate All Processes kill=True Check Auth Access [Documentation] Check the URI /auth access [Arguments] ${key} ${status}=200 ${port}=5001 VAR &{headers}= Authorization=Bearer ${key} GET http://localhost:${port}/auth headers=${headers} expected_status=${status}