"""cryptpad — UPGRADE overlay (Phase 1e HC3): data-continuity, assertion-only + additive.

ops.pre_upgrade seeded a marker into the persistent cryptpad_data volume; the orchestrator performed
the upgrade once (generic tier asserted reconverge/serving/moved). This overlay ADDS: the data
survived the upgrade. Read via exec_in_app (cryptpad data isn't HTTP-served)."""

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "runner"))
from harness import lifecycle  # noqa: E402

MARKER = "/cryptpad/data/ci-marker.txt"


def test_upgrade_preserves_data(live_app):
    assert lifecycle.exec_in_app(live_app, ["cat", MARKER]).strip() == "upgrade-survives", (
        "data did not survive the upgrade"
    )
