File: 006perm.t

package info (click to toggle)
libsysadm-install-perl 0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 336 kB
  • sloc: perl: 734; makefile: 11
file content (30 lines) | stat: -rw-r--r-- 740 bytes parent folder | download | duplicates (5)
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
#############################################
# Tests for Sysadm::Install/s plough
#############################################

use Test::More tests => 2;

use Sysadm::Install qw(:all);

use File::Spec;
use File::Path;

my $TEST_DIR = ".";
$TEST_DIR = "t" if -d 't';

ok(1, "loading ok");

my $testfile = "";

SKIP: {
  skip "Executable file perms not supported on Win32", 1 if $^O eq "MSWin32";
  $testfile = File::Spec->catfile($TEST_DIR, "test_file");
  blurt("waaaah!", $testfile);
  END { unlink $testfile, "${testfile}_2" }; 

  chmod(0755, $testfile) or die "Cannot chmod";
  cp($testfile, "${testfile}_2");
  Sysadm::Install::perm_cp($testfile, "${testfile}_2");
  
  ok(-x "${testfile}_2", "copied file has same permissions");
}