mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-10 18:48:44 +00:00
test: add haproxy smoke test
Assisted-by: GLM 5 via Claude Code Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
39
test/haproxy-simple/test.mjs
Normal file
39
test/haproxy-simple/test.mjs
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
async function main() {
|
||||
console.log("Starting HAProxy simple smoke test...");
|
||||
|
||||
console.log("trying to hit backend through haproxy");
|
||||
let resp = await fetch(
|
||||
"https://localhost:8443",
|
||||
{
|
||||
headers: {
|
||||
"User-Agent": "Anubis testing",
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (resp.status !== 200) {
|
||||
throw new Error(`Expected 200, got ${resp.status}`);
|
||||
}
|
||||
console.log("Got 200 as expected");
|
||||
|
||||
console.log("trying to get stopped by anubis");
|
||||
resp = await fetch(
|
||||
"https://localhost:8443",
|
||||
{
|
||||
headers: {
|
||||
"User-Agent": "Mozilla/5.0",
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (resp.status !== 401) {
|
||||
throw new Error(`Expected 401, got ${resp.status}`);
|
||||
}
|
||||
console.log("Got 401 as expected");
|
||||
|
||||
console.log("All runtime tests passed successfully!");
|
||||
}
|
||||
|
||||
await main();
|
||||
Reference in New Issue
Block a user