test(e2e): wipe agentctl before F5 to assert from a fresh-install state
F5 asserts that the agentctl_action probe reports "uploaded" before the first launch and "cached" after. Tests share a worker-scoped sshd container, so an earlier test in the same worker may have already primed the cache, making the "before" assertion flap. Wipe ~/.kandev/bin/agentctl + .sha256 from the container at the top of F5 so the assertion sees the documented fresh-install path. Export execInContainer so the spec can reach into the container without copying the docker-exec boilerplate. Add error_message to the listTaskSessions return type so the hostkey-rotation spec can read the field (which the backend already returns).
This commit is contained in:
@@ -992,6 +992,7 @@ export class ApiClient {
|
||||
task_environment_id?: string;
|
||||
worktree_path?: string;
|
||||
worktree_branch?: string;
|
||||
error_message?: string;
|
||||
}>;
|
||||
total: number;
|
||||
}> {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { test, expect } from "../../fixtures/ssh-test-base";
|
||||
import { execInContainer } from "../../helpers/ssh";
|
||||
|
||||
/**
|
||||
* HTTP contract for POST /api/v1/ssh/test. The endpoint dials the host with a
|
||||
@@ -91,6 +92,16 @@ test.describe("ssh test-endpoint contract", () => {
|
||||
apiClient,
|
||||
seedData,
|
||||
}) => {
|
||||
// Wipe any prior agentctl + sha256 sidecar from the per-worker container
|
||||
// so the "before" probe sees a fresh-install state regardless of which
|
||||
// tests ran earlier in this worker.
|
||||
execInContainer(seedData.sshTarget, [
|
||||
"rm",
|
||||
"-f",
|
||||
"/home/kandev/.kandev/bin/agentctl",
|
||||
"/home/kandev/.kandev/bin/agentctl.sha256",
|
||||
]);
|
||||
|
||||
// First test run: agentctl has never been uploaded, status = "uploaded".
|
||||
const before = await apiClient.testSSHConnection({
|
||||
name: "F5-before",
|
||||
|
||||
Reference in New Issue
Block a user