summaryrefslogtreecommitdiff
path: root/tests/bcache/journal_stress.ktest
blob: 2e950adecbf7cca14d62d0beb521099d6cb65e5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/bcache-test-libs.sh

config-cache 256M,256M
config-tier 256M,256M,256M,256M,256M,256M,256M,256M,256M,256M

config-bucket-size 64k
config-block-size 4k
config-volume 1900M
#config-bcache-sysfs btree_flush_delay 0

config-timeout $(stress_timeout)

test_main()
{
    setup_tracing 'bcache:*'

    setup_bcache
    run_antagonist

    (
	while true; do
	    # Lots of small journal entries
	    echo 0 > /sys/fs/bcache/*/journal_delay_ms
	    sleep 5
	    # Let the journal entries fill up
	    echo 10000 > /sys/fs/bcache/*/journal_delay_ms
	    sleep 5
	done
    ) &

    run_bcache_stress
    stop_bcache
}