57 lines
2.2 KiB
Plaintext
57 lines
2.2 KiB
Plaintext
*** Settings ***
|
|
Documentation Logging API tests for Aniworld.
|
|
... Covers config, file listing, tail, download, test messages, and cleanup.
|
|
|
|
Resource ${CURDIR}/../resources/common.resource
|
|
Resource ${CURDIR}/../resources/api_keywords.resource
|
|
|
|
Test Setup Run Keywords
|
|
... Create Anonymous Session
|
|
... AND Setup Master Password
|
|
... AND Create Authenticated Session
|
|
|
|
Test Teardown Delete All Sessions
|
|
|
|
*** Test Cases ***
|
|
# ---------------------------------------------------------------------------
|
|
# Logging Config
|
|
# ---------------------------------------------------------------------------
|
|
Get Logging Config
|
|
[Documentation] Retrieve the current logging configuration.
|
|
${resp}= Get Logging Config
|
|
Response Should Have Status ${resp} 200
|
|
Response Should Contain Keys ${resp} level file max_bytes backup_count
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Log Files
|
|
# ---------------------------------------------------------------------------
|
|
List Log Files
|
|
[Documentation] List available log files.
|
|
${resp}= List Log Files
|
|
Response Should Have Status ${resp} 200
|
|
Response Should Be Valid JSON ${resp}
|
|
|
|
Tail Log File
|
|
[Documentation] Tail the contents of a log file.
|
|
${resp}= Tail Log File aniworld.log
|
|
Response Should Have Status ${resp} 200
|
|
|
|
Download Log File
|
|
[Documentation] Download a log file as binary.
|
|
${resp}= Download Log File aniworld.log
|
|
Response Should Have Status ${resp} 200
|
|
Should Be Equal As Strings ${resp.headers['content-type']} application/octet-stream
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Log Management
|
|
# ---------------------------------------------------------------------------
|
|
Write Test Log Messages
|
|
[Documentation] Write test log messages at various levels.
|
|
${resp}= Write Test Logs
|
|
Response Should Have Status ${resp} 200
|
|
|
|
Cleanup Old Logs
|
|
[Documentation] Delete old log files.
|
|
${resp}= Cleanup Logs
|
|
Response Should Have Status ${resp} 200
|