Add device traffic counters and ambiguous MAC detection
This commit is contained in:
@@ -24,6 +24,7 @@ test('device inventory discovers, merges, persists metadata and expires anonymou
|
||||
let observation = {
|
||||
observedAt: current.toISOString(),
|
||||
observations: parseNeighborSnapshot([
|
||||
{ dst: '2001:db8::10', dev: 'br0', lladdr: '00:11:22:33:44:55', state: ['STALE'] },
|
||||
{ dst: '192.168.50.10', dev: 'br0', lladdr: '00:11:22:33:44:55', state: ['REACHABLE'] },
|
||||
{ dst: '192.168.50.10', dev: 'br0', lladdr: '00:11:22:33:44:55', state: ['STALE'] },
|
||||
{ dst: '192.168.50.11', dev: 'br0', state: ['INCOMPLETE'] },
|
||||
@@ -49,6 +50,19 @@ test('device inventory discovers, merges, persists metadata and expires anonymou
|
||||
assert.equal(snapshot.devices[0].manufacturer, 'Example Devices');
|
||||
assert.equal(snapshot.devices[0].status, 'online');
|
||||
assert.equal(snapshot.devices[0].confidence, 'high');
|
||||
assert.equal(snapshot.devices[0].interface, 'br0');
|
||||
|
||||
observation = {
|
||||
observedAt: current.toISOString(),
|
||||
observations: parseNeighborSnapshot([
|
||||
{ dst: '192.168.50.10', dev: 'br0', lladdr: '00:11:22:33:44:55', state: ['REACHABLE'] },
|
||||
{ dst: '192.168.50.12', dev: 'br0', lladdr: '00:11:22:33:44:55', state: ['STALE'] },
|
||||
], current.toISOString()),
|
||||
error: null,
|
||||
};
|
||||
snapshot = await service.refresh();
|
||||
assert.equal(snapshot.devices.length, 1);
|
||||
assert.equal(snapshot.devices[0].confidence, 'ambiguous');
|
||||
|
||||
current = new Date('2026-07-01T10:05:00.000Z');
|
||||
observation = {
|
||||
|
||||
Reference in New Issue
Block a user