(binary, work)
| 156 | |
| 157 | |
| 158 | def section_params(binary, work): |
| 159 | cache = section_dirs(work, "params") |
| 160 | bare = run_cli(binary, cache, ["daemon"]) |
| 161 | if bare.returncode == 0 or "usage:" not in out_text(bare): |
| 162 | print("RED: bare `daemon` should print usage and fail:\n%s" % excerpt(out_text(bare))) |
| 163 | return False |
| 164 | unknown = run_cli(binary, cache, ["daemon", "bogus"]) |
| 165 | if unknown.returncode == 0 or "unknown daemon option" not in out_text(unknown): |
| 166 | print("RED: `daemon bogus` should be rejected:\n%s" % excerpt(out_text(unknown))) |
| 167 | return False |
| 168 | bad_port = run_cli(binary, cache, ["daemon", "start", "--port=0"]) |
| 169 | if bad_port.returncode == 0 or "--port requires" not in out_text(bad_port): |
| 170 | print("RED: `--port=0` should be rejected before spawning:\n%s" |
| 171 | % excerpt(out_text(bad_port))) |
| 172 | return False |
| 173 | print("PASS: parameter surface rejects bare/unknown/out-of-range daemon invocations") |
| 174 | return True |
| 175 | |
| 176 | |
| 177 | def section_hook_fail_open(binary, work): |
nothing calls this directly
no test coverage detected