Use topology/links and anynetlinks filters with eq/in operators so store WAN follow-ups return real peer tunnels instead of unscoped dumps. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
// tests/wanTunnels.check.test.js
|
|
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import { wanTunnelsCheck } from '../services/voiceDiag/checks/wan/wanTunnels.js';
|
|
|
|
test('wanTunnels: all up → ok', async () => {
|
|
const result = await wanTunnelsCheck.run({
|
|
sdwanData: {
|
|
tunnels: [
|
|
{ id: '1', peerLabel: 'Hub', up: true },
|
|
{ id: '2', peerLabel: 'Hub2', up: true },
|
|
],
|
|
links: [{ up: true }],
|
|
errors: [],
|
|
},
|
|
});
|
|
assert.equal(result.status, 'ok');
|
|
});
|
|
|
|
test('wanTunnels: down while physical up → error with overlay hint', async () => {
|
|
const result = await wanTunnelsCheck.run({
|
|
sdwanData: {
|
|
tunnels: [
|
|
{ id: '1', peerLabel: 'Hub', up: false },
|
|
{ id: '2', peerLabel: 'Hub2', up: true },
|
|
],
|
|
links: [{ up: true }, { up: true }],
|
|
errors: [],
|
|
},
|
|
});
|
|
assert.equal(result.status, 'error');
|
|
assert.match(result.message, /overlay/i);
|
|
});
|
|
|
|
test('wanTunnels: empty → skipped', async () => {
|
|
const result = await wanTunnelsCheck.run({
|
|
sdwanData: { tunnels: [], links: [], errors: [] },
|
|
});
|
|
assert.equal(result.status, 'skipped');
|
|
});
|