Skip to content

Commit fdd700b

Browse files
committed
t: add content ENOSPC tests
Problem: There are no tests for when space runs out on disk. Add some initial tests in the new t0090-content-enospc.t.
1 parent a70850f commit fdd700b

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

t/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ TESTSCRIPTS = \
9595
t0022-jj-reader.t \
9696
t0023-jobspec1-validate.t \
9797
t0026-flux-R.t \
98+
t0090-content-enospc.t \
9899
t1000-kvs.t \
99100
t1001-kvs-internals.t \
100101
t1003-kvs-stress.t \

t/t0090-content-enospc.t

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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

Comments
 (0)