2015-03-09 17:33:47 +00:00
|
|
|
#!/bin/bash
|
2020-08-22 12:40:53 +00:00
|
|
|
#
|
|
|
|
# s3fs - FUSE-based file system backed by Amazon S3
|
|
|
|
#
|
|
|
|
# Copyright 2007-2008 Randy Rizun <rrizun@gmail.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
2015-03-09 17:33:47 +00:00
|
|
|
|
2015-09-11 08:25:37 +00:00
|
|
|
#
|
2016-02-05 12:24:13 +00:00
|
|
|
# Test s3fs-fuse file system operations with
|
2015-09-11 08:25:37 +00:00
|
|
|
#
|
|
|
|
|
2015-03-09 17:33:47 +00:00
|
|
|
set -o errexit
|
2019-07-03 05:31:48 +00:00
|
|
|
set -o pipefail
|
2010-11-13 23:59:23 +00:00
|
|
|
|
|
|
|
# Require root
|
|
|
|
REQUIRE_ROOT=require-root.sh
|
2015-01-12 22:46:24 +00:00
|
|
|
#source $REQUIRE_ROOT
|
2015-03-09 17:33:47 +00:00
|
|
|
|
2016-02-05 12:24:13 +00:00
|
|
|
source integration-test-common.sh
|
2015-03-09 17:33:47 +00:00
|
|
|
|
2019-06-12 23:35:26 +00:00
|
|
|
CACHE_DIR="/tmp/s3fs-cache"
|
|
|
|
rm -rf "${CACHE_DIR}"
|
|
|
|
mkdir "${CACHE_DIR}"
|
|
|
|
|
2019-09-07 06:23:05 +00:00
|
|
|
#reserve 200MB for data cache
|
|
|
|
source test-utils.sh
|
|
|
|
CACHE_DISK_AVAIL_SIZE=`get_disk_avail_size $CACHE_DIR`
|
2020-02-04 14:00:47 +00:00
|
|
|
if [ `uname` = "Darwin" ]; then
|
|
|
|
# [FIXME]
|
|
|
|
# Only on MacOS, there are cases where process or system
|
|
|
|
# other than the s3fs cache uses disk space.
|
|
|
|
# We can imagine that this is caused by Timemachine, but
|
|
|
|
# there is no workaround, so s3fs cache size is set +1gb
|
|
|
|
# for error bypass.
|
|
|
|
#
|
|
|
|
ENSURE_DISKFREE_SIZE=$((CACHE_DISK_AVAIL_SIZE - 1200))
|
|
|
|
else
|
|
|
|
ENSURE_DISKFREE_SIZE=$((CACHE_DISK_AVAIL_SIZE - 200))
|
|
|
|
fi
|
2019-09-07 06:23:05 +00:00
|
|
|
|
|
|
|
export CACHE_DIR
|
|
|
|
export ENSURE_DISKFREE_SIZE
|
2019-06-12 23:35:26 +00:00
|
|
|
FLAGS=(
|
2019-09-07 06:23:05 +00:00
|
|
|
"use_cache=${CACHE_DIR} -o ensure_diskfree=${ENSURE_DISKFREE_SIZE}"
|
2019-06-12 23:35:26 +00:00
|
|
|
enable_content_md5
|
2019-08-01 19:39:11 +00:00
|
|
|
enable_noobj_cache
|
2020-04-11 09:59:24 +00:00
|
|
|
max_stat_cache_size=100
|
2019-06-12 23:35:26 +00:00
|
|
|
nocopyapi
|
|
|
|
nomultipart
|
|
|
|
notsup_compat_dir
|
|
|
|
sigv2
|
|
|
|
singlepart_copy_limit=$((10 * 1024)) # limit size to exercise multipart code paths
|
|
|
|
#use_sse # TODO: S3Proxy does not support SSE
|
|
|
|
)
|
|
|
|
|
2016-02-05 12:24:13 +00:00
|
|
|
start_s3proxy
|
2010-11-13 23:59:23 +00:00
|
|
|
|
2019-09-07 06:23:05 +00:00
|
|
|
for flag in "${FLAGS[@]}"; do
|
2019-06-12 23:35:26 +00:00
|
|
|
echo "testing s3fs flag: $flag"
|
|
|
|
|
|
|
|
start_s3fs -o $flag
|
|
|
|
|
|
|
|
./integration-test-main.sh
|
|
|
|
|
|
|
|
stop_s3fs
|
|
|
|
done
|
2010-12-20 05:26:27 +00:00
|
|
|
|
2019-06-12 23:35:26 +00:00
|
|
|
stop_s3proxy
|
2015-02-24 13:17:59 +00:00
|
|
|
|
2016-02-05 12:24:13 +00:00
|
|
|
echo "$0: tests complete."
|
2020-08-22 12:40:53 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Local variables:
|
|
|
|
# tab-width: 4
|
|
|
|
# c-basic-offset: 4
|
|
|
|
# End:
|
|
|
|
# vim600: noet sw=4 ts=4 fdm=marker
|
|
|
|
# vim<600: noet sw=4 ts=4
|
|
|
|
#
|