Four negations assert nothing, including the one guarding the localhost trap #4
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/unit-redis#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A bats test body has no assertions of its own: its verdict is the exit status of the last command it ran. Bash does not apply errexit to a negated command, so
! cmdon its own line decides the test when it is the final command of the body and is inert everywhere else.Four negations here are inert, and they are the refutations this component exists to make.
tests/conf.bats, the bind fragment
Line 253 is the refutation the comment above it explains: that the fragment never says
localhost. That is the exact linedocs/traps.mdrecords the PostgreSQL appliance getting wrong ("On Debian,localhostis not an IPv6 name"), and the test put there to stop it happening again did not run.tests/conf.bats, the acl fragment
Lines 263 and 264: that the fragment declares no
adminuser, and norequirepass. Those two are what make the duplicate-user-declaration failure impossible and keep the password off the disk at build time — the other entry indocs/traps.md, "A Redis ACL user may be declared only once". Only the third refusal,+@allon the default user, ran.tests/unit.bats, the shipped tree
Line 77: that no
requirepassline is anywhere in the overlay. The comment above it calls this "the one property the whole design rests on: what lands on the machine is a digest."What to do
Write every negation
run ! cmd, the six in final position included, so that no line's meaning depends on its position.tests/conf.batsandtests/hook.batsalready declarebats_require_minimum_version 1.5.0;tests/unit.batsneeds it.Test plan
shellcheck --severity=error --include=SC2314overtests/*.batsreports nothing.bats tests/*.batsgreen with the four inert assertions live.tests/coverage.shat the committed threshold of 100.