Return-Path: From: Qiu Tingting Date: Tue, 31 Jul 2018 17:30:57 +0800 Message-ID: <1533029457-6561-1-git-send-email-qiutt@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Fuego] [PATCH] Functional.serial_rx: fix errors in test_run List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Details: 1. change non-exist functional.sh to functions.sh 2. calls stty with sudo 3. create new sh file to make sendmessage work 4. delete tmp files on board Signed-off-by: Qiu Tingting --- engine/tests/Functional.serial_rx/fuego_test.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/engine/tests/Functional.serial_rx/fuego_test.sh b/engine/tests/Functional.serial_rx/fuego_test.sh index e7855d0..566755b 100644 --- a/engine/tests/Functional.serial_rx/fuego_test.sh +++ b/engine/tests/Functional.serial_rx/fuego_test.sh @@ -39,13 +39,15 @@ function test_run { put /tmp/expected /tmp for RATE in $FUNCTIONAL_SERIAL_RX_BAUDRATES ; do - stty -F $HOST_DEV $RATE raw -echo -echoe -echok + sudo stty -F $HOST_DEV $RATE raw -echo -echoe -echok # Receive for either SENDATA.length or 10 sec. cmd "stty -F $DUT_DEV $RATE raw -echo -echoe -echok min ${#SENDATA} time 100" cmd "nohup cat $DUT_DEV > /tmp/received &" # cmd seems to be returning slightly before the cat starts reading sleep 0.3 - echo -n "$SENDATA" > $FUNCTIONAL_SERIAL_RX_HOST_SERIAL_DEV + echo "echo -n \" $SENDATA\" > $FUNCTIONAL_SERIAL_RX_HOST_SERIAL_DEV" > sendmessage.sh + chmod +x sendmessage.sh + sudo ./sendmessage.sh # kill "cat" in case that the communication failed. noabort "cmd \"sync ; killall cat\"" report_append "diff /tmp/received /tmp/expected && echo TEST-$RATE OK || echo TEST-$RATE FAILED" @@ -53,7 +55,8 @@ function test_run { } function test_processing { + noabort "cmd \"rm /tmp/received ; rm /tmp/expected\"" log_compare "$TESTDIR" "$(echo "$FUNCTIONAL_SERIAL_RX_BAUDRATES" | wc -w)" "^TEST.*OK" "p" } -. $FUEGO_CORE/engine/scripts/functional.sh +. $FUEGO_CORE/engine/scripts/functions.sh -- 2.7.4