From f373df968282997f5e950d9411e4414caeb7b5c8 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 11 Apr 2020 18:59:24 +0900 Subject: [PATCH] Test cache eviction --- test/integration-test-main.sh | 12 ++++++++++++ test/small-integration-test.sh | 1 + 2 files changed, 13 insertions(+) diff --git a/test/integration-test-main.sh b/test/integration-test-main.sh index 58e5f11..65f89bd 100755 --- a/test/integration-test-main.sh +++ b/test/integration-test-main.sh @@ -734,6 +734,17 @@ function test_content_type() { 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 { if `ps -ef | grep -v grep | grep s3fs | grep -q ensure_diskfree` && ! `uname | grep -q Darwin`; then add_tests test_clean_up_cache @@ -770,6 +781,7 @@ function add_all_tests { add_tests test_open_second_fd add_tests test_write_multiple_offsets add_tests test_content_type + add_tests test_truncate_cache } init_suite diff --git a/test/small-integration-test.sh b/test/small-integration-test.sh index e5b085a..4829475 100755 --- a/test/small-integration-test.sh +++ b/test/small-integration-test.sh @@ -39,6 +39,7 @@ FLAGS=( "use_cache=${CACHE_DIR} -o ensure_diskfree=${ENSURE_DISKFREE_SIZE}" enable_content_md5 enable_noobj_cache + max_stat_cache_size=100 nocopyapi nomultipart notsup_compat_dir