P7 r9: probes isolated (DATA_DIR tmp), self-authenticating (git stamp + asserts), try/finally cleanup, explicit exit
This commit is contained in:
2 files changed
+120
-78
No files matched your search
@@ -31,6 +31,8 @@ async function main() {
|
||||
await new Promise((r) => server.on('listening', r));
|
||||
const port = server.address().port;
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
console.log(`# git HEAD: ${execSync('git -C .. rev-parse HEAD', { encoding: 'utf8' }).trim()}`);
|
||||
const show = (label, method, path, headers, res) => {
|
||||
console.log(`### ${label}`);
|
||||
console.log(`> ${method} http://127.0.0.1:${port}${path}`);
|
||||
@@ -66,9 +68,9 @@ async function main() {
|
||||
res = await req(port, 'GET', '/api/v1/network/wg/redeem/nonexistent-token');
|
||||
show('wg redeem, bogus token (public route) → redeem outcome (route mounted)', 'GET', '/api/v1/network/wg/redeem/nonexistent-token', {}, res);
|
||||
|
||||
server.close();
|
||||
await new Promise((r) => server.close(r));
|
||||
console.log('LIVE-PROBE-DONE');
|
||||
process.exit(0);
|
||||
process.exit(0); // background timers would hold the loop open
|
||||
}
|
||||
|
||||
main().catch((e) => { console.error('FATAL', e && e.message); process.exit(1); });
|
||||
Reference in new issue
Block a user