@ 261101.7

261030.4 · 6182a9aa802e833d238ab04b403b428f42fe37f9

A black-box suite runs the built binary, starting with the 404 coin

make blackbox runs tests/ with pytest and httpx against a server in a throwaway home, on --public and on the form wwwvm's unit uses. Cases are TOML files named after the decision they check.

The coin shows on both forms for a path a served repo lacks. The cache message appears only without --public, for a path that names no repo.

reading declarations

Changes to tests/cases/. All files

tests/cases/a-missing-path-s-404-turns-like-a-coin.toml

new file mode 100644@@ -0,0 +1,38 @@+# A path a served repo lacks shows the coin, on either form of server.+servers = ["public", "default"]++[[request]]+path = "/forge.invalid/acct/r/nope.md"+status = 404+contains = ['class="coin"', "not found"]+absent = ["cache"]++[[request]]+path = "/forge.invalid/acct/r/dir/nope.go"+status = 404+contains = ['class="coin"']+absent = ["cache"]++[[request]]+path = "/forge.invalid/acct/r/nope/"+status = 404+contains = ['class="coin"']+absent = ["cache"]++[[request]]+path = "/forge.invalid/acct/r/README.md/nope"+status = 404+contains = ['class="coin"']+absent = ["cache"]++[[request]]+path = "/forge.invalid/acct/r/nope.md?log"+status = 404+contains = ['class="coin"']+absent = ["cache"]++[[request]]+path = "/forge.invalid/acct/r/nope.md?raw"+status = 404+contains = ['class="coin"']+absent = ["cache"]

tests/cases/online-repos-open-on-a-second-address.toml

new file mode 100644@@ -0,0 +1,14 @@+# Without --public a path outside any repo falls back to the cache's own+# listing. This is the message wwwvm's unit shows, since it runs this form.+servers = ["default"]++[[request]]+path = "/forge.invalid/acct/nope"+status = 404+contains = ["No repo answers at", "listed by the cache", "The cache holds only what was read here"]+absent = ['class="coin"']++[[request]]+path = "/forge.invalid/acct"+status = 200+contains = ["r/", "listed by the cache"]

tests/cases/public-serves-only-online-repos-to-the-open-web.toml

new file mode 100644@@ -0,0 +1,13 @@+# A stranger learns nothing of the cache: no word of it, and no repo that+# another visitor read.+servers = ["public"]++[[request]]+path = "/forge.invalid"+status = 502+absent = ["cache", "acct/r"]++[[request]]+path = "/forge.invalid/acct/nope"+status = 502+absent = ["cache"]