Skip to content

Commit 8bd9d7a

Browse files
committed
t: cover flux-dump --async option
Problem: There is no coverage for the new flux-dump --async option. Add coverage in t2807-dump-cmd.t.
1 parent db0da17 commit 8bd9d7a

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

t/t2807-dump-cmd.t

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ test_expect_success 'unload kvs' '
5858
test_expect_success 'dump default=kvs-primary checkpoint' '
5959
flux dump --checkpoint foo.tar
6060
'
61+
test_expect_success 'repeat dump with --fast' '
62+
flux dump --fast --checkpoint fast.tar
63+
'
6164
test_expect_success 'repeat dump with -q' '
6265
flux dump -q --checkpoint foo.tar
6366
'
@@ -199,6 +202,52 @@ test_expect_success 'run a flux instance, preserving content.sqlite' '
199202
flux start -Sstatedir=$(pwd)/test true
200203
'
201204

205+
#
206+
# --fast
207+
#
208+
209+
# N.B. from previous tests, data is already in the content cache
210+
# and does not "need" to be flushed, thus affects tests below
211+
test_expect_success 'clear content cache' '
212+
flux content dropcache
213+
'
214+
test_expect_success 'remove backing file and load content-sqlite' '
215+
rm -f content.sqlite &&
216+
flux module load content-sqlite
217+
'
218+
test_expect_success 'restore content when --fast was used' '
219+
flux restore -v --checkpoint fast.tar
220+
'
221+
test_expect_success 'unload content-sqlite' '
222+
flux content flush &&
223+
flux content dropcache &&
224+
flux module remove content-sqlite
225+
'
226+
# N.B. see notes above on why 4 blobs
227+
test_expect_success 'count blobs after restore'\'s' implicit garbage collection' '
228+
echo 4 >blobcount3.exp &&
229+
countblobs >blobcount3.out &&
230+
test_cmp blobcount3.exp blobcount3.out
231+
'
232+
test_expect_success 'load content-sqlite + kvs and list content' '
233+
flux module load content-sqlite &&
234+
flux module load kvs &&
235+
flux kvs dir -R
236+
'
237+
test_expect_success 'verify that exact KVS content was restored' '
238+
test $(flux kvs get a.b.c) = "testkey" &&
239+
test $(flux kvs get x) = $(cat x.val) &&
240+
test $(flux kvs readlink y) = "linkedthing" &&
241+
test $(flux kvs readlink z) = "smurf::otherthing" &&
242+
test $(flux kvs get w) = "foobar"
243+
'
244+
test_expect_success 'unload kvs' '
245+
flux module remove kvs
246+
'
247+
test_expect_success 'unload content-sqlite' '
248+
flux module remove content-sqlite
249+
'
250+
202251
reader() {
203252
local dbdir=$1
204253
flux start -Sbroker.rc1_path= \
@@ -279,6 +328,9 @@ test_expect_success LONGTEST 'unload kvs' '
279328
test_expect_success LONGTEST 'dump default=kvs-primary checkpoint' '
280329
flux dump --checkpoint bigval.tar
281330
'
331+
test_expect_success LONGTEST 'dump default=kvs-primary checkpoint w/ --fast' '
332+
flux dump --checkpoint --fast bigvalfast.tar
333+
'
282334
test_expect_success LONGTEST 'unload content-sqlite, remove backing, reload content-sqlite' '
283335
flux module remove content-sqlite &&
284336
rm -f content.sqlite &&
@@ -295,6 +347,22 @@ test_expect_success LONGTEST 'load kvs and check bigval value' '
295347
test_expect_success LONGTEST 'unload kvs' '
296348
flux module remove kvs
297349
'
350+
test_expect_success LONGTEST 'unload content-sqlite, remove backing, reload content-sqlite' '
351+
flux module remove content-sqlite &&
352+
rm -f content.sqlite &&
353+
flux module load content-sqlite
354+
'
355+
test_expect_success LONGTEST 'restore content from fast dump' '
356+
flux restore --checkpoint bigvalfast.tar
357+
'
358+
test_expect_success LONGTEST 'load kvs and check bigval value from fast dump' '
359+
flux module load kvs &&
360+
flux kvs get bigval > bigval.out &&
361+
test_cmp bigval.out bigval.exp
362+
'
363+
test_expect_success LONGTEST 'unload kvs' '
364+
flux module remove kvs
365+
'
298366
test_expect_success LONGTEST 'unload content-sqlite' '
299367
flux module remove content-sqlite
300368
'

0 commit comments

Comments
 (0)