Merge pull request #1407 from gaul/pid

Rework s3fs pid handling
This commit is contained in:
Takeshi Nakatani 2020-09-20 12:32:32 +09:00 committed by GitHub
commit f8b5c911ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -225,9 +225,12 @@ function start_s3fs {
-o dbglevel=${DBGLEVEL:=info} \ -o dbglevel=${DBGLEVEL:=info} \
-o retries=3 \ -o retries=3 \
-f \ -f \
"${@}" | stdbuf -oL -eL sed $SED_BUFFER_FLAG "s/^/s3fs: /" & "${@}" &
S3FS_PID=$! echo $! >&3
) ) 3>pid | stdbuf -oL -eL sed $SED_BUFFER_FLAG "s/^/s3fs: /" &
sleep 1
export S3FS_PID=$(<pid)
rm -f pid
if [ `uname` = "Darwin" ]; then if [ `uname` = "Darwin" ]; then
set +o errexit set +o errexit

View File

@ -318,8 +318,8 @@ function test_external_directory_creation {
describe "Test external directory creation ..." describe "Test external directory creation ..."
OBJECT_NAME="$(basename $PWD)/directory/${TEST_TEXT_FILE}" OBJECT_NAME="$(basename $PWD)/directory/${TEST_TEXT_FILE}"
echo "data" | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${OBJECT_NAME}" echo "data" | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${OBJECT_NAME}"
ls | grep directory ls | grep -q directory
get_permissions directory | grep ^750$ get_permissions directory | grep -q 750$
ls directory ls directory
cmp <(echo "data") directory/${TEST_TEXT_FILE} cmp <(echo "data") directory/${TEST_TEXT_FILE}
rm -f directory/${TEST_TEXT_FILE} rm -f directory/${TEST_TEXT_FILE}
@ -1045,7 +1045,7 @@ function test_ut_ossfs {
} }
function add_all_tests { function add_all_tests {
if `ps -ef | grep -v grep | grep s3fs | grep -q use_cache`; then if ps u $S3FS_PID | grep -q use_cache; then
add_tests test_cache_file_stat add_tests test_cache_file_stat
fi fi
if ! ps u $S3FS_PID | grep -q ensure_diskfree && ! uname | grep -q Darwin; then if ! ps u $S3FS_PID | grep -q ensure_diskfree && ! uname | grep -q Darwin; then