File: testbuild-hurd

package info (click to toggle)
ifupdown 0.8.45
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 952 kB
  • sloc: ansic: 2,779; sh: 899; perl: 513; makefile: 90
file content (44 lines) | stat: -rwxr-xr-x 1,322 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh -e

dir=tests/hurd

# Note: Testcase 7 is not run on GNU/Hurd, tunnel is not yet implemented.
result=true
for test in 1 2 3 4 5 6 11; do
        args="$(cat $dir/testcase.$test | sed -n 's/^# RUN: //p')"

	exitcode=0
        ./ifup -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
                >$dir/up-res-out.$test 2>$dir/up-res-err.$test || exitcode=$?

        (echo "exit code: $exitcode";
	 echo "====stdout===="; cat $dir/up-res-out.$test
         echo "====stderr===="; cat $dir/up-res-err.$test) > $dir/up-res.$test

	exitcode=0
        ./ifdown -v --no-act-commands --force -i $dir/testcase.$test --state-dir=$dir/state.$test $args \
               >$dir/down-res-out.$test 2>$dir/down-res-err.$test || exitcode=$?

        (echo "exit code: $exitcode";
         echo "====stdout===="; cat $dir/down-res-out.$test
         echo "====stderr===="; cat $dir/down-res-err.$test) > $dir/down-res.$test


        echo "Testcase $test: $args"

        if diff -ub $dir/up.$test $dir/up-res.$test; then
                echo "(okay)"
        else
                echo "(failed)"
                result=false
        fi
        echo "=========="
done

if $result; then
        echo "(okay overall)"
        exit 0
else
        echo "(failed overall)"
        exit 1
fi