From: Jeremy Allison Date: Mon, 30 Nov 2020 17:19:29 +0000 (+0000) Subject: s3/script/tests: Ensure all remote test files are removed X-Git-Tag: samba-4.14.0rc1~518 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16ffa17ee28edfc3bc70c66abf41b5518aeab8fe;p=thirdparty%2Fsamba.git 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 Reviewed-by: Noel Power --- 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