Skip to content

Commit e067dc4

Browse files
committed
testsuite: cover flux restore --size-limit=SIZE
Problem: flux restore --size-limit=SIZE option has no tests. Add tests to t2807-dump-cmd.t.
1 parent eb4d57a commit e067dc4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

t/t2807-dump-cmd.t

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,34 @@ test_expect_success 'restart flux instance and try to run a job' '
227227
flux run /bin/true
228228
'
229229

230+
# Cover --size-limit
231+
232+
test_expect_success 'create bigdump.tar with a 12M blob in it' '
233+
mkdir -p big &&
234+
dd if=/dev/zero of=big/tinyblob bs=1048576 count=1 &&
235+
dd if=/dev/zero of=big/bigblob bs=1048576 count=12 &&
236+
dd if=/dev/zero of=big/smallblob bs=1048576 count=3 &&
237+
dd if=/dev/zero of=big/medblob bs=1048576 count=6 &&
238+
dd if=/dev/zero of=big/med2blob bs=1048576 count=6 &&
239+
tar cvf bigdump.tar big
240+
'
241+
test_expect_success 'restore bigdump.tar and verify blob count' '
242+
flux start flux restore \
243+
--key=foo bigdump.tar 2>bigdump.err &&
244+
grep "restored 5 keys (7 blobs)" bigdump.err
245+
'
246+
test_expect_success 'restore bigdump.tar with size limit' '
247+
flux start flux restore --size-limit=10485760 \
248+
--key=foo bigdump.tar 2>bigdump2.err &&
249+
grep "exceeds" bigdump2.err &&
250+
grep "restored 4 keys (6 blobs)" bigdump2.err
251+
'
252+
test_expect_success 'rc1 skips blob that exceeds 100M limit' '
253+
dd if=/dev/zero of=big/hugeblob bs=1048576 count=120 &&
254+
tar cvf bigdump2.tar big &&
255+
flux start -o,-Scontent.restore=bigdump2.tar \
256+
/bin/true 2>bigdump3.err &&
257+
grep "exceeds" bigdump3.err
258+
'
259+
230260
test_done

0 commit comments

Comments
 (0)