Skip to content
Snippets Groups Projects
Commit 69eb2ec3 authored by Jonas Höppner's avatar Jonas Höppner
Browse files

pbb: bluetooth: Add bluetooth-only test, rework bluetooth commands

Also a persitent log file is now written to disk.

no pipe
parent db81220a
No related branches found
No related tags found
1 merge request!241pbb: bluetooth: Add bluetooth-only test, rework bluetooth commands
#-----------------------------------------------------------------------------#
# PREPARATION #
#-----------------------------------------------------------------------------#
Bluetooth_prepare systemctl start bluetooth-init; ( l2pingd -s64 -t1 -d0 -v 00:0E:8E:BB:4D:21 2>&1 | tee -a /opt/ltp/results/bt-test.log > /tmp/bt_test.log ) &
Wait sleep 5
#-----------------------------------------------------------------------------#
# TESTCASES #
#-----------------------------------------------------------------------------#
Test_BT_ping /opt/ltp/scripts/bt_test.sh -p /tmp/bt_test.log -n 5 -g 3
#-----------------------------------------------------------------------------#
# CLEANUP #
#-----------------------------------------------------------------------------#
Test_BT_stop killall l2pingd
......@@ -29,7 +29,7 @@ USB_sticks_umount for i in $(grep /dev/sd /proc/mounts | awk '{print
Touchtest_remove_socket rm -f /touch_tst_socket
Touchtest_start touchmon -d -i /dev/input/event0 -s /touch_tst_socket -p 0
Battery_Charger_Active gpioset $(gpiofind EN_CHARGER)=1
Bluetooth_prepare systemctl start bluetooth-init; l2pingd -s64 -t1 -d0 -v 00:0E:8E:BB:4D:21 > /tmp/bt_test.log 2>&1 &
Bluetooth_prepare systemctl start bluetooth-init; ( l2pingd -s64 -t1 -d0 -v 00:0E:8E:BB:4D:21 2>&1 | tee -a /opt/ltp/results/bt-test.log > /tmp/bt_test.log ) &
# Enable 24VOUT Rail
Enable_24VOUT echo 1 > /sys/bus/platform/drivers/reg-userspace-consumer/24V_OUT/state
Relay_1_ON gpioset $(gpiofind "RELAY1_ON")=1
......@@ -53,7 +53,7 @@ Temp lm73temp -n lm75 -b 1 -d 0049
eMMC_write_25kB fwrite -q -n /file25k -b 25000 -i 1
Light_Sensor [ 2 -lt $( cat /sys/bus/iio/devices/iio\:device0/in_illuminance_raw ) ]
USB_stick_1_write_25kB bwrite -q -n /dev/sda -b 25000 -i 1
Test_BT_ping /opt/ltp/scripts/bt_test.sh -n 5 -g 5
Test_BT_ping /opt/ltp/scripts/bt_test.sh -p /tmp/bt_test.log -n 5 -g 3
#I2C i2c -q -d /dev/i2c-0 -s 0x68 -a 0x0a -b 0x0b -w 100 -i 150
Network_1 iptest -q -g 192.168.1.100 -n 1 -w 50
#Network_wlan0 iptest -q -g 192.168.3.100 -n 1 -w 990 -a
......
......@@ -29,7 +29,7 @@ USB_sticks_umount for i in $(grep /dev/sd /proc/mounts | awk '{print
Touchtest_remove_socket rm -f /touch_tst_socket
Touchtest_start touchmon -d -i /dev/input/event0 -s /touch_tst_socket -p 0
Battery_Charger_Active gpioset $(gpiofind EN_CHARGER)=1
Bluetooth_prepare systemctl start bluetooth-init; l2pingd -s64 -t1 -d0 -v 00:0E:8E:BB:4D:21 > /tmp/bt_test.log 2>&1 &
Bluetooth_prepare systemctl start bluetooth-init; ( l2pingd -s64 -t1 -d0 -v 00:0E:8E:BB:4D:21 2>&1 | tee -a /opt/ltp/results/bt-test.log > /tmp/bt_test.log ) &
# Enable 24VOUT Rail
Enable_24VOUT echo 1 > /sys/bus/platform/drivers/reg-userspace-consumer/24V_OUT/state
Relay_1_ON gpioset $(gpiofind "RELAY1_ON")=1
......@@ -53,7 +53,7 @@ Temp lm73temp -n lm75 -b 1 -d 0049
eMMC_write_25kB fwrite -q -n /file25k -b 25000 -i 1
Light_Sensor [ 2 -lt $( cat /sys/bus/iio/devices/iio\:device0/in_illuminance_raw ) ]
USB_stick_1_write_25kB bwrite -q -n /dev/sda -b 25000 -i 1
Test_BT_ping /opt/ltp/scripts/bt_test.sh -n 5 -g 5
Test_BT_ping /opt/ltp/scripts/bt_test.sh -p /tmp/bt_test.log -n 5 -g 3
#I2C i2c -q -d /dev/i2c-0 -s 0x68 -a 0x0a -b 0x0b -w 100 -i 150
Network_1 iptest -q -g 192.168.1.100 -n 1 -w 50
Network_wlan0 iptest -q -g 192.168.3.100 -n 1 -w 990 -a
......
#!/bin/sh
L2PINGD_LOG="/tmp/bt_test.log"
L2PINGD_PIPE="/tmp/bt-test-fifo"
PING_COUNT="5"
PING_GOOD_COUNT="3"
......@@ -15,10 +15,11 @@ do
;;
'-h' )
echo " trigger l2pingd to do X pings of which Y needs to be successful"
echo " -d: delay in ms between the pings, default: $DELAY"
echo " -g: numbers of pings that need to be successful to return success, default: $PING_GOOD_COUNT"
echo " -h: print help"
echo " -n: number of pings to send in total, default: $PING_COUNT"
echo " -g: numbers of pings that need to be successful to return success, default: $PING_GOOD_COUNT"
echo " -d: delay in ms between the pings, default: $DELAY"
echo " -p: Path to pipe or logfile to communicate with the l2pingd service"
echo " -v: More verbose messages"
exit 0
;;
......@@ -30,22 +31,29 @@ do
PING_GOOD_COUNT="$2"
shift
;;
'-p' )
L2PINGD_PIPE="$2"
shift
;;
esac
shift
done
DELAY="$(( DELAY * 1000 ))"
echo "" > "$L2PINGD_LOG"
# Only the file needs to be reset,
# a fifo can only be read once
if [ ! -p "$L2PINGD_PIPE" ];then
echo "" > "$L2PINGD_PIPE"
fi
PID_L2PINGD="$(pgrep l2pingd)"
if [ -z "$PID_L2PINGD" ];then
echo "l2pings is not running"
echo "RESULT: fail"
echo "BT_Ping: l2pingd is not running"
echo "BT_Ping: RESULT: fail"
exit 1
fi
# Reset the packet id to map the log
kill -USR2 $PID_L2PINGD
......@@ -58,7 +66,7 @@ do
kill -USR1 $PID_L2PINGD
usleep $DELAY
if grep -q "id $cnt time" "$L2PINGD_LOG"; then
if grep -q "id $cnt time" "$L2PINGD_PIPE"; then
good=$(( good + 1 ))
fi
cnt=$(( cnt + 1 ))
......@@ -68,8 +76,8 @@ if [ $good -ge $PING_GOOD_COUNT ];
then
status="pass"
fi
echo "Received $good out of $cnt pings"
echo "RESULT: $status"
echo "BT_Ping: Received $good out of $cnt pings"
echo "BT_Ping: RESULT: $status"
if [ "$status" = "pass" ]; then
exit 0
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment