# Disposable SDP integration testing `reset.sh` provisions an explicitly disposable Linux VM or container from local SDP source and local `p4`/`p4d` binaries. It performs no downloads. Its root must end in `sdp-test-NAME`, with an explicit instance, port, and existing non-root OS account. `/p4` is a symlink to that root's `p4` directory, so SDP scripts can keep their standard absolute paths while data stays in the disposable deployment. Run these examples **inside the disposable machine**, never on a host containing an existing `/p4` installation. A systemd container must have its own init/cgroup setup and isolated mounts; do not bind a real host's `/p4` into it. The provisioner uses the SDP init wrappers, and does not install host services or cron entries. ```bash # Run as root. Source/binaries and this provisioner must be outside the target root. /path/to/sdp/test/reset.sh \ --root /srv/sdp-test-integration --instance 1 --port 19999 --os-user perforce \ --source /path/to/sdp --p4 /inputs/p4 --p4d /inputs/p4d \ --initialize --confirm-disposable ``` `--initialize` requires an empty/new root and an absent `/p4`. It writes `.sdp-disposable-test`, recording the exact root, instance, port, account and server ID, then creates the owned `/p4` symlink. Later resets use the same command without `--initialize`; they require a matching marker and symlink, stop that instance, and remove only the deployment's `p4`, `meta`, `data`, and `sdp` directories. A marker mismatch or substituted volume symlink aborts before deletion. The account and root must remain accessible to that account. The provisioner derives `mkdirs.cfg` from `template.mkdirs.cfg`, applies its disposable path/account/port overrides and invokes `mkdirs.sh` with that exact file. It supplies a fixed strong test administrator password and establishes the first password before user-spec reads, as required by current secure server defaults. The deployment uses these disposable admin credentials, a unique `sdp-test-INSTANCE` server ID, loopback-only listening, `/p4/1/journals/journal` as the live journal, and `SDPMAIL=/bin/true`. It is intended only for disposable tests. Do not copy its generated configuration into production. If provisioning fails, its files/logs remain available for diagnosis; a reset can be retried after correcting the failure. After provisioning, run the harness as the marked OS account: ```bash /p4/sdp/test/sdp_test_harness.sh \ --root /srv/sdp-test-integration --instance 1 --port 19999 --os-user perforce \ --confirm-disposable ``` The harness checks the marker before loading SDP configuration, then checks the OS user, loopback endpoint, server ID, server root and disabled mail setting before mutations. The server must already be running. It records each command's output and return code, requires successful role-gating commands, reads back exact submitted and shelved fixture bytes, and requires a nonempty checkpoint created during the current run. It temporarily parks only its uniquely named synthetic depot archives, requires the verifier to report the missing revision, restores those archives, and verifies both submitted and shelved content again. Failed fixture creation stops dependent tests. Cleanup attempts to restore parked archives and the initially running server, and reports failure if it cannot. Topology-specific commands and host process termination are not called implicitly by this single-server harness. Its two explicit skips cover `kill_idle.sh` and the separate topology tooling. The [container suite](containers/README.md) supplies the required six-node topology fixture: commit, edge, commit standby, edge standby, broker and proxy, with independent storage and the same journal path. The acceptance gate requires the named role, replication, recovery, failed-restart, interrupted-recovery and distinct-host archive-repair assertions. A single-server pass alone is insufficient. The suite also requires paired comparisons against an immutable baseline and a historical p4d matrix. For the current review, the operator identified the workspace `sdp.tgz` as the deployed package. `containers/export_archive.py` records its checksum and extracts a separate baseline without changing the archive; unused Windows members are excluded. Candidate scripts and baseline files have separate hash manifests. Missing cases, unexpected skips, expected failures and stale source/image evidence make the gate fail, even if a process exits successfully. See the [production validation guide](../doc/production_validation.md) for the matrix boundaries and rollout review. ## Offline checks ```bash python3 -m unittest discover -s sdp/test -p test_setup_improvements.py -v ``` These tests never execute a real reset, harness run, server command, authentication request or email. They test guard functions against temporary directories, mocked interpreter builds, trigger calls with fake dependencies, and extracted harness assertions/fixture functions. This does not prove Linux integration behavior; use separate recorded container/VM runs for that evidence.