From 16ffa17ee28edfc3bc70c66abf41b5518aeab8fe Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Nov 2020 17:19:29 +0000 Subject: [PATCH] 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 --- source3/script/tests/test_smbclient_tarmode.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 -- 2.47.3