-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BATS tests: new too-many-arguments test #6733
BATS tests: new too-many-arguments test #6733
Conversation
8d1d9a4
to
a917acf
Compare
Treating this as a flake:
(in special_testing_rootless TEST_REMOTE_CLIENT:false) |
In in-podman fedora-32, also treating as flake:
|
a917acf
to
67a5ad8
Compare
Treating as flake (in build_each_commit):
|
...plus a few others. And fixes to actual parsing. If a command's usage message includes '...' in the argument list, assume it can take unlimited arguments. Nothing we can check. For all others, though, the ALL-CAPS part on the right-hand side of the usage message will define an upper bound on the number of arguments accepted by the command. So in our 'podman --help' test, generate N+1 args and run that command. We expect a 125 exit status and a suitably helpful error message. Not all podman commands or subcommands were checking, so I fixed that. And, fixed some broken usage messages (all-caps FLAGS, and '[flags]' at the end of 'ARGS'). Add new checks to the help test to prevent those in the future. Plus a little refactoring/cleanup where necessary. Signed-off-by: Ed Santiago <[email protected]>
67a5ad8
to
6864a55
Compare
LGTM |
Thanks. No changes in this last push a few minutes ago, it was just a rebase because CI had been stuck for 3 hours. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Tests (finally) green. @baude, @jwhonce, @vrothberg, @QiWang19, @mheon, this PR touches code that you've had a hand in. If you have time, I'd appreciate a quick once-over of those parts of the code you recognize (no need to review the BATS stuff, just the changes in argument processing). TIA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, amazing bash witchcraft!
I'll let others have a look before merging.
/lgtm |
LGTM |
...plus a few others. And fixes to actual parsing.
If a command's usage message includes '...' in the
argument list, assume it can take unlimited arguments.
Nothing we can check.
For all others, though, the ALL-CAPS part on the
right-hand side of the usage message will define
an upper bound on the number of arguments accepted
by the command. So in our 'podman --help' test,
generate N+1 args and run that command. We expect
a 125 exit status and a suitably helpful error message.
Not all podman commands or subcommands were checking,
so I fixed that. And, fixed some broken usage messages
(all-caps FLAGS, and '[flags]' at the end of 'ARGS').
Add new checks to the help test to prevent those in
the future.
Plus a little refactoring/cleanup where necessary.
Signed-off-by: Ed Santiago [email protected]