chore: take deployment-specific material out of the repository for the first release
- MBU parity map, cutover runbook and the tasks/ planning notes move outside the repo - tests/mbu becomes tests/fixtures with generic application names and no placement inventory - test fixtures in Rust and web use neutral names - scripts/export-public.sh checks an external list of private terms instead of naming them Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
30
tests/mbu/README.md → tests/fixtures/README.md
vendored
30
tests/mbu/README.md → tests/fixtures/README.md
vendored
@@ -1,4 +1,4 @@
|
||||
# MBU backup fixtures
|
||||
# Backup fixtures
|
||||
|
||||
Use a clean development host with Restic, PostgreSQL client/server tools, MySQL client tools, OpenSSL, OpenSSH, Docker, AWS CLI, Node.js and Python 3.9+. The SSH fixture uses a temporary loopback `sshd` and generated keys. Some Linux hosts require the distro's SSH privilege separation directory to exist before a non-root fixture can start.
|
||||
|
||||
@@ -7,14 +7,14 @@ rtk proxy npm --prefix web run build
|
||||
rtk cargo build --workspace
|
||||
rtk cargo test --workspace
|
||||
rtk cargo test -p tessera-store -- --ignored
|
||||
rtk proxy python3 tests/mbu/restic-orbits.py
|
||||
rtk proxy python3 tests/mbu/capture-postgres.py
|
||||
rtk proxy python3 tests/mbu/capture-mysql.py
|
||||
rtk proxy python3 tests/mbu/restore-postgres.py
|
||||
rtk proxy python3 tests/mbu/offsite.py
|
||||
rtk proxy python3 tests/mbu/browser.py
|
||||
rtk proxy python3 tests/mbu/legacy-import.py
|
||||
rtk proxy python3 tests/mbu/matrix.py
|
||||
rtk proxy python3 tests/fixtures/restic-orbits.py
|
||||
rtk proxy python3 tests/fixtures/capture-postgres.py
|
||||
rtk proxy python3 tests/fixtures/capture-mysql.py
|
||||
rtk proxy python3 tests/fixtures/restore-postgres.py
|
||||
rtk proxy python3 tests/fixtures/offsite.py
|
||||
rtk proxy python3 tests/fixtures/browser.py
|
||||
rtk proxy python3 tests/fixtures/legacy-import.py
|
||||
rtk proxy python3 tests/fixtures/matrix.py
|
||||
```
|
||||
|
||||
- Restic orbits requires `rest-server` and `htpasswd` on PATH. It checks the four source/access combinations with a TLS Rest Server, re-runs after small changes, and verifies filesystem and PostgreSQL restores. Add `--mysql` to include MySQL capture and restore through both access modes.
|
||||
@@ -27,11 +27,13 @@ rtk proxy python3 tests/mbu/matrix.py
|
||||
- The legacy import fixture reads compressed SQL archives from S3, restores synthetic samples, and verifies history access and idempotency after local GC.
|
||||
- The matrix pairs three outposts, runs ten application profiles against isolated databases, exercises a scheduler tick for 02.00 WIB, and checks manual capture, scheduled capture, registered restore targets, and S3 copies. Its JSON output records durations, freshness, size and restore results.
|
||||
|
||||
## Placement inventory and fixture mapping
|
||||
|
||||
Read-only Teleport inventory on 10 November 2026 showed `odoo-clone`, `production-FTA`, `fta-prod`, `broiler-production`, `broiler-staging` and `mbu-backup-jumphost`. Database inventory reported the Broiler resource `mbu-production` with the MySQL protocol. MAS and FTA had no matching database resource in the approved inventory. The returned metadata had no server-version labels. The approved Machine ID could list resources, but the attempted `devops` OS login returned `unknown user devops` on `odoo-clone`, `production-FTA`, `broiler-production`, and `mbu-backup-jumphost`. Verification of deployed client/server versions, routes and privileges requires an authorized existing OS login on the applicable nodes.
|
||||
## Fixture mapping
|
||||
|
||||
| Case | Fixture | Placement to validate |
|
||||
| --- | --- | --- |
|
||||
| MAS and FTA | PostgreSQL TLS behind a loopback SSH bastion, wrong host key case | Run near the database if there is direct access. Otherwise use a pinned SSH forward to the database and validate the PostgreSQL server hostname. |
|
||||
| Boiler | MySQL behind a pinned SSH login, wrong host key and engine-error cases | Use the matched MySQL client on the SSH host and a private client options file. |
|
||||
| Direct PostgreSQL | TLS to a loopback server, mismatched hostname case | Run the agent where it can reach the database with the same TLS policy. |
|
||||
| PostgreSQL behind a bastion | TLS through a loopback SSH bastion, wrong host key case | Run near the database if there is direct access. Otherwise use a pinned SSH forward to the database and validate the PostgreSQL server hostname. |
|
||||
| MySQL behind SSH | Pinned SSH login, wrong host key and engine-error cases | Use the matched MySQL client on the SSH host and a private client options file. |
|
||||
| Capture-only application | Profile without a restore target | Backups work; a restore request is refused until a target is registered. |
|
||||
|
||||
Verify deployed client and server versions, routes and privileges on the real hosts before relying on a placement.
|
||||
34
tests/mbu/matrix.py → tests/fixtures/matrix.py
vendored
34
tests/mbu/matrix.py → tests/fixtures/matrix.py
vendored
@@ -12,10 +12,10 @@ import sqlite3
|
||||
from fixture import bastion, command, mysql_container, pair, postgres, s3_container, start_agent, start_hub, wait_until
|
||||
|
||||
POSTGRES = [
|
||||
"lti", "presensi", "sso", "helpdesk", "manbu", "daily_checklist",
|
||||
"odoo_mas", "odoo_fta", "dashboard_management",
|
||||
"direct_a", "direct_b", "direct_c", "direct_d", "direct_e", "post_sql_app",
|
||||
"bastion_recreate", "bastion_capture_only", "capture_only_b",
|
||||
]
|
||||
CAPTURE_ONLY = {"odoo_fta", "dashboard_management"}
|
||||
CAPTURE_ONLY = {"bastion_capture_only", "capture_only_b"}
|
||||
|
||||
|
||||
def main():
|
||||
@@ -45,21 +45,21 @@ def main():
|
||||
|
||||
pg_id = pg_sql("postgres", "SELECT system_identifier FROM pg_control_system()")
|
||||
mysql_id = mysql_sql("fixture", "SELECT LOWER(@@server_uuid)")
|
||||
mysql_sql("fixture", "CREATE DATABASE boiler_staging; CREATE TABLE sample(value VARCHAR(40));"
|
||||
"INSERT INTO sample VALUES ('boiler'); CREATE VIEW sample_view AS SELECT value FROM sample")
|
||||
mysql_sql("boiler_staging", "CREATE TABLE sample(value VARCHAR(40)); INSERT INTO sample VALUES ('previous')")
|
||||
mysql_sql("fixture", "CREATE DATABASE mysql_staging; CREATE TABLE sample(value VARCHAR(40));"
|
||||
"INSERT INTO sample VALUES ('mysql_app'); CREATE VIEW sample_view AS SELECT value FROM sample")
|
||||
mysql_sql("mysql_staging", "CREATE TABLE sample(value VARCHAR(40)); INSERT INTO sample VALUES ('previous')")
|
||||
|
||||
groups = {kind: {"agent": pair(api, f"fixture-{kind}"), "profiles": {}}
|
||||
for kind in ("direct", "bastion", "mysql")}
|
||||
applications = {}
|
||||
for app in POSTGRES + ["boiler"]:
|
||||
mysql_app = app == "boiler"
|
||||
group = groups["mysql" if mysql_app else "bastion" if app in ("odoo_mas", "odoo_fta") else "direct"]
|
||||
for app in POSTGRES + ["mysql_app"]:
|
||||
mysql_app = app == "mysql_app"
|
||||
group = groups["mysql" if mysql_app else "bastion" if app in ("bastion_recreate", "bastion_capture_only") else "direct"]
|
||||
node = group["agent"]["outpost_id"]
|
||||
orbit = api("orbits", {"name": app, "provider": "wormhole", "provider_config": {}})
|
||||
app_id = str(uuid4())
|
||||
engine = "mysql" if mysql_app else "postgres"
|
||||
format = "mysql_sql" if mysql_app else "postgres_sql" if app == "daily_checklist" else "postgres_custom"
|
||||
format = "mysql_sql" if mysql_app else "postgres_sql" if app == "post_sql_app" else "postgres_custom"
|
||||
api("capture-profiles", {"application_id": app_id, "orbit_id": orbit["id"], "outpost_id": node,
|
||||
"format": format, "schedule": {"hour": 2, "timezone": "Asia/Jakarta"}}, expected=201)
|
||||
target_db = app + "_staging"
|
||||
@@ -71,12 +71,12 @@ def main():
|
||||
pg_sql(app, "CREATE SCHEMA fixture; CREATE TABLE fixture.sample(value text);"
|
||||
f"INSERT INTO fixture.sample VALUES ('{app}')")
|
||||
source = connection(app)
|
||||
if app in ("odoo_mas", "odoo_fta"):
|
||||
if app in ("bastion_recreate", "bastion_capture_only"):
|
||||
source["bastion"] = pinned
|
||||
mode = {"reset": "recreate_database"} if app == "odoo_mas" else {"reset": "schema", "schema": "fixture"}
|
||||
mode = {"reset": "recreate_database"} if app == "bastion_recreate" else {"reset": "schema", "schema": "fixture"}
|
||||
target = {"engine": engine, "connection": {**source, "database": target_db}, "mode": mode}
|
||||
if app == "daily_checklist":
|
||||
post = root / "checklist.sql"
|
||||
if app == "post_sql_app":
|
||||
post = root / "post_restore.sql"
|
||||
post.write_text("INSERT INTO fixture.sample VALUES ('post-restore');")
|
||||
target["post_restore_sql"] = str(post)
|
||||
|
||||
@@ -141,14 +141,14 @@ def main():
|
||||
for app, result in results.items():
|
||||
_, _, _, database = applications[app]
|
||||
assert result["safety_snapshot_id"]
|
||||
if app == "boiler":
|
||||
if app == "mysql_app":
|
||||
assert mysql_sql(database, "SELECT value FROM sample_view") == app
|
||||
else:
|
||||
expected = app + "\npost-restore" if app == "daily_checklist" else app
|
||||
expected = app + "\npost-restore" if app == "post_sql_app" else app
|
||||
assert pg_sql(database, "SELECT value FROM fixture.sample ORDER BY value") == expected
|
||||
stats[app]["restore"] = "verified"
|
||||
|
||||
archive = applications["lti"][2]
|
||||
archive = applications["direct_a"][2]
|
||||
expected = api(f"snapshots/{archive}/download", raw=True)
|
||||
primary = root / "hub" / "vault" / "restic"
|
||||
primary.rename(primary.with_name("restic-offline"))
|
||||
Reference in New Issue
Block a user