Skip to content

Commit 61cae34

Browse files
committed
testsuite: check flux-archive(1) examples
Problem: flux-archive(1) includes some examples that aren't really tested. Add tests that ensure these use cases actually work.
1 parent 6556153 commit 61cae34

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

t/t0021-archive-cmd.t

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,20 @@ test_expect_success 'archive exists in job KVS guest directory' '
173173
jobdir=$(flux job last | flux job id --to=kvs) &&
174174
flux kvs get $jobdir.guest.archive.mystuff >/dev/null
175175
'
176+
test_expect_success 'remove main archive' '
177+
flux archive remove
178+
'
179+
test_expect_success 'Create files for example 1 of flux-archive(1)' '
180+
mkdir -p project/dataset1 &&
181+
echo foo >project/dataset1/testfile &&
182+
echo bar >project/dataset1/testfile2
183+
'
184+
test_expect_success 'Ensure example 1 of flux-archive(1) works' '
185+
flux archive create -C project dataset1 &&
186+
flux exec -r 1 mkdir -p tmp.project &&
187+
flux exec -r 1 flux archive extract --waitcreate -C tmp.project &&
188+
flux exec -r 1 rm -r tmp.project &&
189+
flux archive remove
190+
'
176191

177192
test_done

t/t2617-job-shell-stage-in.t

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,23 @@ test_expect_success 'content change should cause an error' '
128128
test_must_fail flux run -N1 -o stage-in /bin/true 2>changed.err &&
129129
grep changed changed.err
130130
'
131+
test_expect_success 'Create files for example 2 of flux-archive(1)' '
132+
mkdir -p project/dataset1 &&
133+
mkdir -p home/fred &&
134+
$lptest >project/dataset1/lptest &&
135+
cat >home/fred/app <<-EOT &&
136+
#!/bin/sh
137+
find \$1 -type f
138+
EOT
139+
chmod +x home/fred/app
140+
'
141+
test_expect_success 'Verify that example 2 of flux-archive(1) works' '
142+
flux archive create --name=dataset1 -C project dataset1 &&
143+
flux archive create --name=app --mmap -C home/fred app &&
144+
flux run -N4 -o stage-in.names=app,dataset1 \
145+
{{tmpdir}}/app {{tmpdir}}/dataset1 &&
146+
flux archive remove --name=dataset1 &&
147+
flux archive remove --name=app
148+
'
131149

132150
test_done

0 commit comments

Comments
 (0)