summaryrefslogtreecommitdiff
path: root/test/bbackupd/testfiles/extcheck2.pl.in
blob: 02c258f8e3e8568a5d1882a1dd65e6ab37a9ef9d (plain)
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
46
47
48
49
50
51
52
53
#!@PERL@
use strict;

use File::Spec;

my $flags = $ARGV[0] or "";
my $bbackupquery = File::Spec->catfile('..', '..', 'bin', 'bbackupquery', 'bbackupquery');

unless(open IN, "$bbackupquery -Wwarning " .
	"-c testfiles/bbackupd.conf " .
	"-l testfiles/query4.log " .
	"\"compare -ac$flags\" quit 2>&1 |")
{
	print "Couldn't open compare utility\n";
	exit 2;
}

my $ret = 1;

while(<IN>)
{
	next unless m/\S/;
	print "READ: $_";

	if (m/continousupdate/)
	{
		unless (m/contents/ or m/attributes/)
		{
			print "FAIL: continuousupdate line does not match\n";
			$ret = 2;
		}
	}
	elsif (m/^No entry for terminal type/ or
		m/^using dumb terminal settings/)
	{
		# skip these lines, may happen in Debian buildd
		# with no terminal.
	}
	else
	{
		unless (/\AWARNING/ or /\ADifferences/ or /might be reason/ 
			or /probably due to file mod/)
		{
			print "FAIL: summary line does not match\n";
			$ret = 2;
		}
	}
}

close IN;

exit $ret;