File: testbuild-linux

package info (click to toggle)
ifupdown 0.8.44
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 952 kB
  • sloc: ansic: 2,781; sh: 899; perl: 513; makefile: 90
file content (45 lines) | stat: -rwxr-xr-x 1,388 bytes parent folder | download | duplicates (4)
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
45
#!/bin/sh -e

dir=tests/linux

result=true
for test in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
	if [ -e $dir/testcase.$test ]; then
		args="$(cat $dir/testcase.$test | sed -n 's/^# RUN: //p')"
	else
		args="-a"
	fi
        echo "Testcase $test: $args"

	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

        if diff -ub $dir/up.$test $dir/up-res.$test && diff -ub $dir/down.$test $dir/down-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