summaryrefslogtreecommitdiffstats
path: root/source3/script
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2013-07-01 17:25:29 +0200
committerJim McDonough <jmcd@samba.org>2013-11-05 08:42:40 -0500
commitf764c39a59551ef5ac849b8f3012a28953c7ee8a (patch)
tree26529d7ad8467edd97b428b2058aaf675b81f8c1 /source3/script
parent3a10b8803a0e2d4238d01926cb9226d5969852a2 (diff)
downloadsamba-f764c39a59551ef5ac849b8f3012a28953c7ee8a.tar.gz
samba-f764c39a59551ef5ac849b8f3012a28953c7ee8a.tar.xz
samba-f764c39a59551ef5ac849b8f3012a28953c7ee8a.zip
test_smbclient_tarmode.pl: add tests for X and I.
Found a bug while doing so. X doesn't exclude file path. 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.pl36
1 files changed, 34 insertions, 2 deletions
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl
index 91c11931607..615d2169a1c 100755
--- a/source3/script/tests/test_smbclient_tarmode.pl
+++ b/source3/script/tests/test_smbclient_tarmode.pl
@@ -12,9 +12,9 @@ test_smbclient_tarmode.pl - Test for smbclient tar backup feature
# c g DONE
# c a DONE
# c N DONE
-# c I #
+# c I DONE
# c I r #
-# c X #
+# c X DONE
# c X r #
# c F #
# c F r #
@@ -139,6 +139,8 @@ my @all_tests = (
[\&test_creation_reset, '-a'],
[\&test_creation_reset, 'tarmode reset'],
[\&test_creation_newer],
+ [\&test_creation_include,],
+ [\&test_creation_exclude,],
[\&test_extraction_normal],
);
@@ -292,6 +294,36 @@ sub test_extraction_normal {
check_remote([values %files]);
}
+sub test_creation_include {
+ say "TEST: extraction -- explicit include";
+
+ my @files;
+
+ for(qw(file_inc inc/b inc/c inc/dir/foo dir_ex/d zob)) {
+ my $f = File->new_remote($_);
+ $f->set_attr();
+ push @files, $f if /inc/;
+ }
+
+ smb_tar('', '-TcI', $TAR, "$DIR/file_inc", "$DIR/inc");
+ return check_tar($TAR, \@files);
+}
+
+sub test_creation_exclude {
+ say "TEST: extraction -- explicit exclude";
+
+ my @files;
+
+ for(qw(file_ex ex/b ex/c ex/dir/foo foo/bar zob)) {
+ my $f = File->new_remote($_);
+ $f->set_attr();
+ push @files, $f if !/ex/;
+ }
+
+ smb_tar('', '-TcX', $TAR, "$DIR/file_ex", "$DIR/ex");
+ return check_tar($TAR, \@files);
+}
+
#####
# IMPLEMENTATION