Enable connectivity diagnostics in Connect mode
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
createConnectivityDiagnosticsService,
|
||||
CURL_META_MARKER,
|
||||
} from '../../src/server/services/connectivityDiagnosticsService.js';
|
||||
|
||||
const server = fs.readFileSync(path.resolve(import.meta.dirname, '../../src/server/index.js'), 'utf8');
|
||||
|
||||
function response(body = '', overrides = {}) {
|
||||
return {
|
||||
exitCode: 0,
|
||||
@@ -48,6 +52,11 @@ test('connectivity diagnostics force separate direct and VPN paths', async () =>
|
||||
assert.ok(calls.some((args) => args.includes('--proxy') && args.includes('http://127.0.0.1:18080')));
|
||||
});
|
||||
|
||||
test('connectivity diagnostics endpoint is available in Connect and Gateway', () => {
|
||||
assert.match(server, /const localConnectivityDiagnostics = !remoteDataplane/);
|
||||
assert.doesNotMatch(server, /settings\.appMode !== 'gateway'[\s\S]{0,120}ENDPOINT_NOT_FOUND/);
|
||||
});
|
||||
|
||||
test('connectivity diagnostics reports a likely direct restriction without claiming its owner', async () => {
|
||||
const attempts = new Map();
|
||||
const execute = async (args) => {
|
||||
|
||||
Reference in New Issue
Block a user