aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/gsm-tester/templates
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2018-03-06 14:07:16 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-16 09:18:11 +0000
commit196402ac657f86a94b86a12b07dfeaf7d3a0a273 (patch)
tree01a6a176682f16c1f519cd0573747979860406e1 /ansible/roles/gsm-tester/templates
parent07653276019511efe7e188a80c307225ac78230d (diff)
add ansible playbooks
Introduce playbooks to do: - setup-jenkins-slave - setup a usualy or special jenkins-slave - setup-gsm-tester - setup the gsm-tester Change-Id: I7007a4e6c38f73843390ec2b3b91133aff21e36a
Diffstat (limited to 'ansible/roles/gsm-tester/templates')
-rwxr-xr-xansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh b/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh
new file mode 100755
index 0000000..9262f97
--- /dev/null
+++ b/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -ex
+uhubctl -p 123456 -a 0
+# give a lot of time to discharge capacitors on the board
+sleep 20
+uhubctl -p 123456 -a 1
+attempts=30
+while [ "x$(uhubctl | grep -e 05c6 -e 1199 -c)" != "x{{ gsm_modems }}" ]; do
+ attempts=$(($attempts - 1))
+ if [ "$attempts" -le 0 ]; then
+ echo "Timeout"
+ exit 1
+ fi
+ sleep 1
+done
+uhubctl