mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-09 12:10:46 +08:00
Merge nms+common into ops so login questions load execManagedNe.
One capability group now ships netx-ops (alarms + managed CLI + paths); keep tools-nms/common as aliases. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6e591be2b5
commit
63f88bdf6c
33 changed files with 2133 additions and 446 deletions
|
|
@ -15,34 +15,32 @@ import {
|
|||
TOOLS_BY_GROUP,
|
||||
} from '../src/netx/capability-groups.ts'
|
||||
|
||||
test('defaults: nms + common in preset; topology and public off', () => {
|
||||
test('defaults: ops in preset; topology and public off', () => {
|
||||
assert.deepEqual(DEFAULT_CAPABILITY_GROUPS, {
|
||||
nms: { inPreset: true, public: false },
|
||||
common: { inPreset: true, public: false },
|
||||
ops: { inPreset: true, public: false },
|
||||
topology: { inPreset: false, public: false },
|
||||
})
|
||||
assert.deepEqual(groupsForPlane(undefined, 'preset'), ['nms', 'common'])
|
||||
assert.deepEqual(groupsForPlane(undefined, 'preset'), ['ops'])
|
||||
assert.deepEqual(groupsForPlane(undefined, 'public'), [])
|
||||
})
|
||||
|
||||
test('one group one skill dir; topology owns canvas + layout tools', () => {
|
||||
test('one group one skill dir; ops owns NMS + managed CLI; topology owns canvas', () => {
|
||||
assert.deepEqual(SKILL_DIR_BY_GROUP, {
|
||||
nms: 'nms',
|
||||
common: 'common',
|
||||
ops: 'ops',
|
||||
topology: 'topology',
|
||||
})
|
||||
assert.ok(TOOLS_BY_GROUP.common.includes('netx__findTopologyPaths'))
|
||||
assert.ok(TOOLS_BY_GROUP.ops.includes('netx__findTopologyPaths'))
|
||||
assert.ok(TOOLS_BY_GROUP.ops.includes('netx__execManagedNe'))
|
||||
assert.ok(TOOLS_BY_GROUP.ops.includes('netx__queryNmsAlarms'))
|
||||
assert.ok(TOOLS_BY_GROUP.topology.includes('netx__getTopologyTree'))
|
||||
assert.ok(TOOLS_BY_GROUP.topology.includes('netx__layoutTopologyView'))
|
||||
assert.ok(TOOLS_BY_GROUP.topology.includes('netx__suggestSinkHubs'))
|
||||
assert.ok(TOOLS_BY_GROUP.topology.includes('netx__sinkTopologyDualUnits'))
|
||||
assert.ok(TOOLS_BY_GROUP.nms.includes('netx__queryNmsAlarms'))
|
||||
})
|
||||
|
||||
test('capabilityGroupsFromSettings honors explicit false for inPreset defaults', () => {
|
||||
const groups = capabilityGroupsFromSettings({
|
||||
groupNmsInPreset: false,
|
||||
groupCommonInPreset: false,
|
||||
groupOpsInPreset: false,
|
||||
groupTopologyInPreset: true,
|
||||
groupTopologyPublic: true,
|
||||
})
|
||||
|
|
@ -53,18 +51,27 @@ test('capabilityGroupsFromSettings honors explicit false for inPreset defaults',
|
|||
assert.equal(toolNamesForGroups(['topology']).has('netx__queryNmsAlarms'), false)
|
||||
})
|
||||
|
||||
test('legacy groupManagedNe* maps to common; legacy layout flags OR into topology', () => {
|
||||
test('legacy groupNms/common/managedNe map to ops; legacy layout flags OR into topology', () => {
|
||||
const groups = capabilityGroupsFromSettings({
|
||||
groupManagedNeInPreset: false,
|
||||
groupNmsInPreset: false,
|
||||
groupCommonInPreset: false,
|
||||
groupManagedNePublic: true,
|
||||
groupTopologyLayoutInPreset: true,
|
||||
})
|
||||
assert.equal(groups.common.inPreset, false)
|
||||
assert.equal(groups.common.public, true)
|
||||
assert.equal(groups.ops.inPreset, false)
|
||||
assert.equal(groups.ops.public, true)
|
||||
assert.equal(groups.topology.inPreset, true)
|
||||
})
|
||||
|
||||
test('groupsForced ignores settings for per-export mounts', () => {
|
||||
assert.deepEqual(groupsForced(['common']), ['common'])
|
||||
assert.deepEqual(groupsForced(['nms', 'topology']), ['nms', 'topology'])
|
||||
test('legacy any-true turns ops inPreset on', () => {
|
||||
const groups = capabilityGroupsFromSettings({
|
||||
groupNmsInPreset: false,
|
||||
groupCommonInPreset: true,
|
||||
})
|
||||
assert.equal(groups.ops.inPreset, true)
|
||||
})
|
||||
|
||||
test('groupsForced ignores settings for per-export mounts', () => {
|
||||
assert.deepEqual(groupsForced(['ops']), ['ops'])
|
||||
assert.deepEqual(groupsForced(['ops', 'topology']), ['ops', 'topology'])
|
||||
})
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { join } from 'node:path'
|
|||
import { opsSkillsRoot } from '../src/netx/group-skills.ts'
|
||||
import { SKILL_DIR_BY_GROUP } from '../src/netx/capability-groups.ts'
|
||||
|
||||
test('opsSkillsRoot points at nms / common / topology playbook dirs', () => {
|
||||
test('opsSkillsRoot points at ops / topology playbook dirs', () => {
|
||||
const root = opsSkillsRoot()
|
||||
assert.ok(existsSync(root), root)
|
||||
for (const dir of Object.values(SKILL_DIR_BY_GROUP)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue