Skip to content

Commit 6f02cdf

Browse files
committed
t: cover flux-dump --maxreqs option
Problem: There is no coverage for the new flux-dump --maxreqs option. Add coverage in t2807-dump-cmd.t.
1 parent 6ad1c93 commit 6f02cdf

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,12 @@ 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 'dump with invalid input to --maxreqs fails' '
62+
test_must_fail flux dump --maxreqs=0 --checkpoint fail.tar
63+
'
64+
test_expect_success 'repeat dump with --maxreqs' '
65+
flux dump --maxreqs=1000 --checkpoint maxreqs.tar
66+
'
6167
test_expect_success 'repeat dump with -q' '
6268
flux dump -q --checkpoint foo.tar
6369
'
@@ -198,6 +204,51 @@ test_expect_success 'run a flux instance, preserving content.sqlite' '
198204
flux start -Sstatedir=$(pwd)/test true
199205
'
200206

207+
#
208+
# --maxreqs
209+
#
210+
211+
# N.B. from previous tests, data is already in the content cache
212+
# and does not "need" to be flushed, thus affects tests below
213+
test_expect_success 'clear content cache' '
214+
flux content dropcache
215+
'
216+
test_expect_success 'load content-sqlite and truncate old file to start fresh' '
217+
flux module load content-sqlite truncate
218+
'
219+
test_expect_success 'restore content when --maxreqs=1000 was used' '
220+
flux restore -v --checkpoint maxreqs.tar
221+
'
222+
test_expect_success 'unload content-sqlite' '
223+
flux content flush &&
224+
flux content dropcache &&
225+
flux module remove content-sqlite
226+
'
227+
# N.B. see notes above on why 4 blobs
228+
test_expect_success 'count blobs after restore'\'s' implicit garbage collection' '
229+
echo 4 >blobcount3.exp &&
230+
countblobs >blobcount3.out &&
231+
test_cmp blobcount3.exp blobcount3.out
232+
'
233+
test_expect_success 'load content-sqlite + kvs and list content' '
234+
flux module load content-sqlite &&
235+
flux module load kvs &&
236+
flux kvs dir -R
237+
'
238+
test_expect_success 'verify that exact KVS content was restored' '
239+
test $(flux kvs get a.b.c) = "testkey" &&
240+
test $(flux kvs get x) = $(cat x.val) &&
241+
test $(flux kvs readlink y) = "linkedthing" &&
242+
test $(flux kvs readlink z) = "smurf::otherthing" &&
243+
test $(flux kvs get w) = "foobar"
244+
'
245+
test_expect_success 'unload kvs' '
246+
flux module remove kvs
247+
'
248+
test_expect_success 'unload content-sqlite' '
249+
flux module remove content-sqlite
250+
'
251+
201252
reader() {
202253
local dbdir=$1
203254
flux start -Sbroker.rc1_path= \
@@ -277,6 +328,9 @@ test_expect_success LONGTEST 'unload kvs' '
277328
test_expect_success LONGTEST 'dump default=kvs-primary checkpoint' '
278329
flux dump --checkpoint bigval.tar
279330
'
331+
test_expect_success LONGTEST 'dump default=kvs-primary checkpoint w/ --maxreqs=1000' '
332+
flux dump --checkpoint --maxreqs=1000 bigvalmaxreqs.tar
333+
'
280334
test_expect_success LONGTEST 'reload content-sqlite, truncate old file to start fresh' '
281335
flux module reload content-sqlite truncate
282336
'
@@ -291,6 +345,20 @@ test_expect_success LONGTEST 'load kvs and check bigval value' '
291345
test_expect_success LONGTEST 'unload kvs' '
292346
flux module remove kvs
293347
'
348+
test_expect_success LONGTEST 'reload content-sqlite, truncate old file to start fresh' '
349+
flux module reload content-sqlite truncate
350+
'
351+
test_expect_success LONGTEST 'restore content from maxreqs dump' '
352+
flux restore --checkpoint bigvalmaxreqs.tar
353+
'
354+
test_expect_success LONGTEST 'load kvs and check bigval value from maxreqs dump' '
355+
flux module load kvs &&
356+
flux kvs get bigval > bigval.out &&
357+
test_cmp bigval.out bigval.exp
358+
'
359+
test_expect_success LONGTEST 'unload kvs' '
360+
flux module remove kvs
361+
'
294362
test_expect_success LONGTEST 'unload content-sqlite' '
295363
flux module remove content-sqlite
296364
'

0 commit comments

Comments
 (0)