}
run_test 154 "Opening a file by FID"
-test_155_load() {
+test_155_small_load() {
local temp=$TMP/$tfile
local file=$DIR/$tfile
- local list=$(comma_list $(osts_nodes))
- local big=$(do_nodes $list grep "cache" /proc/cpuinfo | \
- awk '{sum+=$4} END{print sum}')
- local min_avail=$(lctl get_param -n osc.*[oO][sS][cC]-[^M]*.kbytesavail | \
- sort -n | head -1)
- local large_file_size=$((big * 2))
-
- log "cache size on OSS is $big KB"
- log "large file size is $large_file_size KB"
- log "min available OST size is $min_avail KB"
-
- [ $min_avail -le $large_file_size ] && \
- skip "the minimum available OST size needs > $large_file_size KB" && \
- return 0
dd if=/dev/urandom of=$temp bs=6096 count=1 || \
error "dd of=$temp bs=6096 count=1 failed"
echo "12345" >>$file
cmp $temp $file || error "$temp $file differ (append2)"
+ rm -f $temp $file
+ true
+}
+
+test_155_big_load() {
+ local temp=$TMP/$tfile
+ local file=$DIR/$tfile
+ local list=$(comma_list $(osts_nodes))
+ local big=$(do_nodes $list grep "cache" /proc/cpuinfo | \
+ awk '{sum+=$4} END{print sum}')
+ local min_avail=$(lctl get_param -n osc.*[oO][sS][cC]-[^M]*.kbytesavail | \
+ sort -n | head -1)
+ local large_file_size=$((big * 2))
+
+ log "cache size on OSS is $big KB"
+ log "large file size is $large_file_size KB"
+ log "min available OST size is $min_avail KB"
+
+ [ $min_avail -le $large_file_size ] && \
+ skip "the minimum available OST size needs > $large_file_size KB" && \
+ return 0
+
dd if=/dev/urandom of=$temp bs=$large_file_size count=1k || \
error "dd of=$temp bs=$large_file_size count=1k failed"
cp $temp $file
test_155a() {
set_cache read on
set_cache writethrough on
- test_155_load
+ test_155_small_load
}
-run_test 155a "Verification of correctness: read cache:on write_cache:on"
+run_test 155a "Verify small file correctness: read cache:on write_cache:on"
test_155b() {
set_cache read on
set_cache writethrough off
- test_155_load
+ test_155_small_load
}
-run_test 155b "Verification of correctness: read cache:on write_cache:off"
+run_test 155b "Verify small file correctness: read cache:on write_cache:off"
test_155c() {
set_cache read off
set_cache writethrough on
- test_155_load
+ test_155_small_load
}
-run_test 155c "Verification of correctness: read cache:off write_cache:on"
+run_test 155c "Verify small file correctness: read cache:off write_cache:on"
test_155d() {
set_cache read off
set_cache writethrough off
- test_155_load
+ test_155_small_load
+}
+run_test 155d "Verify small file correctness: read cache:off write_cache:off"
+
+test_155e() {
+ set_cache read on
+ set_cache writethrough on
+ test_155_big_load
+}
+run_test 155e "Verify big file correctness: read cache:on write_cache:on"
+
+test_155f() {
+ set_cache read on
+ set_cache writethrough off
+ test_155_big_load
+}
+run_test 155f "Verify big file correctness: read cache:on write_cache:off"
+
+test_155g() {
+ set_cache read off
+ set_cache writethrough on
+ test_155_big_load
+}
+run_test 155g "Verify big file correctness: read cache:off write_cache:on"
+
+test_155h() {
+ set_cache read off
+ set_cache writethrough off
+ test_155_big_load
}
-run_test 155d "Verification of correctness: read cache:off write_cache:off "
+run_test 155h "Verify big file correctness: read cache:off write_cache:off"
test_156() {
local CPAGES=3