Skip to content

Commit

Permalink
fixup! t: cover flow control
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Nov 1, 2024
1 parent aa98560 commit 81cdb5d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions t/t0005-exec.t
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ test_expect_success 'stdin redirect from /dev/null works with -n' '
'

test_expect_success 'create large file for tests' '
dd if=/dev/urandom of=50Mfile bs=5M count=10
dd if=/dev/urandom of=5Mfile bs=5M count=1
'

test_expect_success 'create test script to redirect stdin to a file' '
Expand All @@ -263,20 +263,20 @@ test_expect_success 'create test script to redirect stdin to a file' '
chmod +x stdin2file
'

# piping a 50M file using a 4K buffer should overflow if flow control
# piping a 5M file using a 4K buffer should overflow if flow control
# is not functioning correctly
test_expect_success 'stdin flow control works (1 rank)' '
cat 50Mfile | flux exec -r 0 --setopt=stdin_BUFSIZE=4096 ./stdin2file &&
cmp 50Mfile cpy.0 &&
cat 5Mfile | flux exec -r 0 --setopt=stdin_BUFSIZE=4096 ./stdin2file &&
cmp 5Mfile cpy.0 &&
rm cpy.0
'

test_expect_success 'stdin flow control works (all ranks)' '
cat 50Mfile | flux exec -r 0-3 --setopt=stdin_BUFSIZE=4096 ./stdin2file &&
cmp 50Mfile cpy.0 &&
cmp 50Mfile cpy.1 &&
cmp 50Mfile cpy.2 &&
cmp 50Mfile cpy.3 &&
cat 5Mfile | flux exec -r 0-3 --setopt=stdin_BUFSIZE=4096 ./stdin2file &&
cmp 5Mfile cpy.0 &&
cmp 5Mfile cpy.1 &&
cmp 5Mfile cpy.2 &&
cmp 5Mfile cpy.3 &&
rm cpy.*
'

Expand All @@ -292,11 +292,11 @@ test_expect_success 'create test script to redirect stdin to a file, one rank ex
'

test_expect_success 'stdin flow control works (all ranks, one rank will exit early)' '
cat 50Mfile | flux exec -r 0-3 --setopt=stdin_BUFSIZE=4096 ./stdin2file &&
cat 5Mfile | flux exec -r 0-3 --setopt=stdin_BUFSIZE=4096 ./stdin2file &&
test_must_fail ls cpy.0 &&
cmp 50Mfile cpy.1 &&
cmp 50Mfile cpy.2 &&
cmp 50Mfile cpy.3 &&
cmp 5Mfile cpy.1 &&
cmp 5Mfile cpy.2 &&
cmp 5Mfile cpy.3 &&
rm cpy.*
'

Expand Down

0 comments on commit 81cdb5d

Please sign in to comment.