Merge pull request #1266 from gaul/test/cache-eviction

Test cache eviction
This commit is contained in:
Takeshi Nakatani 2020-04-14 22:30:04 +09:00 committed by GitHub
commit 538fbed302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -734,6 +734,17 @@ function test_content_type() {
fi fi
} }
# create more files than -o max_stat_cache_size
function test_truncate_cache() {
for dir in $(seq 2); do
mkdir $dir
for file in $(seq 75); do
touch $dir/$file
done
ls $dir
done
}
function add_all_tests { function add_all_tests {
if `ps -ef | grep -v grep | grep s3fs | grep -q ensure_diskfree` && ! `uname | grep -q Darwin`; then if `ps -ef | grep -v grep | grep s3fs | grep -q ensure_diskfree` && ! `uname | grep -q Darwin`; then
add_tests test_clean_up_cache add_tests test_clean_up_cache
@ -770,6 +781,7 @@ function add_all_tests {
add_tests test_open_second_fd add_tests test_open_second_fd
add_tests test_write_multiple_offsets add_tests test_write_multiple_offsets
add_tests test_content_type add_tests test_content_type
add_tests test_truncate_cache
} }
init_suite init_suite

View File

@ -39,6 +39,7 @@ FLAGS=(
"use_cache=${CACHE_DIR} -o ensure_diskfree=${ENSURE_DISKFREE_SIZE}" "use_cache=${CACHE_DIR} -o ensure_diskfree=${ENSURE_DISKFREE_SIZE}"
enable_content_md5 enable_content_md5
enable_noobj_cache enable_noobj_cache
max_stat_cache_size=100
nocopyapi nocopyapi
nomultipart nomultipart
notsup_compat_dir notsup_compat_dir