Merge pull request #1340 from gaul/test/external-directory

Test creating a directory with external program
This commit is contained in:
Takeshi Nakatani 2020-07-26 22:06:40 +09:00 committed by GitHub
commit e5231fa3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -207,6 +207,7 @@ function start_s3fs {
-o retries=3 \
-f \
"${@}" | stdbuf -oL -eL sed $SED_BUFFER_FLAG "s/^/s3fs: /" &
S3FS_PID=$!
)
if [ `uname` = "Darwin" ]; then

View File

@ -303,6 +303,17 @@ function test_remove_nonempty_directory {
rm_test_dir
}
function test_external_directory_creation {
describe "Test external directory creation ..."
OBJECT_NAME="$(basename $PWD)/directory/${TEST_TEXT_FILE}"
echo "data" | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${OBJECT_NAME}"
ls | grep directory
stat --format=%a directory | grep ^750$
ls directory
cmp <(echo "data") directory/${TEST_TEXT_FILE}
rm -f directory/${TEST_TEXT_FILE}
}
function test_external_modification {
describe "Test external modification to an object ..."
echo "old" > ${TEST_TEXT_FILE}
@ -930,7 +941,7 @@ function test_ut_ossfs {
}
function add_all_tests {
if `ps -ef | grep -v grep | grep s3fs | grep -q ensure_diskfree` && ! `uname | grep -q Darwin`; then
if ! ps u $S3FS_PID | grep -q ensure_diskfree && ! uname | grep -q Darwin; then
add_tests test_clean_up_cache
fi
add_tests test_append_file
@ -946,6 +957,10 @@ function add_all_tests {
add_tests test_chown
add_tests test_list
add_tests test_remove_nonempty_directory
if ! ps u $S3FS_PID | grep -q notsup_compat_dir; then
# TODO: investigate why notsup_compat_dir fails
add_tests test_external_directory_creation
fi
add_tests test_external_modification
add_tests test_read_external_object
add_tests test_rename_before_close