Skip to content

Commit

Permalink
prod_tests: adrv1crr: reduce wait time
Browse files Browse the repository at this point in the history
Button event detected as soon as button is pressed,
without waiting for timeout to finish.
Time synchronization is checked at the beginnning of
testing, if it is not up to date a message is displayed
and the log files begin with _no_date_

Signed-off-by: Ramona Alexandra Nechita <[email protected]>
  • Loading branch information
ranechita committed Dec 9, 2021
1 parent f9eb6c4 commit b7b1e73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
8 changes: 4 additions & 4 deletions adrv1crr/adrv_crr_test/test_nav.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ run_test $TEST_ID "$SHORT_DESC" "$CMD"

TEST_ID="02"
SHORT_DESC="double press BT0 - timeout 10 seconds"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 2 \"type 1 (EV_KEY), code 105 (KEY_LEFT), value 1\" > /dev/null"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 1 \"type 1 (EV_KEY), code 105 (KEY_LEFT), value 0\" > /dev/null"
run_test $TEST_ID "$SHORT_DESC" "$CMD"

TEST_ID="03"
SHORT_DESC="double press BT1 - timeout 10 seconds"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 2 \"type 1 (EV_KEY), code 106 (KEY_RIGHT), value 1\" > /dev/null"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 1 \"type 1 (EV_KEY), code 106 (KEY_RIGHT), value 0\" > /dev/null"
run_test $TEST_ID "$SHORT_DESC" "$CMD"

TEST_ID="04"
SHORT_DESC="double press BT2 - timeout 10 seconds"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 2 \"type 1 (EV_KEY), code 28 (KEY_ENTER), value 1\" > /dev/null"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 1 \"type 1 (EV_KEY), code 28 (KEY_ENTER), value 0\" > /dev/null"
run_test $TEST_ID "$SHORT_DESC" "$CMD"

TEST_ID="05"
SHORT_DESC="double press BT3 - timeout 10 seconds"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 2 \"type 1 (EV_KEY), code 1 (KEY_ESC), value 1\" > /dev/null"
CMD="timeout 10 evtest /dev/input/by-path/platform-gpio_keys-event | grep -m 1 \"type 1 (EV_KEY), code 1 (KEY_ESC), value 0\" > /dev/null"
run_test $TEST_ID "$SHORT_DESC" "$CMD"

TEST_ID="06"
Expand Down
33 changes: 11 additions & 22 deletions adrv1crr/lib/production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ show_start_state() {
}

get_board_serial() {
BOARD_SERIAL=$(ssh_cmd "dmesg | grep SPI-NOR-UniqueID | cut -d' ' -f9 | tr -d '[:cntrl:]'")
BOARD_SERIAL=$(ssh_cmd "dmesg | grep SPI-NOR-UniqueID | cut -d' ' -f9 | tr -d '[:cntrl:]'") # to be updated with a serial number from carrier
}

get_fmcomms_serial() {
Expand All @@ -37,10 +37,10 @@ handle_error_state() {
FAILED=1
inc_fail_stats "$serial"
console_ascii_failed
if [ -n "$serial" ] ; then
if [ $SYNCHRONIZATION -eq 0 ]; then
cat "$LOGFILE" > "$LOGDIR/failed_${serial}_${RUN_TIMESTAMP}.log"
else
cat "$LOGFILE" > "${ERRORSFILE}_${RUN_TIMESTAMP}"
cat "$LOGFILE" > "$LOGDIR/no_date_failed_${serial}_${RUN_TIMESTAMP}.log"
fi
cat /dev/null > "$LOGFILE"
}
Expand Down Expand Up @@ -191,7 +191,7 @@ production() {
timedatectl | grep "synchronized: yes"
SYNCHRONIZATION=$?
if [ $SYNCHRONIZATION -ne 0 ]; then
echo_red "Your time and date is not up-to-date. The times of the logs will be inaccurate"
echo_red "Your time and date is not up-to-date. The times of the logs will be inaccurate. The corresponding log files will begin with \"no_date\""
fi

case $MODE in
Expand All @@ -206,21 +206,6 @@ production() {
handle_error_state "$BOARD_SERIAL"
fi
;;
"ADRV SOM Test")
ssh_cmd "sudo /home/analog/adrv_som_test/som_test.sh"
if [ $? -ne 0 ]; then
handle_error_state "$BOARD_SERIAL"
fi
;;
"ADRV FMCOMMS8 RF test")
ssh_cmd "sudo /home/analog/adrv_fmcomms8_test/fmcomms8_test.sh"
RESULT=$?
get_fmcomms_serial
python3 -m pytest --color yes $SCRIPT_DIR/work/pyadi-iio/test/test_adrv9009_zu11eg_fmcomms8.py -v
if [ $? -ne 0 ] || [ $RESULT -ne 0 ]; then
handle_error_state "$BOARD_SERIAL"
fi
;;
*) echo "invalid option $MODE" ;;
esac

Expand All @@ -229,9 +214,13 @@ production() {
fi

if [ "$FAILED" == "0" ] ; then
inc_pass_stats "$BOARD_SERIAL"
cat "$LOGFILE" > "$LOGDIR/passed_${BOARD_SERIAL}_${RUN_TIMESTAMP}.log"
cat /dev/null > "$LOGFILE"
inc_pass_stats "$BOARD_SERIAL"
if [ $SYNCHRONIZATION -eq 0 ]; then
cat "$LOGFILE" > "$LOGDIR/passed_${BOARD_SERIAL}_${RUN_TIMESTAMP}.log"
else
cat "$LOGFILE" > "$LOGDIR/no_date_passed_${BOARD_SERIAL}_${RUN_TIMESTAMP}.log"
fi
cat /dev/null > "$LOGFILE"
fi
}

0 comments on commit b7b1e73

Please sign in to comment.