1From 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.
6
7Upstream-Status: Inappropriate [oe-core specific]
8
9Signed-off-by: Kai Kang <kai.kang@windriver.com>
10
11---
12 tests/testbuild-linux | 11 ++++++-----
13 1 file changed, 6 insertions(+), 5 deletions(-)
14
15diff --git a/tests/testbuild-linux b/tests/testbuild-linux
16index 2c69856..05f0703 100755
17--- 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
27 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
29         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";
37@@ -20,7 +21,7 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do
38          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";
46@@ -28,9 +29,9 @@ for test in 1 2 3 4 5 6 7 8 9 10 11 16 17 18 19; do
47          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 "=========="
58