summaryrefslogtreecommitdiffstats
path: root/source3/script
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2013-07-24 16:49:06 +0200
committerJim McDonough <jmcd@samba.org>2013-11-05 08:42:42 -0500
commit0ebc84ad6daafb5ceb73553e5c569d26274a41fb (patch)
tree9d0ed51673e9402ffcffba5a7d84e4b4b1beab09 /source3/script
parente236d5df132842974b2e8b5b244aa0896dcc56cf (diff)
downloadsamba-0ebc84ad6daafb5ceb73553e5c569d26274a41fb.tar.gz
samba-0ebc84ad6daafb5ceb73553e5c569d26274a41fb.tar.xz
samba-0ebc84ad6daafb5ceb73553e5c569d26274a41fb.zip
test_smbclient_tarmode.pl: add test for interactive session
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.pl49
1 files changed, 29 insertions, 20 deletions
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl
index 5903125472f..ffe7c1e991b 100755
--- a/source3/script/tests/test_smbclient_tarmode.pl
+++ b/source3/script/tests/test_smbclient_tarmode.pl
@@ -23,26 +23,6 @@ C<test_smbclient_tarmode.pl> - Test for smbclient tar backup feature
=cut
-# flags to test
-
-# c DONE
-# c g DONE
-# c a DONE
-# c N DONE
-# c I DONE
-# c I r DONE
-# c X DONE
-# c X r DONE
-# c F DONE
-# c F r DONE
-# x DONE
-# x I DONE
-# x I r DONE
-# x X DONE
-# x X r DONE
-# x F DONE
-# x F r DONE
-
use v5.14;
use strict;
use warnings;
@@ -101,6 +81,7 @@ my @TESTS = (
['create, include w/ filelist (F)', \&test_creation_list],
['create, wildcard simple', \&test_creation_wildcard_simple],
['create, regex', \&test_creation_regex],
+ ['create, multiple backup in session', \&test_creation_multiple],
['extract, normal files', \&test_extraction_normal],
['extract, explicit include', \&test_extraction_include],
['extract, explicit exclude', \&test_extraction_exclude],
@@ -613,6 +594,28 @@ sub test_helper {
return 0;
}
+sub test_creation_multiple {
+ my @exts = qw(jpg exe);
+ my @dirs = ('', "$DIR/");
+ my @all = make_env(\@exts, \@dirs);
+ my $nb;
+ my @inc;
+ my $err = 0;
+
+ my ($tarA, $tarB) = ("$TMP/a.tar", "$TMP/b.tar");
+ my @incA = grep { $_->remotepath =~ m{^[^/]+exe$} } @all;
+ my @incB = grep { $_->remotepath =~ m{^[^/]+jpg$} } @all;
+
+ my $flistA = File->new_local("$TMP/listA", file_list(@incA))->localpath;
+ my $flistB = File->new_local("$TMP/listB", file_list(@incB))->localpath;
+
+ smb_tar("tar cF $tarA $flistA ; tar cF $tarB $flistB ; quit");
+ $err += check_tar($tarA, \@incA);
+ $err += check_tar($tarB, \@incB);
+
+ $err;
+}
+
sub test_extraction_regex {
my @exts = qw(txt jpg exe);
my @dirs = ('', "$DIR/", "$DIR/dir/");
@@ -985,6 +988,12 @@ sub check_tar {
my %h;
+
+ if (!-f $tar) {
+ say "no tar file $tar";
+ return 1;
+ }
+
for (@$files) {
$h{$_->tarpath} = $_;
$done{$_->tarpath} = 0;