Skip to content

Commit

Permalink
cmd/flux-start: Add input error check
Browse files Browse the repository at this point in the history
If user specifies --bootstrap=selfpmi but does not specify --size,
output error message indicating it is needed.

Add unit test to test for this particular failure.

Fixes #1026
  • Loading branch information
chu11 committed Aug 29, 2017
1 parent a52a9c2 commit dbbc9da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cmd/flux-start.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ int main (int argc, char *argv[])
status = exec_broker (command, len, broker_path);
break;
case BOOTSTRAP_SELFPMI:
if (!optparse_hasopt (ctx.opts, "size"))
log_msg_exit ("--size must be specified for --bootstrap=selfpmi");
status = start_session (command, len, broker_path);
break;
default:
Expand Down
3 changes: 3 additions & 0 deletions t/t0001-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ test_expect_success 'flux-start with size 2 has a peer' "
test_expect_success 'flux-start --size=1 --bootstrap=selfpmi works' "
flux start ${ARGS} --size=1 --bootstrap=selfpmi /bin/true
"
test_expect_success 'flux-start --bootstrap=selfpmi fails (no size specified)' "
test_must_fail flux start ${ARGS} --bootstrap=selfpmi /bin/true
"
test_expect_success 'flux-start --size=1 --boostrap=pmi fails' "
test_must_fail flux start ${ARGS} --size=1 --bootstrap=pmi /bin/true
"
Expand Down

0 comments on commit dbbc9da

Please sign in to comment.