Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change way of calling switch bots #146

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Robot-Framework/config/variables.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Library OperatingSystem
${BUILD_ID} ${EMPTY}
${SWITCH_TOKEN} ${EMPTY}
${SWITCH_SECRET} ${EMPTY}
${DEVICE_TYPE} ${EMPTY}


*** Keywords ***
Expand Down Expand Up @@ -43,6 +44,10 @@ Set Variables
Set Global Variable ${JOB} ${config['Job']}
END

IF "${DEVICE_TYPE}" == "lenovo-x1"
Set Global Variable ${SWITCH_BOT} ${config['addresses']['${DEVICE}']['switch_bot']}
END


Read Config
[Arguments] ${file_path}=../config/test_config.json
Expand Down
4 changes: 2 additions & 2 deletions Robot-Framework/resources/device_control.resource
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Reboot LenovoX1
${device_is_available} Ping Host ${DEVICE_IP_ADDRESS}
IF ${device_is_available}
Log To Console ${\n}Turning device off...
Press Button ${DEVICE}-OFF
Press Button ${SWITCH_BOT}-OFF
Sleep ${delay}
END
Log To Console Turning device on...
Press Button ${DEVICE}-ON
Press Button ${SWITCH_BOT}-ON

Soft Reboot Device
[Documentation] Reboot device from command line
Expand Down
4 changes: 2 additions & 2 deletions Robot-Framework/test-suites/boot-test/boot_test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Turn OFF Device
[Setup] Run Keyword If "${DEVICE_IP_ADDRESS}" == "" Get ethernet IP address
Log To Console ${\n}Turning device off...
IF "${DEVICE_TYPE}" == "lenovo-x1"
Press Button ${DEVICE}-OFF
Press Button ${SWITCH_BOT}-OFF
ELSE
Turn Plug Off
END
Expand All @@ -90,7 +90,7 @@ Turn ON Device
[Tags] turnon
Log To Console ${\n}Turning device on...
IF "${DEVICE_TYPE}" == "lenovo-x1"
Press Button ${DEVICE}-ON
Press Button ${SWITCH_BOT}-ON
ELSE
Turn Plug On
END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Measure Soft Boot Time
Measure Hard Boot Time
[Documentation] Measure how long it takes to device to boot up with hard reboot
[Tags] SP-T192 lenovo-x1
Press Button ${DEVICE}-OFF
Press Button ${SWITCH_BOT}-OFF
Wait Until Keyword Succeeds 15s 2s Check If Ping Fails
Sleep 5 # Wait until switchbot has pressed and returned button
Press Button ${DEVICE}-ON
Press Button ${SWITCH_BOT}-ON
Get Boot times hard image_name=Hard Boot Times


Expand Down
Loading