From b835780306f67a0b99adfc990477393fcf00bab8 Mon Sep 17 00:00:00 2001 From: wangyu Date: Tue, 9 May 2023 11:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=84=9A=E6=9C=ACoe=5Ftest?= =?UTF-8?q?=5Fbirdc=5F01.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testcases/cli-test/bird/oe_test_birdc_01.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testcases/cli-test/bird/oe_test_birdc_01.sh b/testcases/cli-test/bird/oe_test_birdc_01.sh index 6b40c2e48..b05fc5a53 100755 --- a/testcases/cli-test/bird/oe_test_birdc_01.sh +++ b/testcases/cli-test/bird/oe_test_birdc_01.sh @@ -43,7 +43,8 @@ EOF grep "bird> exit" tmp.txt CHECK_RESULT $? 0 0 "check birdc exit failed" rm -f tmp.txt - spawn birdc + expect < tmp.txt + spawn birdc expect "bird>" {send "help\n"} send "quit\n" expect eof @@ -65,7 +66,7 @@ EOF send "quit\n" expect eof EOF - num=$(wc -l tmp.txt) + num=$(cat tmp.txt|wc -l) if [[ $num == 4 ]]; then echo "aa" | grep "aa" else @@ -88,7 +89,7 @@ EOF send "quit\n" expect eof EOF - grep "ospf1: disabled" tmp.txt + grep "ospf1: already disabled" tmp.txt CHECK_RESULT $? 0 0 "check birdc disable failed" rm -f tmp.txt LOG_INFO "End to run test." -- Gitee