7 use Test
::More tests
=>2;
9 my $builddir = $ENV{BUILD
};
11 $builddir = dirname
($0)."/..";
16 my $prdbfile = "/tmp/prdbtest.$$";
18 my $instructions = <<EOF;
19 admin 128/20 1 -204 -204
20 system:administrators 130/20 -204 -204 -204
25 admin 128/20 1 -204 -204
26 anonymous 128/20 32766 -204 -204
27 system:backup 2/0 -205 -204 -204
28 system:administrators 130/20 -204 -204 -204
30 system:ptsviewers 2/0 -203 -204 -204
31 system:authuser 2/0 -102 -204 -204
32 system:anyuser 2/0 -101 -204 -204
37 open $fh, '|-', "$builddir/src/ptserver/pt_util", '-w', '-p', $prdbfile
38 or die "Failed to start pt_util for DB creation\n";
39 print $fh $instructions;
41 or die "pt util failed while creating DB\n";
43 open $fh, '-|', "$builddir/src/ptserver/pt_util", '-p', $prdbfile,
44 '-user', '-group', '-members'
45 or die "Failed to start pt_util for DB reading\n";
47 my $output = join('', readline($fh));
49 or die "pt_util failed while reading from DB\n";
50 is
($output, $expected, "pt_util produced expected output");
51 ok
(1, "Completed sucessfully");