summaryrefslogtreecommitdiffstats
path: root/source3/script
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2013-06-28 03:30:06 +0200
committerJim McDonough <jmcd@samba.org>2013-11-05 08:42:40 -0500
commitd07d89a11e21e51ec92a1743fb7e54a823ce4453 (patch)
tree3150bfe98900b9a4e005d027467f0efe2970f9d5 /source3/script
parent1624382c98aa563ff1b44da66c31a2867949d129 (diff)
downloadsamba-d07d89a11e21e51ec92a1743fb7e54a823ce4453.tar.gz
samba-d07d89a11e21e51ec92a1743fb7e54a823ce4453.tar.xz
samba-d07d89a11e21e51ec92a1743fb7e54a823ce4453.zip
test_smbclient_tarmode.pl: add nested dirs test
add a test to check that the backup handles nested directories. Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3/script')
-rwxr-xr-xsource3/script/tests/test_smbclient_tarmode.pl13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl
index b8143e357f6..fe6e7a2f4ec 100755
--- a/source3/script/tests/test_smbclient_tarmode.pl
+++ b/source3/script/tests/test_smbclient_tarmode.pl
@@ -103,7 +103,8 @@ my $TAR = "$TMP/tarmode.tar";
# RUN TESTS
run_test(
- [\&test_creation_normal],
+ [\&test_creation_normal, 'normal'],
+ [\&test_creation_normal, 'nested'],
[\&test_creation_incremental, '-g'],
[\&test_creation_incremental, 'tarmode inc'],
[\&test_creation_reset, '-a'],
@@ -180,13 +181,15 @@ sub test_creation_reset {
}
sub test_creation_normal {
+ my ($mode) = @_;
- say "TEST: creation -- normal files (no attributes)";
+ say "TEST: creation -- normal files $mode (no attributes)";
+ my $prefix = ($mode =~ /nest/) ? "/foo/bar/bar/" : '';
my @files;
my $n = 5;
for(1..$n) {
- my $f = File->new_remote("file-$_");
+ my $f = File->new_remote($prefix."file-$_");
$f->set_attr();
push @files, $f;
}
@@ -195,7 +198,6 @@ sub test_creation_normal {
return check_tar($TAR, \@files);
}
-
sub test_creation_incremental {
my ($mode) = @_;
@@ -425,7 +427,7 @@ sub remotepath {
return undef if !$s->{remote};
if($s->{dir}) {
- $main::DIR.'/'.$s->{dir}.'/'.$s->{name};
+ $main::DIR.'/'.$s->{dir}.$s->{name};
} else {
$main::DIR.'/'.$s->{name};
}
@@ -508,6 +510,7 @@ sub new_remote {
my ($file, $dir) = fileparse($path);
$dir = '' if $dir eq './';
+ $dir =~ s{^/}{};
my $loc = $main::LOCALPATH.'/'.$main::DIR.'/'.$dir;
make_path($loc);