mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-12 03:34:34 +08:00
515ffe4af4
So far we were using a telnet-based script to communicate with the PoE Switch to turn on/off the network ports the DUTs are connected. But this script does not seem very reliable because from time to time the switch fails to execute the steps in the script. As the PoE Switch we use is a smart one with support for SNMP protocol, it would be easier to use it to handle it, which allows to turn on/off the ports without going through the nasty telnet steps Acked-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9954>
18 lines
410 B
Bash
Executable File
18 lines
410 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -z "$BM_POE_INTERFACE" ]; then
|
|
echo "Must supply the PoE Interface to power up"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$BM_POE_ADDRESS" ]; then
|
|
echo "Must supply the PoE Switch host"
|
|
exit 1
|
|
fi
|
|
|
|
SNMP_KEY="SNMPv2-SMI::mib-2.105.1.1.1.3.1.`expr 48 + $BM_POE_INTERFACE`"
|
|
SNMP_ON="i 1"
|
|
SNMP_OFF="i 2"
|
|
|
|
flock /var/run/poe.lock -c "snmpset -v2c -r 3 -t 30 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF"
|