File: do-test

package info (click to toggle)
oldsys-preseed 3.23
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 532 kB
  • sloc: xml: 438; sh: 304; makefile: 4
file content (31 lines) | stat: -rwxr-xr-x 419 bytes parent folder | download
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
#!/bin/bash

. ../functions

[ "$TEST_VERBOSE" ] || TEST_VERBOSE=0
log() {
	if [ $TEST_VERBOSE -gt 1 ]; then
		echo "$@" 1>&2
	fi
}

NONINTERACTIVE="yes"

test="$1"
DIR=$PWD
TEST_DIR=$PWD/$(dirname "$test")
tmp=$(mktemp)
unset HOSTNAME
. $test.test "$tmp"
cd $DIR
if $(cmp -s $test.preseed $tmp); then
	rm -f $tmp
	exit 0
else
	if [ $TEST_VERBOSE ]; then
		diff -urN $test.preseed $tmp 1>&2
	fi
	rm -f $tmp
	exit 1
fi