-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maarit Härkönen <[email protected]>
- Loading branch information
Showing
4 changed files
with
86 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SPDX-FileCopyrightText: 2022-2024 Technology Innovation Institute (TII) | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
*** Settings *** | ||
Resource ../config/variables.robot | ||
|
||
|
||
*** Keywords *** | ||
Configure wifi | ||
[Arguments] ${netvm_ssh} ${SSID} ${passw} | ||
Switch Connection ${netvm_ssh} | ||
Log To Console Configuring Wifi | ||
Set Log Level NONE | ||
Execute Command nmcli dev wifi connect ${SSID} password ${passw} sudo=True sudo_password=${PASSWORD} | ||
Set Log Level INFO | ||
|
||
Remove Wifi configuration | ||
[Arguments] ${SSID} | ||
Switch Connection ${netvm_ssh} | ||
Log To Console Removing Wifi configuration | ||
Execute Command nmcli connection delete id ${SSID} | ||
|
||
Turn OFF WiFi | ||
[Arguments] ${SSID} | ||
Switch Connection ${netvm_ssh} | ||
Log To Console Turning off Wifi | ||
Execute Command nmcli con down id ${SSID} sudo=True sudo_password=${PASSWORD} | ||
|
||
Turn ON WiFi | ||
[Arguments] ${SSID} | ||
Switch Connection ${netvm_ssh} | ||
Log To Console Turning on Wifi | ||
Execute Command nmcli con up id ${SSID} sudo=True sudo_password=${PASSWORD} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
Robot-Framework/test-suites/logging-tests/check_logs.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SPDX-FileCopyrightText: 2022-2024 Technology Innovation Institute (TII) | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
*** Settings *** | ||
Documentation Testing logging | ||
Force Tags logging lenovo-x1 | ||
Resource ../../config/variables.robot | ||
Resource ../../resources/ssh_keywords.resource | ||
Resource ../../resources/connection_keywords.resource | ||
Library DateTime | ||
Suite Setup Set Variables ${DEVICE} | ||
Suite Teardown Close All Connections | ||
|
||
|
||
*** Variables *** | ||
${NETVM_SSH} ${EMPTY} | ||
${GRAFANA_LOGS} https://loki.ghaflogs.vedenemo.dev | ||
|
||
|
||
*** Test Cases *** | ||
Check Grafana logs | ||
[Documentation] Check that all virtual machines are sending logs to Grafana | ||
[Tags] SP-T172 | ||
[Setup] Connect to netvm | ||
[Teardown] Remove Wifi configuration ${TEST_WIFI_SSID} | ||
Configure wifi ${NETVM_SSH} ${TEST_WIFI_SSID} ${TEST_WIFI_PSWD} | ||
Check Internet Connection | ||
Connect to ghaf host | ||
${mac} Execute Command cat /var/lib/private/alloy/MACAddress sudo=True sudo_password=${PASSWORD} | ||
${date} DateTime.Get Current Date result_format=%Y-%m-%d | ||
Wait Until Keyword Succeeds 60s 2s Check Logs Are available ${date} ${mac} | ||
|
||
|
||
*** Keywords *** | ||
Check Internet Connection | ||
[Documentation] Check that DUT is able to connect to internet | ||
${output} Execute Command ping -c1 google.com | ||
Should Contain ${output} 1 received | ||
|
||
Check Logs Are available | ||
[Documentation] Check that virtual machine's logs are available in Grafana | ||
[Arguments] ${date} ${mac} | ||
FOR ${vm} IN @{VMS} | ||
Set Log Level NONE | ||
${out} Run logcli query --addr="${GRAFANA_LOGS}" --password="${PASSWORD}" --username="${LOGIN}" '{systemdJournalLogs="${mac}", nodename="${vm}"}' | ||
Set Log Level INFO | ||
Log ${out} | ||
Run Keyword And Continue On Failure Should Contain ${out} ${date} | ||
Run Keyword And Continue On Failure Should Not Contain ${out} Query failed | ||
END |