Closed macpijan closed 3 months ago
@PLangowski
I have tried various way of sharing this, and probably the best way is as in the linked branches. I would start from there adn check if we can call basic functions (like flash probe/read) from osfv-script repo in all these cases:
If the answer is yes, and we cannot see probles with this approach, we can continue with cleanup, further improvements, and replacing the previous Rte library with the calls from osfv-scripts libs.
High-level TODOs:
-v snipeit:no
switch
which allowed us to run the scripts without snipeit; this should still be somehow
supported, but the snipeit calls are somehow convoluted in the osfv-scripts
already; we need a proposal on how to handle that@macpijan
I've heard the Sonoff API has changed. It seems to be confirmed when i try to use osfv_cli
to control sonoff
osfv_cli sonoff --rte_ip 192.168.10.107 get
Getting Sonoff relay state...
Failed to get Sonoff relay state. Error: 404 Client Error: Not Found for url: http://192.168.10.170/switch/sonoff_s20_relay
Below is the content of the sonoff.sh
script on the rte in question:
#!/bin/bash
SONOFF_IP=192.168.10.170
if [[ "$1" == "off" ]]; then
wget -q -O - http://$SONOFF_IP/cm?cmnd=Power%20off --method=POST
echo -e '\n'
elif [[ "$1" == "on" ]]; then
wget -q -O - http://$SONOFF_IP/cm?cmnd=Power%20On --method=POST
echo -e '\n'
elif [[ "$1" == "toggle" ]]; then
wget -q -O - http://$SONOFF_IP/cm?cmnd=Power%20TOGGLE --method=POST
echo -e '\n'
elif [[ "$1" == "show" ]]; then
wget -q -O - http://$SONOFF_IP/cm?cmnd=Power
echo -e '\n'
else
echo -e "\$1 == on|off|show|toggle\nEdit this script to set the sonoff ip."
echo -e 'Current state:'
wget -q -O - http://$SONOFF_IP/cm?cmnd=Power
echo -e '\n'
fi
These are clearly different URLs.
Is anyone working on adapting osfv_cli
to the new API? This error is preventing me from accurately testing my work on this issue.
It is adapated already. Which versino are you using?
main, tag v0.4.2
Thanks
@macpijan both PRs linked to this issue are ready for review. I have tested Flash Read
on msi-pro-z690-a-ddr4 and minnowboard turbot. Everything seems to work, including running tests without snipeit (that requires sonoff and pikvm ips to be specified in command line). Here's how to run a test that way:
robot -L TRACE -v snipeit:'no' -v sonoff_ip:192.168.10.170 -v pikvm_ip:192.168.10.99 -v rte_ip:192.168.10.107 -v config:"msi-pro-z690-a-wifi-ddr4" -t "TEST /path/to/suite
OSFV is no longer dependent on RteCtrl and Sonoff APIs. All the calls were replaced wiith calls to the osfv_cli
package, which has been added to requirements.txt
.
Test environment version
Dasharo version (if applicable)
Dasharo variant (if applicable)
Affected component(s) or functionality (if applicable)
Brief summary
Implement DRY strategy. Avoid reimplementing low-level flashing and platform control login in multiple places:
Keep the low-level details only in one place, and provide an interface to be used in tests.
Additional context
WIP work: