# Smoke tests These scripts validate core HTTP surfaces on a running P2NS instance. ## Prerequisites - P2NS is running locally and serving internal domains. - Root certificate is trusted so `https://p2ns.admin` and `https://peer.paste` resolve. - Node.js 18+. ## Scripts - `npm run test:admin` checks `p2ns.admin` health/status/stats endpoints. - `npm run test:peer-paste` checks `peer.paste` health/stats/OpenAPI endpoints. - `npm run test:plugins` checks `peer.directory`, `global.profile`, and `file.drop` API endpoints. - `npm run test:plugin-rpc` runs `plugin-channel-rpc.test.js` (offline contract tests for protomux-rpc plugin channels; no running node required). - `npm run test:core-rpc` runs core RPC smoke, `network-manifest.test.js`, `core-swarm-handlers.test.js`, `multi-master.test.js` (simulated genesis + N masters, default 4), and invite integration static checks. - `npm run test:multi-master` runs only the multi-master simulation (`MULTI_MASTER_COUNT=6 node test-scripts/multi-master.test.js` to scale). - `npm test` runs admin, peer-paste, and plugins smoke scripts in sequence (does not include `test:plugin-rpc` or `test:core-rpc`). ## Custom target URL You can pass a custom base URL: - `node test-scripts/admin-smoke.js https://p2ns.admin` - `node test-scripts/peer-paste-smoke.js https://peer.paste` You can also override plugin targets with env vars: - `PEER_DIRECTORY_URL` - `GLOBAL_PROFILE_URL` - `FILE_DROP_URL`