blob: ea88a9086a08c745e79b909c44053519b52a23f7 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001Tweak tests of ifupdown to make it work with oe-core ptest framework.
2
3Upstream-Status: Inappropriate [oe-core specific]
4
5Signed-off-by: Kai Kang <kai.kang@windriver.com>
Andrew Geissler5f350902021-07-23 13:09:54 -04006---
7 tests/testbuild-linux | 11 ++++++-----
8 1 file changed, 6 insertions(+), 5 deletions(-)
Andrew Geissler82c905d2020-04-13 13:39:40 -05009
10diff --git a/tests/testbuild-linux b/tests/testbuild-linux
Andrew Geissler5f350902021-07-23 13:09:54 -040011index 5f148eb..d9b1698 100755
Andrew Geissler82c905d2020-04-13 13:39:40 -050012--- a/tests/testbuild-linux
13+++ b/tests/testbuild-linux
14@@ -1,6 +1,7 @@
15 #!/bin/sh -e
16
17-dir=tests/linux
18+curdir=$(dirname `readlink -f $0`)
19+dir=$curdir/linux
20
21 result=true
Andrew Geissler5f350902021-07-23 13:09:54 -040022 for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18; do
23@@ -12,7 +13,7 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050024 echo "Testcase $test: $args"
25
26 exitcode=0
27- ./ifup -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
28+ ifup -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
29 >$dir/up-res-out.$test 2>$dir/up-res-err.$test || exitcode=$?
30
31 (echo "exit code: $exitcode";
Andrew Geissler5f350902021-07-23 13:09:54 -040032@@ -20,7 +21,7 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050033 echo "====stderr===="; cat $dir/up-res-err.$test) > $dir/up-res.$test
34
35 exitcode=0
36- ./ifdown -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
37+ ifdown -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
38 >$dir/down-res-out.$test 2>$dir/down-res-err.$test || exitcode=$?
39
40 (echo "exit code: $exitcode";
Andrew Geissler5f350902021-07-23 13:09:54 -040041@@ -28,9 +29,9 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050042 echo "====stderr===="; cat $dir/down-res-err.$test) > $dir/down-res.$test
43
44 if diff -ub $dir/up.$test $dir/up-res.$test && diff -ub $dir/down.$test $dir/down-res.$test; then
45- echo "(okay)"
46+ echo "PASS: $test"
47 else
48- echo "(failed)"
49+ echo "FAIL: $test"
50 result=false
51 fi
52 echo "=========="
Andrew Geissler5f350902021-07-23 13:09:54 -040053--
542.17.1