blob: fa6bb84df3021fed1558e375d6e4785d240e7352 [file] [log] [blame]
Patrick Williams864cc432023-02-09 14:54:44 -06001From a6bb2ac5f521c678abbbdb1960d28f750f4357a6 Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Mon, 3 Feb 2020 17:33:11 +0800
4Subject: [PATCH] Tweak tests of ifupdown to make it work with oe-core ptest
5 framework.
Andrew Geissler82c905d2020-04-13 13:39:40 -05006
7Upstream-Status: Inappropriate [oe-core specific]
8
9Signed-off-by: Kai Kang <kai.kang@windriver.com>
Patrick Williams864cc432023-02-09 14:54:44 -060010
Andrew Geissler5f350902021-07-23 13:09:54 -040011---
12 tests/testbuild-linux | 11 ++++++-----
13 1 file changed, 6 insertions(+), 5 deletions(-)
Andrew Geissler82c905d2020-04-13 13:39:40 -050014
15diff --git a/tests/testbuild-linux b/tests/testbuild-linux
Patrick Williams864cc432023-02-09 14:54:44 -060016index 2c69856..05f0703 100755
Andrew Geissler82c905d2020-04-13 13:39:40 -050017--- a/tests/testbuild-linux
18+++ b/tests/testbuild-linux
19@@ -1,6 +1,7 @@
20 #!/bin/sh -e
21
22-dir=tests/linux
23+curdir=$(dirname `readlink -f $0`)
24+dir=$curdir/linux
25
26 result=true
Patrick Williams864cc432023-02-09 14:54:44 -060027 for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do
28@@ -12,7 +13,7 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050029 echo "Testcase $test: $args"
30
31 exitcode=0
32- ./ifup -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
33+ ifup -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
34 >$dir/up-res-out.$test 2>$dir/up-res-err.$test || exitcode=$?
35
36 (echo "exit code: $exitcode";
Patrick Williams864cc432023-02-09 14:54:44 -060037@@ -20,7 +21,7 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050038 echo "====stderr===="; cat $dir/up-res-err.$test) > $dir/up-res.$test
39
40 exitcode=0
41- ./ifdown -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
42+ ifdown -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
43 >$dir/down-res-out.$test 2>$dir/down-res-err.$test || exitcode=$?
44
45 (echo "exit code: $exitcode";
Patrick Williams864cc432023-02-09 14:54:44 -060046@@ -28,9 +29,9 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do
Andrew Geissler82c905d2020-04-13 13:39:40 -050047 echo "====stderr===="; cat $dir/down-res-err.$test) > $dir/down-res.$test
48
49 if diff -ub $dir/up.$test $dir/up-res.$test && diff -ub $dir/down.$test $dir/down-res.$test; then
50- echo "(okay)"
51+ echo "PASS: $test"
52 else
53- echo "(failed)"
54+ echo "FAIL: $test"
55 result=false
56 fi
57 echo "=========="