From 6c7dc4959fd5de4382aee413b4cc711cc6f281f4 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 30 Nov 2020 10:41:57 +0000 Subject: [PATCH] s3/script/tests: call smbclient deltree to remove remote files BUG: https://bugzilla.samba.org/show_bug.cgi?id=14581 Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- source3/script/tests/test_smbclient_tarmode.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl index 7b9e2f938d1..c0c35b93732 100755 --- a/source3/script/tests/test_smbclient_tarmode.pl +++ b/source3/script/tests/test_smbclient_tarmode.pl @@ -303,6 +303,8 @@ sub test_creation_attr { @inc = grep { $_->attr('a') && !$_->attr_any('h', 's') } @all; smb_tar('tarmode inc nohidden nosystem', '-Tc', $TAR, $DIR); $err += check_tar($TAR, \@inc); + # adjust attr so remote files can be deleted with deltree + File::walk(sub { $_->set_attr(qw/n r s h/) }, File::tree($DIR)); $err; } @@ -398,7 +400,10 @@ sub test_creation_incremental { } else { smb_tar('', '-Tcg', $TAR, $DIR); } - return check_tar($TAR, \@files); + my $res = check_tar($TAR, \@files); + # adjust attr so remote files can be deleted with deltree + File::walk(sub { $_->set_attr(qw/n r s h/) }, File::tree($DIR)); + return $res } @@ -916,7 +921,7 @@ Remove all files in the server C<$DIR> (not root) sub reset_remote { # remove_tree($LOCALPATH . '/'. $DIR); # make_path($LOCALPATH . '/'. $DIR); - remove_tree($LOCALPATH, {keep_root => 1}); + smb_client_cmd(0, '-c', "deltree ./*"); } =head3 C