started working on regression testing scripts for The Rig

This commit is contained in:
Edwin Eefting
2017-06-01 20:43:47 +02:00
parent fb83badfce
commit d07bb3574a
10 changed files with 116 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
wifi.txt
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash -e
source configlib
cd ..
$BUILDCMD
+14
View File
@@ -0,0 +1,14 @@
TYPE1="wemos d1 mini v2.2.0"
SERIAL1=/dev/serial/by-path/pci-0000:00:14.0-usb-0:3.4.4:1.0-port0
IP1=192.168.13.91
FLASHCMD1="esptool.py --port $SERIAL1 -b 1500000 write_flash 0x0 .pioenvs/dev_4096/firmware.bin --flash_size=32m -p"
BUILDCMD1="platformio run --environment dev_4096"
TYPE2="geekcreit ESP12E devkit v2"
SERIAL2=/dev/serial/by-path/pci-0000:00:14.0-usb-0:3.4.3:1.0-port0
IP2=192.168.13.92
FLASHCMD2="esptool.py --port $SERIAL2 -b 1500000 write_flash 0x0 .pioenvs/dev_4096/firmware.bin --flash_size=32m -p"
#FLASHCMD2="platformio run --environment dev_4096 -t upload --upload-port $SERIAL2"
BUILDCMD2="platformio run --environment dev_4096"
+28
View File
@@ -0,0 +1,28 @@
source config.txt
#auto assign specified unit number to default variables
UNIT=$1
if [ "$UNIT" ]; then
V="TYPE$UNIT"
TYPE=${!V}
V="SERIAL$UNIT"
SERIAL=${!V}
V="IP$UNIT"
IP=${!V}
V="FLASHCMD$UNIT"
FLASHCMD="${!V}"
V="BUILDCMD$UNIT"
BUILDCMD="${!V}"
echo "Using unit $UNIT at $IP ($TYPE)"
else
echo "Please specify unit number"
exit 1
fi
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash -e
source configlib
esptool.py --port $SERIAL -b 1500000 erase_flash
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash -e
source configlib
pushd .. >/dev/null
$FLASHCMD
popd > /dev/null
#to prevent hangs when ESPEasy tries to reboot (due to an ESP/lib bug)
./reboot $UNIT
Executable
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash -e
source configlib
./reboot.py $SERIAL
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env python
import serial
import sys
import time
p=serial.Serial(sys.argv[1])
p.setDTR(0)
time.sleep(0.1)
p.setDTR(1)
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash -e
source configlib
platformio serialports monitor --baud 115200 --port $SERIAL --echo;
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash -e
source configlib
source wifi.txt
echo "
wifissid $WIFI_SSID
wifikey $WIFI_PASS
ip $IP
save
reboot
" > $SERIAL
echo -n "Waiting for unit $UNIT to connect: "
sleep 1
trap "exit 1" SIGINT
while ! ping -w 1 -c 1 $IP &>/dev/null; do
echo -n "."
done
echo "ONLINE"