2015-03-09 10:33:47 -07: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 10:33:47 -07:00
|
|
|
|
2015-09-11 01:25:37 -07:00
|
|
|
#
|
2016-02-05 04:24:13 -08:00
|
|
|
# Test s3fs-fuse file system operations with
|
2015-09-11 01:25:37 -07:00
|
|
|
#
|
|
|
|
|
2015-03-09 10:33:47 -07:00
|
|
|
set -o errexit
|
2019-07-02 22:31:48 -07:00
|
|
|
set -o pipefail
|
2010-11-13 23:59:23 +00:00
|
|
|
|
2016-02-05 04:24:13 -08:00
|
|
|
source integration-test-common.sh
|
2015-03-09 10:33:47 -07:00
|
|
|
|
2019-06-12 16:35:26 -07:00
|
|
|
CACHE_DIR="/tmp/s3fs-cache"
|
|
|
|
rm -rf "${CACHE_DIR}"
|
|
|
|
mkdir "${CACHE_DIR}"
|
|
|
|
|
2019-09-07 14:23:05 +08:00
|
|
|
source test-utils.sh
|
2022-01-15 17:08:46 +00:00
|
|
|
|
|
|
|
#reserve 200MB for data cache
|
2021-07-22 05:35:54 +00:00
|
|
|
FAKE_FREE_DISK_SIZE=200
|
|
|
|
ENSURE_DISKFREE_SIZE=10
|
2019-09-07 14:23:05 +08:00
|
|
|
|
2023-07-25 23:31:20 +09:00
|
|
|
# set up client-side encryption keys
|
|
|
|
head -c 32 < /dev/urandom > /tmp/ssekey.bin
|
|
|
|
base64 < /tmp/ssekey.bin > /tmp/ssekey
|
|
|
|
openssl md5 -binary < /tmp/ssekey.bin | base64 > /tmp/ssekeymd5
|
|
|
|
chmod 600 /tmp/ssekey /tmp/ssekey.bin /tmp/ssekeymd5
|
|
|
|
|
2019-09-07 14:23:05 +08:00
|
|
|
export CACHE_DIR
|
|
|
|
export ENSURE_DISKFREE_SIZE
|
2021-07-02 08:41:47 +09:00
|
|
|
if [ -n "${ALL_TESTS}" ]; then
|
|
|
|
FLAGS=(
|
2023-02-12 17:59:40 +09:00
|
|
|
"use_cache=${CACHE_DIR} -o ensure_diskfree=${ENSURE_DISKFREE_SIZE} -o fake_diskfree=${FAKE_FREE_DISK_SIZE} -o use_xattr -o update_parent_dir_stat"
|
2021-07-02 08:41:47 +09:00
|
|
|
enable_content_md5
|
2022-03-12 16:57:31 +09:00
|
|
|
disable_noobj_cache
|
2022-01-15 17:08:46 +00:00
|
|
|
"max_stat_cache_size=100"
|
2021-07-02 08:41:47 +09:00
|
|
|
nocopyapi
|
|
|
|
nomultipart
|
|
|
|
sigv2
|
|
|
|
sigv4
|
2022-01-15 17:08:46 +00:00
|
|
|
"singlepart_copy_limit=10" # limit size to exercise multipart code paths
|
2021-07-02 08:41:47 +09:00
|
|
|
#use_sse # TODO: S3Proxy does not support SSE
|
2023-07-25 23:31:20 +09:00
|
|
|
#use_sse=custom:/tmp/ssekey # TODO: S3Proxy does not support SSE
|
2021-11-02 12:16:48 +00:00
|
|
|
"use_cache=${CACHE_DIR} -o ensure_diskfree=${ENSURE_DISKFREE_SIZE} -o fake_diskfree=${FAKE_FREE_DISK_SIZE} -o streamupload"
|
2021-07-02 08:41:47 +09:00
|
|
|
)
|
|
|
|
else
|
|
|
|
FLAGS=(
|
|
|
|
sigv4
|
|
|
|
)
|
|
|
|
fi
|
2019-06-12 16:35:26 -07:00
|
|
|
|
2016-02-05 04:24:13 -08:00
|
|
|
start_s3proxy
|
2010-11-13 23:59:23 +00:00
|
|
|
|
2022-01-26 23:42:12 +09:00
|
|
|
if ! aws_cli s3api head-bucket --bucket "${TEST_BUCKET_1}" --region "${S3_ENDPOINT}"; then
|
|
|
|
aws_cli s3 mb "s3://${TEST_BUCKET_1}" --region "${S3_ENDPOINT}"
|
|
|
|
fi
|
2022-01-05 01:59:31 +09:00
|
|
|
|
2019-09-07 14:23:05 +08:00
|
|
|
for flag in "${FLAGS[@]}"; do
|
2022-01-15 17:08:46 +00:00
|
|
|
echo "testing s3fs flag: ${flag}"
|
2019-06-12 16:35:26 -07:00
|
|
|
|
2022-01-15 17:08:46 +00:00
|
|
|
# shellcheck disable=SC2086
|
|
|
|
start_s3fs -o ${flag}
|
2019-06-12 16:35:26 -07:00
|
|
|
|
|
|
|
./integration-test-main.sh
|
|
|
|
|
|
|
|
stop_s3fs
|
|
|
|
done
|
2010-12-20 05:26:27 +00:00
|
|
|
|
2019-06-12 16:35:26 -07:00
|
|
|
stop_s3proxy
|
2015-02-24 05:17:59 -08:00
|
|
|
|
2016-02-05 04:24:13 -08:00
|
|
|
echo "$0: tests complete."
|
2020-08-22 12:40:53 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Local variables:
|
|
|
|
# tab-width: 4
|
|
|
|
# c-basic-offset: 4
|
|
|
|
# End:
|
2020-09-15 22:11:14 +09:00
|
|
|
# vim600: expandtab sw=4 ts=4 fdm=marker
|
|
|
|
# vim<600: expandtab sw=4 ts=4
|
2020-08-22 12:40:53 +00:00
|
|
|
#
|