]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/script/tests: call smbclient deltree to remove remote files
authorNoel Power <noel.power@suse.com>
Mon, 30 Nov 2020 10:41:57 +0000 (10:41 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 1 Dec 2020 19:06:45 +0000 (19:06 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14581

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/script/tests/test_smbclient_tarmode.pl

index 7b9e2f938d1d0fc11b97f0834d8dfbfdf09e10fe..c0c35b937326b3f02238111ecdf61c79c78814f4 100755 (executable)
@@ -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<reset_tmp( )>