|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +test_description='Test content ENOSPC corner cases' |
| 4 | + |
| 5 | +. `dirname $0`/sharness.sh |
| 6 | + |
| 7 | +if ! ls /test/tmpfs-1m; then |
| 8 | + skip_all='skipping ENOSPC tests, no small tmpfs directory mounted' |
| 9 | + test_done |
| 10 | +fi |
| 11 | + |
| 12 | +test_expect_success 'create script to fill statedir' ' |
| 13 | + cat >fillstatedir.sh <<-EOT && |
| 14 | + #!/bin/sh |
| 15 | + while true ; do |
| 16 | + flux run echo 0123456789 > /dev/null 2>&1 |
| 17 | + if flux dmesg | grep -q "No space left on device"; then |
| 18 | + break |
| 19 | + fi |
| 20 | + done |
| 21 | + EOT |
| 22 | + chmod +x fillstatedir.sh |
| 23 | +' |
| 24 | + |
| 25 | +test_expect_success 'clear & setup test statedir' ' |
| 26 | + rm -rf /test/tmpfs-1m/* && |
| 27 | + mkdir /test/tmpfs-1m/statedir |
| 28 | +' |
| 29 | + |
| 30 | +# rc3 currently hangs under ENOSPC, so disable it. flux start will fail for time being |
| 31 | +test_expect_success 'flux still operates with content-sqlite running out of space' ' |
| 32 | + test_must_fail flux start \ |
| 33 | + -o,-Scontent.backing-module=content-sqlite \ |
| 34 | + -o,-Sstatedir=/test/tmpfs-1m/statedir \ |
| 35 | + -o,-Sbroker.rc3_path= \ |
| 36 | + "./fillstatedir.sh; flux dmesg; flux run echo helloworld" > sql.out 2> sql.err && |
| 37 | + grep -q "No space left on device" sql.out && |
| 38 | + grep "helloworld" sql.out |
| 39 | +' |
| 40 | + |
| 41 | +test_expect_success 'clear & setup test statedir' ' |
| 42 | + rm -rf /test/tmpfs-1m/* && |
| 43 | + mkdir /test/tmpfs-1m/statedir |
| 44 | +' |
| 45 | + |
| 46 | +# rc3 currently hangs under ENOSPC, so disable it. flux start will fail for time being |
| 47 | +test_expect_success 'flux still operates with content-files running out of space' ' |
| 48 | + test_must_fail flux start \ |
| 49 | + -o,-Scontent.backing-module=content-files \ |
| 50 | + -o,-Sstatedir=/test/tmpfs-1m/statedir \ |
| 51 | + -o,-Sbroker.rc3_path= \ |
| 52 | + "./fillstatedir.sh; flux dmesg; flux run echo helloworld" > files.out 2> files.err && |
| 53 | + grep -q "No space left on device" files.out && |
| 54 | + grep "helloworld" files.out |
| 55 | +' |
| 56 | + |
| 57 | +test_done |
0 commit comments