Skip to content

status: Add dual-stack mgmt address support and integration coverage#3532

Open
moogzy wants to merge 1 commit into
ipspace:devfrom
moogzy:enhancement/add_dualstack_mgmt_address_support_to_status
Open

status: Add dual-stack mgmt address support and integration coverage#3532
moogzy wants to merge 1 commit into
ipspace:devfrom
moogzy:enhancement/add_dualstack_mgmt_address_support_to_status

Conversation

@moogzy

@moogzy moogzy commented Jun 27, 2026

Copy link
Copy Markdown

Summary:

Add dual-stack management visibility in netlab status output with integration coverage for that behaviour.

Addresses #3358

// Previous behaviour

vscode ➜ /workspaces/netlab/tests (dev) $ netlab status
Lab default in /workspaces/netlab/tests
  status:      started
  topology:    platform-integration/cli/12-status-mgmt-dual-stack.yml
  provider(s): clab

┏━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ node ┃ device ┃ image              ┃ mgmt IPv4      ┃ connection ┃ provider ┃ VM/container ┃ status       ┃
┡━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ x    │ linux  │ python:3.13-alpine │ 192.168.121.11 │ docker     │ clab     │ clab-cli-x   │ Up 8 seconds │
└──────┴────────┴────────────────────┴────────────────┴────────────┴──────────┴──────────────┴──────────────┘

// New behaviour - backwards compatible with default v4 address only

vscode ➜ /workspaces/netlab/tests (dev) $ ../netlab status
Lab default in /workspaces/netlab/tests
  status:      started
  topology:    platform-integration/cli/13-status-mgmt-v4-only.yml
  provider(s): clab

┏━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ node ┃ device ┃ image              ┃ mgmt           ┃ connection ┃ provider ┃ VM/container ┃ status        ┃
┡━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ x    │ linux  │ python:3.13-alpine │ 192.168.121.21 │ docker     │ clab     │ clab-cli-x   │ Up 10 seconds │
└──────┴────────┴────────────────────┴────────────────┴────────────┴──────────┴──────────────┴───────────────┘

// New behaviour - dual-stack support

vscode ➜ /workspaces/netlab/tests (dev) $ ../netlab status
Lab default in /workspaces/netlab/tests
  status:      started
  topology:    platform-integration/cli/12-status-mgmt-dual-stack.yml
  provider(s): clab

┏━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ node ┃ device ┃ image              ┃ mgmt             ┃ connection ┃ provider ┃ VM/container ┃ status        ┃
┡━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ x    │ linux  │ python:3.13-alpine │ 192.168.121.11   │ docker     │ clab     │ clab-cli-x   │ Up 17 seconds │
│      │        │                    │ 2001:db8:121::11 │            │          │              │               │
└──────┴────────┴────────────────────┴──────────────────┴────────────┴──────────┴──────────────┴───────────────┘

Changes:

  1. Show IPv6 management address on a new line under IPv4 in status mgmt column.
  2. Add platform integration test for v4-only and dual-stack status output.
  3. Fix integration validation script warning by initializing error counter and quoting file paths.

Copilot AI review requested due to automatic review settings June 27, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the netlab status CLI output to improve management IP visibility by showing dual-stack (IPv4 + IPv6) management addressing, and adds platform integration tests to cover the new status output behavior.

Changes:

  • Update netlab status to display IPv6 management addresses (when present) alongside IPv4 in the mgmt column.
  • Add platform integration CLI tests for IPv4-only and dual-stack mgmt status output.
  • Fix tests/check-integration-tests.sh robustness by initializing the error counter and quoting file paths.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
netsim/cli/status.py Adds IPv6 mgmt capture and renders mgmt as multi-line output in the status table.
tests/platform-integration/cli/12-status-mgmt-dual-stack.yml New integration test ensuring status output contains both IPv4 and IPv6 mgmt addresses.
tests/platform-integration/cli/13-status-mgmt-v4-only.yml New integration test ensuring status output contains the IPv4 mgmt address for IPv4-only nodes.
tests/check-integration-tests.sh Initializes err_cnt and quotes $file to avoid validation script warnings/word-splitting issues.

Comment thread netsim/cli/status.py
Comment thread netsim/cli/status.py
@moogzy moogzy requested a review from Copilot June 27, 2026 09:08
@moogzy moogzy changed the title status: improve dual-stack mgmt display and integration coverage status: Add dual-stack mgmt address support and integration coverage Jun 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread tests/check-integration-tests.sh
Comment thread netsim/cli/status.py
Fixes ipspace#3358

What changed:

- Render node management addresses in netlab status with IPv6 on a new line under IPv4 in the mgmt column.

- Add platform integration test tests/platform-integration/cli/12-status-mgmt.yml to validate dual-stack mgmt output.

- Harden tests/check-integration-tests.sh by initializing err_cnt and quoting topology path arguments.

Why:

- The status output did not clearly present dual-stack management addresses and could be ambiguous/truncated in narrow output.

- Integration validation emitted a noisy shell warning when err_cnt was unset.
@moogzy moogzy force-pushed the enhancement/add_dualstack_mgmt_address_support_to_status branch from 521a636 to 464919e Compare June 27, 2026 09:32
Comment thread netsim/cli/status.py
'mgmt': n_data.mgmt.ipv4
}
node_stat = ls.nodes[n_name]
if n_data.get('mgmt.ipv6'):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perfectly fine, but if you want, you could rewrite this whole thing into a loop over a dict mapping node data into status data.

@ipspace ipspace left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job. The "do not set mgmt on tools" should be reverted because it changes JSON data. Other than that, it's just a few minor quirks/nits.

Thank you!

Comment thread netsim/cli/status.py
wk_state = p_status[n_provider].get(wk_name,get_empty_box())
ls.nodes[t_name] = {
'device': '(tool)',
'mgmt': '',

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed

Comment thread netsim/cli/status.py
def show_lab_nodes(ls: Box, topology: Box) -> None:
rows = []
heading = [ 'node', 'device', 'image', 'mgmt IPv4', 'connection', 'provider', 'VM/container', 'status']
heading = [ 'node', 'device', 'image', 'mgmt', 'connection', 'provider', 'VM/container', 'status']

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "mgmt IP"?

Comment thread netsim/cli/status.py

for n_name,n_data in ls.nodes.items():
row = [ n_name, n_data.device, n_data.image, n_data.get('mgmt',''),
mgmt = f'{n_data.mgmt}\n{n_data.mgmt6}' if n_data.get('mgmt6') else n_data.get('mgmt')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you leave the old n_data.get('mgmt','') as the fallback expression, then you don't need to set 'mgmt' for tools.

@@ -0,0 +1,26 @@
---
message: |

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that you implemented the integration tests, but I'd put v4 only test first (just swap the sequence numbers) and use a topology that combines libvirt, clab, and a tool, so that we test whether status works over all three objects.

Comment thread tests/check-integration-tests.sh
Comment thread docs/netlab/status.md

┏━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ node ┃ device ┃ image ┃ mgmt IPv4 ┃ connection ┃ provider ┃ VM/container ┃ status ┃
┃ node ┃ device ┃ image ┃ mgmt ┃ connection ┃ provider ┃ VM/container ┃ status ┃

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would have to change if we go for "mgmt IP" (below)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants