summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-11-30 17:19:29 +0000
committerKarolin Seeger <kseeger@samba.org>2020-12-02 13:14:22 +0000
commit2954051aa6db3b38d24801fe451019ccec0b5c77 (patch)
tree120af953a2165913c31e48f11c5a771e7e18171c /source3
parent5f1772d94a34922a4fc83ff8a036cbb3ce2dcdd5 (diff)
downloadsamba-2954051aa6db3b38d24801fe451019ccec0b5c77.tar.gz
s3/script/tests: Ensure all remote test files are removed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14581 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> (cherry picked from commit 16ffa17ee28edfc3bc70c66abf41b5518aeab8fe)
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/script/tests/test_smbclient_tarmode.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl
index c0c35b93732..bdbbd1a44a8 100755
--- a/source3/script/tests/test_smbclient_tarmode.pl
+++ b/source3/script/tests/test_smbclient_tarmode.pl
@@ -921,7 +921,22 @@ Remove all files in the server C<$DIR> (not root)
sub reset_remote {
# remove_tree($LOCALPATH . '/'. $DIR);
# make_path($LOCALPATH . '/'. $DIR);
+ my $DIR;
+ my @names;
+ my $name;
+
smb_client_cmd(0, '-c', "deltree ./*");
+
+ # Ensure all files are gone.
+
+ opendir(DIR,$LOCALPATH) or die "Can't open $LOCALPATH\n";
+ @names = readdir(DIR) or die "Unable to read $LOCALPATH\n";
+ closedir(DIR);
+ foreach $name (@names) {
+ next if ($name eq "."); # skip the current directory entry
+ next if ($name eq ".."); # skip the parent directory entry
+ die "$LOCALPATH not empty\n";
+ }
}
=head3 C<reset_tmp( )>