7 plan skip_all
=> 'you need to specify OMD_PACKAGE for this test' unless defined $ENV{'OMD_PACKAGE'};
9 my $file = $ENV{'OMD_PACKAGE'};
10 ok
(-f
$file, "file: $file exists");
13 if($file =~ m/\.deb/gmx) {
14 my $content = `dpkg -c $file 2>&1`;
15 is
($?
, 0, 'got package content');
16 my @files = split("\n", $content);
17 ok
(scalar @files > 0, 'got package '.(scalar @files).' files');
19 my($mode, $usr, $ref, $date, $time, $path) = split(/\s+/mx, $e);
20 next if file_ok
($path);
21 fail
("pkg contains unusual file: $e");
24 elsif($file =~ m/\.rpm/gmx) {
25 my $content = `rpm -qpl $file 2>&1`;
26 is
($?
, 0, 'got package content');
27 my @files = split("\n", $content);
28 ok
(scalar @files > 0, 'got package '.(scalar @files).' files');
31 fail
("pkg contains unusual file: $e");
35 fail
("unsupported pkg: $file");
40 #################################################
44 return 1 if $file =~ m
|/opt/|;
45 return 1 if $file =~ m
|/usr/share
/doc/omd|;
46 return 1 if $file =~ m
|/etc/init
.d
/omd
|;
47 return 1 if $file =~ m
|/usr/share
/man/|;
48 return 1 if $file eq '/';
49 return 1 if $file eq '/etc/';
50 return 1 if $file eq '/etc/init.d/';
51 return 1 if $file eq '/usr/';
52 return 1 if $file eq '/usr/share/';
53 return 1 if $file eq '/usr/share/doc/';