Repository navigation
Conversation
tdxlab: 18/18 PASSAll the runnable new cases now execute on the The six
Three harness bugs the lab found and fixed along the way, none of them product issues — the echo invariant was an absolute ceiling where it should have been a scaling comparison, |
Regression: 65/65 PASS on the chapters that share fixtures with the new casesThe new cases are additive, but they lease the same The four errors are environmental, not a regression: After 65/65. Worth noting for #841 independently of this PR: |
The hardware case found a real product defect, and then named it
and the case left it there. Every reading of that sentence is about the transport, and the fixture publishes a QEMU slirp forwarded host port into the guest, so the obvious suspect was the forwarder rather than the agent. It was the agent. Driving the same 24-way load four ways against one lease-owned guest — over the forwarded port, over The systemd heartbeat is an HTTP Product fix: #1256. With it, all 43 are answered, Two corrections to the case itself, now committed here:
|
All 19 cases now pass on tdxlab, including the hardware-only one
Against a guest image built by mkosi from this branch plus #1256:
So the full set is 19/19 on tdxlab: 18 on lease-owned simulator and isolated-component fixtures (run |
d06738c to
2b722e2
Compare
Every RPC case in this suite names api-inventory.json as mandatory test data and states that the method is exercised with its request fields "absent/default, valid, boundary-invalid and combined with an unknown field" in both representations. The harnesses behind those cases send one valid request and one wrong-typed value for the *first* request field. So the input classes where a service actually breaks -- an out-of-range integer, an oversized string, a wrong protobuf wire type, a truncated body -- are untested for all 110 indexed methods. Add a harness that implements the stated matrix once, driven by the same inventory, and nine cases that apply it to the guest agent's four services, the KMS's two, and the gateway's three. It asserts the invariants that hold for every method whatever it means: a malformed request is never a 5xx or a dropped connection, a rejection is structured and bounded and carries the caller's own representation, no call outlives its deadline, and the listener still answers afterwards. That last one is a real assertion here: the workspace builds release binaries with `panic = "abort"`, so a reachable panic is a process abort. api-contract-matrix-policy.json says how far each method may be driven. `full` is for a method whose effect stays inside the lease; `rejection-only` sends only what a service must refuse before it dispatches, so nothing can mutate; `skip` is for a method whose valid invocation ends the process or consumes an external resource, and the file records the reason for each. Every method in the inventory must carry a policy -- one added without one fails the case rather than being silently skipped. Two product defects found while building this are fixed separately: a `not_after` of u64::MAX aborted the guest agent (#1232), and a rejection echoed the whole rejected value back to the caller and into the log under a content type the caller did not ask for (#1234).
A harness defect the first tdxlab sweep exposed. The echo check compared the rejection body against a fixed ceiling, so it still failed after the product bounded its error text: the bound is 2048 bytes and the JSON envelope pushes the reply to 2093. An absolute ceiling was never the property worth asserting anyway. What matters is that a rejection does not *scale* with the request, so the check is now a pair comparison -- two requests differing only in how large one field is must not produce rejections that differ in size -- with the absolute cap kept loose as a backstop.
The fixture's onboard url already carries the /prpc mount, unlike the KMS rpc url, so prefixing it again addressed a route rocket does not serve. Every vector then landed on rocket's default HTML 404 page, which the matrix correctly reported as an unstructured rejection under the wrong content type -- of a route that does not exist.
The gateway fixture's rpc_url, debug_url and admin_url all carry the /prpc mount, so prefixing it again addressed a route rocket does not serve: every one of the 626 admin vectors came back as rocket's default HTML 404 page. The matrix reported that correctly -- an unstructured rejection under the wrong content type, and a listener that did not answer a valid request afterwards -- of a route that never existed.
The KMS and gateway entries carried an offline-mock source_run and a note saying they had not been executed on the lab fixture. They have now: run cov841v-all-5860e60a4 on the tdxlab physical host scheduled all eighteen runnable cases of the coverage expansion against lease-owned fixtures and passed every one, the nine request-contract cases among them.
340e17f to
ce0920b
Compare
…structure' into test/core-coverage-expansion # Conflicts: # test-suites/catalog/feature-audit.md # test-suites/shared/automation/promoted-passing-cases.json
Stacked on #841.
Problem
The per-method RPC cases in #841 send one valid request and one wrong-typed value for the first field. Out-of-range integers, oversized strings, bad protobuf framing and truncated bodies were never sent to any guest-agent, KMS or gateway RPC.
Change
One harness (
api_contract_matrix.py+api-contract-matrix-case.py) drives every method of a service fromcatalog/api-inventory.jsonwith per-field, per-representation and per-method malformed input. It asserts six invariants: no 5xx or dropped connection (L1), a structured error in the request's representation (L2, L6), the listener still answers afterwards (L3), rejections that neither echo nor scale with input (L4), and no call past its deadline (L5).api-contract-matrix-policy.jsonlimits each method tofull,rejection-onlyorskip, and a method without a policy fails its case.Nine cases:
01-guest-os/15-request-contract(Tappd, DstackGuest, Worker, GuestApi),03-kms/13-request-contract(KMS, Onboard),04-gateway/11-request-contract(Gateway, Debug, Admin).It found two product defects, fixed in #1232 and #1234:
The first is a process abort reachable from any application container through
dstack.sock.Verification
cov841v-all-5860e60a4(with fix(guest-agent): reject a certificate validity bound it cannot represent #1232 and fix(ra-rpc): bound the error text a failed call returns, and return it in the caller's representation #1234): all nine cases PASS.dstack-test verify-registry --plan test-suites: 0 findings, 369 scripted / 369 promoted.pytest test-suites/runner/tests: 40 passed.ruff check,ruff format --check,py_compile,reuse lint: clean.