From a9bd9a143e6f76dcef011399433b7b779f1ed2e5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 4 Apr 2017 11:07:36 +0200 Subject: [PATCH] s3:tests: Create a test directory for a clean test The test fails on openSUSE Tumbleweed with: NT_STATUS_FILE_IS_A_DIRECTORY opening remote file \foo\bar\testfile This cleans up the code to create a directory 'test' which can be completely removed so nothing will stay behind. It also makes sure that all parent directories are created and the files have some content. https://bugzilla.samba.org/show_bug.cgi?id=12721 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sat Apr 8 12:29:19 CEST 2017 on sn-devel-144 --- source3/script/tests/test_smbclient_s3.sh | 33 +++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 9bff883f63f..a7bffcbd632 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -1100,29 +1100,26 @@ EOF test_nosymlinks() { # Setup test dirs. - slink_name="$LOCAL_PATH/nosymlinks/source" - slink_target="$LOCAL_PATH/nosymlinks/target" - mkdir_target="$LOCAL_PATH/nosymlinks/a" - dir1="$LOCAL_PATH/nosymlinks/foo" - dir2="$LOCAL_PATH/nosymlinks/foo/bar" - get_target="$LOCAL_PATH/nosymlinks/foo/bar/testfile" + test_dir="$LOCAL_PATH/nosymlinks/test" - rm -f $slink_target - rm -f $slink_name - rm -rf $mkdir_target - rm -rf $dir1 + slink_name="$test_dir/source" + slink_target="$test_dir/target" + foobar_dir="$test_dir/foo/bar" + get_target="$test_dir/foo/bar/testfile" - touch $slink_target + rm -rf $test_dir + + mkdir -p $test_dir + echo "$slink_target" > $slink_target ln -s $slink_target $slink_name - mkdir $dir1 - mkdir $dir2 - touch $get_target + mkdir -p $foobar_dir + echo "$get_target" > $get_target # Getting a file through a symlink name should fail. tmpfile=$PREFIX/smbclient_interactive_prompt_commands cat > $tmpfile < $tmpfile < $tmpfile <