Skip to content

snapshots: move per-lab build inputs into snapshots/<lab>/source/#179

Merged
dhalperi merged 1 commit into
mainfrom
spr/main/cd8d8b3f
May 19, 2026
Merged

snapshots: move per-lab build inputs into snapshots/<lab>/source/#179
dhalperi merged 1 commit into
mainfrom
spr/main/cd8d8b3f

Conversation

@dhalperi
Copy link
Copy Markdown
Member

@dhalperi dhalperi commented May 19, 2026

Each lab now keeps its hand-authored topology, startup configs, and
checks.yaml under snapshots/<lab>/source/ alongside the collected
configs/, show/, batfish/, and validation/ directories. This
makes labs self-contained: recollecting requires no hunt through
infra/examples/, and source vs. collected configs sit side by side
for direct comparison (e.g., to confirm whether a community spec
like 12345: survived verbatim or was canonicalized by the device).

Mappings (kebab-case under infra/examples/ -> snake_case snapshot):

ceos-bgp-unnumbered -> eos_ceos_bgp_unnumbered
ceos-bgp-weight-experiment -> eos_ceos_bgp_weight_experiment
ceos-ebgp -> eos_ceos_ebgp
ceos-ospf-unnumbered -> eos_ospf_unnumbered
ceos-switchport-order -> eos_switchport_order
evpn-type5 -> junos_evpn_type5
junos-commit-check -> junos_commit_check
junos-community-delete -> junos_community_delete
junos-cross-term-match -> junos_cross_term_match
junos-policy-chain-visibility -> junos_policy_chain_visibility
junos-rmw-localpref -> junos_rmw_localpref
l3vpn -> junos_l3vpn

The lone generic starter under infra/examples/ (the
two-router-ebgp template, which has no matching snapshot) is kept
as a reference example and consolidated into its own subdir.

infra/README.md is updated to point readers at the new locations
and to document the new snapshot layout.

The test framework only zips configs/, batfish/, aws_configs/,
sonic_configs/, and hosts/ for Batfish, so the new source/
subdir is invisible to validation. Verified with
pytest lab_tests/test_labs.py --labname=junos_rmw_localpref (13/13
pass).


Prompt:

When we built this new lab-validation repo, we put all the
hand-crafted configs in the examples/ folder and then we collected
labs/ into snapshots. This made sense at first, but seems
unmaintainable as we go forward. Every lab gets essentially two
copies occupying two different brain spaces.

I think we should re-organize to put the "infra inputs" -- the
stuff we use to build the lab, the original created configs
configs, the other setup code,config,scripts, the health checks --
in with the lab itself somewhere. In addition to reducing clutter,
that will make the labs self-contained: if we want to recollect
them, all the information will be there. If we have questions
about the input config, they will be there. It will also let us
easily compare our generated configs to the ones from the lab.
This is invaluable in cases like confirming that Junos treats a
BGP community `12345:` as the concrete `12345:0` not the regex
`12345:.*`. It would also be invaluable in the junos_rwm lab,
where I think we actually inaccurately assessed the behavior of
Juniper because what it really does is overwrite the original
local-pref set with the local-pref in our generated configs rather
than 'read from the original value'.

Propose how to do this restructuring.

Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

Each lab now keeps its hand-authored topology, startup configs, and
checks.yaml under `snapshots/<lab>/source/` alongside the collected
`configs/`, `show/`, `batfish/`, and `validation/` directories. This
makes labs self-contained: recollecting requires no hunt through
`infra/examples/`, and source vs. collected configs sit side by side
for direct comparison (e.g., to confirm whether a community spec
like `12345:` survived verbatim or was canonicalized by the device).

Mappings (kebab-case under infra/examples/ -> snake_case snapshot):

  ceos-bgp-unnumbered           -> eos_ceos_bgp_unnumbered
  ceos-bgp-weight-experiment    -> eos_ceos_bgp_weight_experiment
  ceos-ebgp                     -> eos_ceos_ebgp
  ceos-ospf-unnumbered          -> eos_ospf_unnumbered
  ceos-switchport-order         -> eos_switchport_order
  evpn-type5                    -> junos_evpn_type5
  junos-commit-check            -> junos_commit_check
  junos-community-delete        -> junos_community_delete
  junos-cross-term-match        -> junos_cross_term_match
  junos-policy-chain-visibility -> junos_policy_chain_visibility
  junos-rmw-localpref           -> junos_rmw_localpref
  l3vpn                         -> junos_l3vpn

The lone generic starter under `infra/examples/` (the
`two-router-ebgp` template, which has no matching snapshot) is kept
as a reference example and consolidated into its own subdir.

`infra/README.md` is updated to point readers at the new locations
and to document the new snapshot layout.

The test framework only zips `configs/`, `batfish/`, `aws_configs/`,
`sonic_configs/`, and `hosts/` for Batfish, so the new `source/`
subdir is invisible to validation. Verified with
`pytest lab_tests/test_labs.py --labname=junos_rmw_localpref` (13/13
pass).

----

Prompt:
```
When we built this new lab-validation repo, we put all the
hand-crafted configs in the examples/ folder and then we collected
labs/ into snapshots. This made sense at first, but seems
unmaintainable as we go forward. Every lab gets essentially two
copies occupying two different brain spaces.

I think we should re-organize to put the "infra inputs" -- the
stuff we use to build the lab, the original created configs
configs, the other setup code,config,scripts, the health checks --
in with the lab itself somewhere. In addition to reducing clutter,
that will make the labs self-contained: if we want to recollect
them, all the information will be there. If we have questions
about the input config, they will be there. It will also let us
easily compare our generated configs to the ones from the lab.
This is invaluable in cases like confirming that Junos treats a
BGP community `12345:` as the concrete `12345:0` not the regex
`12345:.*`. It would also be invaluable in the junos_rwm lab,
where I think we actually inaccurately assessed the behavior of
Juniper because what it really does is overwrite the original
local-pref set with the local-pref in our generated configs rather
than 'read from the original value'.

Propose how to do this restructuring.
```

commit-id:cd8d8b3f
@dhalperi dhalperi enabled auto-merge (squash) May 19, 2026 19:18
@dhalperi dhalperi disabled auto-merge May 19, 2026 19:18
@dhalperi dhalperi enabled auto-merge (squash) May 19, 2026 19:18
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.59%. Comparing base (ed3f259) to head (aa022bf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #179   +/-   ##
=======================================
  Coverage   83.59%   83.59%           
=======================================
  Files          87       87           
  Lines        4194     4194           
=======================================
  Hits         3506     3506           
  Misses        688      688           
Flag Coverage Δ
unittests 83.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dhalperi dhalperi disabled auto-merge May 19, 2026 19:31
@dhalperi dhalperi enabled auto-merge (squash) May 19, 2026 19:31
@dhalperi dhalperi merged commit 8048e8d into main May 19, 2026
226 checks passed
@dhalperi dhalperi deleted the spr/main/cd8d8b3f branch May 19, 2026 19:38
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.

2 participants