File: 10-policy.t

package info (click to toggle)
slice 1.3.8-12
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 864 kB
  • ctags: 452
  • sloc: ansic: 3,310; perl: 2,263; sh: 869; makefile: 296; yacc: 127
file content (38 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download | duplicates (9)
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

require "TEST.pl";
TEST::init();

print "1..9\n";

$tmpfile1 = TEST::tmpfile(<<'EOT');
foo
bar
EOT

$tmpfile2 = TEST::tmpfile(<<'EOT');
foo
bar
EOT

$rc = TEST::system("$ENV{SLICE} -o EN+UNDEF:test.u1 -o A*+UNDEF:test.w1 $tmpfile1");
print ($rc == 0 ? "ok\n" : "not ok\n");
$rc = TEST::system("cmp $tmpfile2 test.u1");
print ($rc == 0 ? "ok\n" : "not ok\n");
$rc = TEST::system("cmp $tmpfile2 test.w1");
print ($rc == 0 ? "ok\n" : "not ok\n");

$rc = TEST::system("$ENV{SLICE} -o EN+UNDEF:test.u2#u2 -o A*+UNDEF:test.w2#w2 $tmpfile1 2>/dev/null");
print ($rc == 0 ? "ok\n" : "not ok\n");
print (! -f 'test.u2' ? "ok\n" : "not ok\n");
print (! -f 'test.w2' ? "ok\n" : "not ok\n");

$rc = TEST::system("$ENV{SLICE} -o EN+UNDEF:test.u3#u3 -o A*+UNDEF:test.w3#w3 $tmpfile1 2>/dev/null");
print ($rc == 256 ? "ok\n" : "not ok\n");
print (! -f 'test.u3' ? "ok\n" : "not ok\n");
print (! -f 'test.w3' ? "ok\n" : "not ok\n");

push(@TEST::TMPFILES, 'test.u1', 'test.u2', 'test.u3');
push(@TEST::TMPFILES, 'test.w1', 'test.w2', 'test.w3');

TEST::cleanup();