Skip to content

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

Closed
dhalperi wants to merge 1 commit into
mainfrom
snapshots-source-restructure
Closed

snapshots: move per-lab build inputs into snapshots/<lab>/source/#180
dhalperi wants to merge 1 commit into
mainfrom
snapshots-source-restructure

Conversation

@dhalperi
Copy link
Copy Markdown
Member

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

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 closed this May 19, 2026
@dhalperi dhalperi deleted the snapshots-source-restructure branch May 19, 2026 19:30
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.

1 participant