feat(workflow): example covers security, platform, enterprise and resilience features

105 route tests, matrix crawl, spec and README updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 02:19:52 +02:00
co-authored by Claude Sonnet 5.5
parent 00af65613d
commit 62fdd08da8
90 changed files with 8038 additions and 11 deletions
+28
View File
@@ -0,0 +1,28 @@
// Route: /operability/coord (lease, election, lock with fencing tokens)
#include "support/Assert.hpp"
using namespace molo::example::test;
using molo::example::fw::Method;
static const char* kForm = "application/x-www-form-urlencoded";
int main() {
Fixture f;
check(f.client->get("/operability/coord").status == 200, "status 200");
auto a = f.client->post("/operability/coord/acquire", "key=lock&owner=a", kForm);
check(contains(a.body, "granted token 1"), "a gets token 1");
auto b = f.client->post("/operability/coord/acquire", "key=lock&owner=b", kForm);
check(contains(b.body, "denied, held by a"), "b denied while lease live");
f.client->post("/operability/coord/tick", "", kForm);
f.client->post("/operability/coord/tick", "", kForm);
auto b2 = f.client->post("/operability/coord/acquire", "key=lock&owner=b", kForm);
check(contains(b2.body, "granted token 2"), "b gets token 2 after expiry");
check(contains(f.client->post("/operability/coord/write", "key=lock&token=2", kForm).body, "write accepted"), "fresh token writes");
auto stale = f.client->post("/operability/coord/write", "key=lock&token=1", kForm);
check(contains(stale.body, "stale fencing token"), "stale token fenced off");
auto bad = f.client->post("/operability/coord/acquire", "key=db&owner=a", kForm);
check(bad.status == 422, "422 unknown key");
check(contains(f.client->post("/operability/coord/acquire", "key=leader&owner=n1", kForm).body, "granted"), "election via leader key");
check(contains(f.client->get("/operability/coord").body, "held by b"), "side effect: holder shown");
return finish("operability/coord");
}