netdryrun 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netdryrun-0.1.0/.github/workflows/ci.yml +56 -0
- netdryrun-0.1.0/.github/workflows/release.yml +58 -0
- netdryrun-0.1.0/.gitignore +8 -0
- netdryrun-0.1.0/LICENSE +201 -0
- netdryrun-0.1.0/PKG-INFO +175 -0
- netdryrun-0.1.0/README.md +152 -0
- netdryrun-0.1.0/action.yml +130 -0
- netdryrun-0.1.0/docs/DESIGN.md +30 -0
- netdryrun-0.1.0/examples/frr-bgp/configs/daemons +23 -0
- netdryrun-0.1.0/examples/frr-bgp/configs/r1.conf +26 -0
- netdryrun-0.1.0/examples/frr-bgp/configs/r2.conf +26 -0
- netdryrun-0.1.0/examples/frr-bgp/configs/r3.conf +26 -0
- netdryrun-0.1.0/examples/frr-bgp/configs/vtysh.conf +1 -0
- netdryrun-0.1.0/examples/frr-bgp/netdryrun.yml +29 -0
- netdryrun-0.1.0/examples/frr-bgp/topology.clab.yml +27 -0
- netdryrun-0.1.0/examples/frr-bgp-broken/netdryrun.yml +30 -0
- netdryrun-0.1.0/examples/frr-bgp-broken/r2-bad.conf +28 -0
- netdryrun-0.1.0/examples/frr-bgp-broken/topology.clab.yml +28 -0
- netdryrun-0.1.0/examples/srl-frr/configs/daemons +23 -0
- netdryrun-0.1.0/examples/srl-frr/configs/frr1.conf +20 -0
- netdryrun-0.1.0/examples/srl-frr/configs/srl1.cli +16 -0
- netdryrun-0.1.0/examples/srl-frr/configs/vtysh.conf +1 -0
- netdryrun-0.1.0/examples/srl-frr/netdryrun.yml +27 -0
- netdryrun-0.1.0/examples/srl-frr/topology.clab.yml +18 -0
- netdryrun-0.1.0/pyproject.toml +38 -0
- netdryrun-0.1.0/scripts/dev.sh +13 -0
- netdryrun-0.1.0/scripts/e2e.sh +15 -0
- netdryrun-0.1.0/src/netdryrun/__init__.py +3 -0
- netdryrun-0.1.0/src/netdryrun/checks.py +164 -0
- netdryrun-0.1.0/src/netdryrun/cli.py +88 -0
- netdryrun-0.1.0/src/netdryrun/config.py +142 -0
- netdryrun-0.1.0/src/netdryrun/drivers/__init__.py +32 -0
- netdryrun-0.1.0/src/netdryrun/drivers/base.py +57 -0
- netdryrun-0.1.0/src/netdryrun/drivers/frr.py +88 -0
- netdryrun-0.1.0/src/netdryrun/drivers/srlinux.py +91 -0
- netdryrun-0.1.0/src/netdryrun/lab.py +113 -0
- netdryrun-0.1.0/src/netdryrun/mcp_server.py +91 -0
- netdryrun-0.1.0/src/netdryrun/report.py +85 -0
- netdryrun-0.1.0/src/netdryrun/runner.py +114 -0
- netdryrun-0.1.0/tests/fixtures/frr_bgp_neighbors.txt +322 -0
- netdryrun-0.1.0/tests/fixtures/frr_ping.txt +8 -0
- netdryrun-0.1.0/tests/fixtures/frr_route.txt +37 -0
- netdryrun-0.1.0/tests/fixtures/srl_bgp_neighbors.txt +182 -0
- netdryrun-0.1.0/tests/fixtures/srl_ping.txt +8 -0
- netdryrun-0.1.0/tests/fixtures/srl_route.txt +29 -0
- netdryrun-0.1.0/tests/test_checks.py +137 -0
- netdryrun-0.1.0/tests/test_config.py +66 -0
- netdryrun-0.1.0/tests/test_drivers.py +49 -0
- netdryrun-0.1.0/tests/test_mcp.py +36 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
unit:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
python: ["3.10", "3.12", "3.13"]
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python }}
|
|
23
|
+
- run: python -m pip install -e ".[dev]"
|
|
24
|
+
- run: pytest -q
|
|
25
|
+
|
|
26
|
+
e2e:
|
|
27
|
+
needs: unit
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
strategy:
|
|
30
|
+
fail-fast: false
|
|
31
|
+
matrix:
|
|
32
|
+
example: [frr-bgp, srl-frr]
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
- uses: ./
|
|
36
|
+
with:
|
|
37
|
+
path: examples/${{ matrix.example }}
|
|
38
|
+
artifact-name: report-${{ matrix.example }}
|
|
39
|
+
|
|
40
|
+
# Proves the tool catches a real mistake: this run MUST fail.
|
|
41
|
+
catches-bad-change:
|
|
42
|
+
needs: unit
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
- id: ndr
|
|
47
|
+
uses: ./
|
|
48
|
+
continue-on-error: true
|
|
49
|
+
with:
|
|
50
|
+
path: examples/frr-bgp-broken
|
|
51
|
+
artifact-name: report-frr-bgp-broken
|
|
52
|
+
- name: Expect failure
|
|
53
|
+
run: |
|
|
54
|
+
echo "status=${{ steps.ndr.outputs.status }} failed=${{ steps.ndr.outputs.failed }}"
|
|
55
|
+
test "${{ steps.ndr.outputs.status }}" = "failed"
|
|
56
|
+
test "${{ steps.ndr.outputs.failed }}" -ge 1
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishes to PyPI with Trusted Publishing (OIDC): no tokens or passwords are stored anywhere.
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- name: Check tag matches package version
|
|
20
|
+
run: |
|
|
21
|
+
pkg="$(python -c "import re,pathlib;print(re.search(r'__version__ = \"(.+?)\"', pathlib.Path('src/netdryrun/__init__.py').read_text()).group(1))")"
|
|
22
|
+
test "v$pkg" = "$GITHUB_REF_NAME" || { echo "tag $GITHUB_REF_NAME != package v$pkg"; exit 1; }
|
|
23
|
+
- run: python -m pip install --quiet build && python -m build
|
|
24
|
+
- uses: actions/upload-artifact@v4
|
|
25
|
+
with:
|
|
26
|
+
name: dist
|
|
27
|
+
path: dist/
|
|
28
|
+
|
|
29
|
+
publish:
|
|
30
|
+
needs: build
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
environment:
|
|
33
|
+
name: pypi
|
|
34
|
+
url: https://pypi.org/project/netdryrun/
|
|
35
|
+
permissions:
|
|
36
|
+
id-token: write # required for Trusted Publishing
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/download-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: dist
|
|
41
|
+
path: dist/
|
|
42
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
43
|
+
|
|
44
|
+
github-release:
|
|
45
|
+
needs: publish
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
permissions:
|
|
48
|
+
contents: write
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/download-artifact@v4
|
|
51
|
+
with:
|
|
52
|
+
name: dist
|
|
53
|
+
path: dist/
|
|
54
|
+
- env:
|
|
55
|
+
GH_TOKEN: ${{ github.token }}
|
|
56
|
+
TAG: ${{ github.ref_name }}
|
|
57
|
+
REPO: ${{ github.repository }}
|
|
58
|
+
run: gh release create "$TAG" dist/* --repo "$REPO" --title "NetDryRun $TAG" --generate-notes
|
netdryrun-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
netdryrun-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: netdryrun
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Test network changes before they touch production: real virtual labs, behavioral checks, evidence.
|
|
5
|
+
Project-URL: Homepage, https://netdryrun.com
|
|
6
|
+
Project-URL: Source, https://github.com/netdryrun/netdryrun
|
|
7
|
+
Author: NetDryRun
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: bgp,ci,containerlab,frr,netdevops,network,srlinux,testing
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: System Administrators
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: System :: Networking
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Requires-Dist: pyyaml>=6.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: mcp<3,>=2.0; extra == 'dev'
|
|
19
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
20
|
+
Provides-Extra: mcp
|
|
21
|
+
Requires-Dist: mcp<3,>=2.0; extra == 'mcp'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# NetDryRun
|
|
25
|
+
|
|
26
|
+
**Test network changes before they touch production.**
|
|
27
|
+
|
|
28
|
+
NetDryRun boots your topology as a real virtual network ([containerlab](https://containerlab.dev)), applies your configs, and checks how the network actually *behaves*: BGP sessions, prefix counts, routes, reachability. It catches mistakes like route leaks before they reach production, and leaves evidence a reviewer can trust.
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
$ netdryrun run examples/frr-bgp-broken
|
|
32
|
+
Deploying lab ndr-frr-broken (3 nodes)...
|
|
33
|
+
[PASS] r1: BGP session to 10.0.12.2 is established -- state is established (6.3s)
|
|
34
|
+
[PASS] r1: prefixes from 10.0.12.2 >= 1 and <= 10 -- 3 ipv4-unicast prefixes accepted (0.1s)
|
|
35
|
+
[PASS] r1: ping 192.168.3.1 from 192.168.1.1 expects success -- 3/3 replies (2.3s)
|
|
36
|
+
[FAIL] r1: route 0.0.0.0/0 via bgp is absent -- unexpectedly present via bgp (not selected) (0.1s)
|
|
37
|
+
FAILED: 5 passed, 1 failed (6 checks)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
That run caught a leaked default route that was *received but not selected*. A ping test or a config linter would have missed it.
|
|
41
|
+
|
|
42
|
+
> Status: **v0.1, early.** Works today with FRR and Nokia SR Linux on Linux and WSL2. Feedback and issues are very welcome.
|
|
43
|
+
|
|
44
|
+
## Why
|
|
45
|
+
|
|
46
|
+
- **It tests behavior, not syntax.** Linters and config diffs can't tell you whether BGP will come up or whether a prefix leaks. A real control plane can.
|
|
47
|
+
- **It's built for CI.** One GitHub Action, a pass/fail exit code, a Markdown summary in the job, JUnit XML, and a JSON evidence file with every command and raw output.
|
|
48
|
+
- **It doesn't lie about convergence.** Positive checks wait for the network to converge. Negative checks ("this route must be absent") run only after convergence and must hold for a time window, so they can't pass just because BGP hasn't come up yet.
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
51
|
+
|
|
52
|
+
Requirements: Linux or WSL2, Docker, [containerlab](https://containerlab.dev/install/), Python 3.10+.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install netdryrun
|
|
56
|
+
git clone https://github.com/netdryrun/netdryrun && cd netdryrun
|
|
57
|
+
netdryrun run examples/frr-bgp # 3 FRR routers, should pass
|
|
58
|
+
netdryrun run examples/srl-frr # SR Linux + FRR, should pass
|
|
59
|
+
netdryrun run examples/frr-bgp-broken # a bad change, should fail
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## netdryrun.yml
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
lab: topology.clab.yml # your containerlab topology
|
|
66
|
+
timeout: 90 # seconds a positive check may wait for convergence
|
|
67
|
+
|
|
68
|
+
checks:
|
|
69
|
+
- type: bgp_session # session reaches a state (default: established)
|
|
70
|
+
node: r1
|
|
71
|
+
neighbor: 10.0.12.2
|
|
72
|
+
- type: bgp_prefixes # accepted prefix count within a range
|
|
73
|
+
node: r1
|
|
74
|
+
neighbor: 10.0.12.2
|
|
75
|
+
min: 1
|
|
76
|
+
max: 10
|
|
77
|
+
- type: route # route present (or absent), optionally via a protocol
|
|
78
|
+
node: r1
|
|
79
|
+
prefix: 192.168.3.0/24
|
|
80
|
+
protocol: bgp
|
|
81
|
+
- type: ping # reachability, optionally from a source address
|
|
82
|
+
node: r1
|
|
83
|
+
source: 192.168.1.1
|
|
84
|
+
target: 192.168.3.1
|
|
85
|
+
- type: route # negative check: must stay absent after convergence
|
|
86
|
+
node: r1
|
|
87
|
+
prefix: 0.0.0.0/0
|
|
88
|
+
protocol: bgp
|
|
89
|
+
present: false
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Every check also accepts `name`, `timeout` and `vrf`. Ping accepts `expect: failure` and `count`. Drivers are detected from the topology; override them with `nodes: {r1: {driver: frr}}`.
|
|
93
|
+
|
|
94
|
+
| Check | FRR | SR Linux |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `bgp_session` | ✅ | ✅ |
|
|
97
|
+
| `bgp_prefixes` (accepted = received minus rejected by policy) | ✅ | ✅ |
|
|
98
|
+
| `route` present / absent | ✅ | ✅ |
|
|
99
|
+
| `ping` success / failure | ✅ | ✅ |
|
|
100
|
+
|
|
101
|
+
## Commands
|
|
102
|
+
|
|
103
|
+
| Command | What it does |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `netdryrun run [path]` | Deploy the lab, run the checks, destroy the lab. Add `--keep` to leave it up for debugging |
|
|
106
|
+
| `netdryrun check [path]` | Run the checks against a lab that is already running |
|
|
107
|
+
| `netdryrun validate [path]` | Validate `netdryrun.yml` without running anything |
|
|
108
|
+
|
|
109
|
+
Reports: `--json FILE` (full evidence), `--markdown FILE`, `--junit FILE`. Under GitHub Actions, a summary is appended to the job page automatically. Exit codes: `0` passed, `1` a check failed, `2` config or lab error.
|
|
110
|
+
|
|
111
|
+
## GitHub Action
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
name: Network dry run
|
|
115
|
+
on: pull_request
|
|
116
|
+
jobs:
|
|
117
|
+
dryrun:
|
|
118
|
+
runs-on: ubuntu-latest
|
|
119
|
+
steps:
|
|
120
|
+
- uses: actions/checkout@v4
|
|
121
|
+
- uses: netdryrun/netdryrun@v0.1.0
|
|
122
|
+
with:
|
|
123
|
+
path: network/ # folder containing netdryrun.yml
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The action installs containerlab, runs the checks, uploads the JSON and JUnit reports as an artifact, and fails the job if any check fails. Outputs: `status`, `passed`, `failed`.
|
|
127
|
+
|
|
128
|
+
## For AI agents (MCP)
|
|
129
|
+
|
|
130
|
+
AI agents are starting to change networks. NetDryRun gives them a safety gate: an [MCP](https://modelcontextprotocol.io) server that lets an agent dry-run its change in a real lab and proceed only if every check passes.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pip install "netdryrun[mcp]"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Add it to your MCP client (for example Claude Code):
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
claude mcp add netdryrun -- netdryrun-mcp
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Tools: `dry_run` (deploy, check, destroy, verdict), `run_checks` (against a running lab), `validate`, `check_types`. Each result carries a separate `verdict` field: `SAFE TO PROCEED` or `DO NOT APPLY THIS CHANGE`.
|
|
143
|
+
|
|
144
|
+
Safety model:
|
|
145
|
+
- The server **never touches production**. It has no tool that pushes config anywhere; it only builds and tests labs.
|
|
146
|
+
- Tool results contain normalized check results, not raw device output, so text inside a lab (a banner, a route description) can't inject instructions into the agent. Raw evidence goes to the JSON report file.
|
|
147
|
+
- A lab is code: containerlab runs privileged containers. Only point the server at topologies you trust, on a machine you'd let run Docker.
|
|
148
|
+
|
|
149
|
+
## How it compares
|
|
150
|
+
|
|
151
|
+
NetDryRun complements these tools; it doesn't replace them.
|
|
152
|
+
|
|
153
|
+
| Tool | What it does best | Where NetDryRun fits |
|
|
154
|
+
|---|---|---|
|
|
155
|
+
| [Batfish](https://batfish.org) | Static analysis of configs, without booting anything; fast and broad | NetDryRun runs the real control plane, so it sees runtime behavior: convergence, timers, what actually lands in the RIB |
|
|
156
|
+
| [netlab](https://netlab.tools) | Builds labs from a high-level topology, with built-in validation | Use netlab to build the lab and NetDryRun for convergence-aware CI gates and evidence reports |
|
|
157
|
+
| [pyATS / Genie](https://developer.cisco.com/pyats/) | A full test framework with deep Cisco parsers | NetDryRun is a small declarative YAML file plus one GitHub Action, with no test code to write |
|
|
158
|
+
| [containerlab](https://containerlab.dev) | Runs the lab | NetDryRun drives containerlab; it doesn't replace it |
|
|
159
|
+
|
|
160
|
+
What NetDryRun adds: positive checks wait for convergence, negative checks run only after convergence and must hold, received-but-not-selected routes count as present, and every run produces one pass/fail plus an evidence file.
|
|
161
|
+
|
|
162
|
+
## Honest limits
|
|
163
|
+
|
|
164
|
+
- Open-source routers are not your vendor's routers. FRR and SR Linux pass/fail is strong evidence for protocol logic and policy intent, but not proof of vendor-specific behavior. Running your own licensed vendor images is on the roadmap.
|
|
165
|
+
- v0.1 covers IPv4/IPv6 unicast BGP, routes and ping. More checks are coming: OSPF/IS-IS adjacencies, path/traceroute, policy, failure scenarios.
|
|
166
|
+
|
|
167
|
+
## Roadmap
|
|
168
|
+
|
|
169
|
+
- **Outage replays:** famous real-world outages (route leaks, mass withdrawals) rebuilt as runnable labs and check packs. Would your change have caused one?
|
|
170
|
+
- Failure scenarios (link down, node down), more check types (OSPF/IS-IS, policy attributes, traceroute) and drivers
|
|
171
|
+
- PR comments with diffs, and signed evidence for change tickets
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
Apache-2.0
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# NetDryRun
|
|
2
|
+
|
|
3
|
+
**Test network changes before they touch production.**
|
|
4
|
+
|
|
5
|
+
NetDryRun boots your topology as a real virtual network ([containerlab](https://containerlab.dev)), applies your configs, and checks how the network actually *behaves*: BGP sessions, prefix counts, routes, reachability. It catches mistakes like route leaks before they reach production, and leaves evidence a reviewer can trust.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
$ netdryrun run examples/frr-bgp-broken
|
|
9
|
+
Deploying lab ndr-frr-broken (3 nodes)...
|
|
10
|
+
[PASS] r1: BGP session to 10.0.12.2 is established -- state is established (6.3s)
|
|
11
|
+
[PASS] r1: prefixes from 10.0.12.2 >= 1 and <= 10 -- 3 ipv4-unicast prefixes accepted (0.1s)
|
|
12
|
+
[PASS] r1: ping 192.168.3.1 from 192.168.1.1 expects success -- 3/3 replies (2.3s)
|
|
13
|
+
[FAIL] r1: route 0.0.0.0/0 via bgp is absent -- unexpectedly present via bgp (not selected) (0.1s)
|
|
14
|
+
FAILED: 5 passed, 1 failed (6 checks)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
That run caught a leaked default route that was *received but not selected*. A ping test or a config linter would have missed it.
|
|
18
|
+
|
|
19
|
+
> Status: **v0.1, early.** Works today with FRR and Nokia SR Linux on Linux and WSL2. Feedback and issues are very welcome.
|
|
20
|
+
|
|
21
|
+
## Why
|
|
22
|
+
|
|
23
|
+
- **It tests behavior, not syntax.** Linters and config diffs can't tell you whether BGP will come up or whether a prefix leaks. A real control plane can.
|
|
24
|
+
- **It's built for CI.** One GitHub Action, a pass/fail exit code, a Markdown summary in the job, JUnit XML, and a JSON evidence file with every command and raw output.
|
|
25
|
+
- **It doesn't lie about convergence.** Positive checks wait for the network to converge. Negative checks ("this route must be absent") run only after convergence and must hold for a time window, so they can't pass just because BGP hasn't come up yet.
|
|
26
|
+
|
|
27
|
+
## Quick start
|
|
28
|
+
|
|
29
|
+
Requirements: Linux or WSL2, Docker, [containerlab](https://containerlab.dev/install/), Python 3.10+.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install netdryrun
|
|
33
|
+
git clone https://github.com/netdryrun/netdryrun && cd netdryrun
|
|
34
|
+
netdryrun run examples/frr-bgp # 3 FRR routers, should pass
|
|
35
|
+
netdryrun run examples/srl-frr # SR Linux + FRR, should pass
|
|
36
|
+
netdryrun run examples/frr-bgp-broken # a bad change, should fail
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## netdryrun.yml
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
lab: topology.clab.yml # your containerlab topology
|
|
43
|
+
timeout: 90 # seconds a positive check may wait for convergence
|
|
44
|
+
|
|
45
|
+
checks:
|
|
46
|
+
- type: bgp_session # session reaches a state (default: established)
|
|
47
|
+
node: r1
|
|
48
|
+
neighbor: 10.0.12.2
|
|
49
|
+
- type: bgp_prefixes # accepted prefix count within a range
|
|
50
|
+
node: r1
|
|
51
|
+
neighbor: 10.0.12.2
|
|
52
|
+
min: 1
|
|
53
|
+
max: 10
|
|
54
|
+
- type: route # route present (or absent), optionally via a protocol
|
|
55
|
+
node: r1
|
|
56
|
+
prefix: 192.168.3.0/24
|
|
57
|
+
protocol: bgp
|
|
58
|
+
- type: ping # reachability, optionally from a source address
|
|
59
|
+
node: r1
|
|
60
|
+
source: 192.168.1.1
|
|
61
|
+
target: 192.168.3.1
|
|
62
|
+
- type: route # negative check: must stay absent after convergence
|
|
63
|
+
node: r1
|
|
64
|
+
prefix: 0.0.0.0/0
|
|
65
|
+
protocol: bgp
|
|
66
|
+
present: false
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Every check also accepts `name`, `timeout` and `vrf`. Ping accepts `expect: failure` and `count`. Drivers are detected from the topology; override them with `nodes: {r1: {driver: frr}}`.
|
|
70
|
+
|
|
71
|
+
| Check | FRR | SR Linux |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `bgp_session` | ✅ | ✅ |
|
|
74
|
+
| `bgp_prefixes` (accepted = received minus rejected by policy) | ✅ | ✅ |
|
|
75
|
+
| `route` present / absent | ✅ | ✅ |
|
|
76
|
+
| `ping` success / failure | ✅ | ✅ |
|
|
77
|
+
|
|
78
|
+
## Commands
|
|
79
|
+
|
|
80
|
+
| Command | What it does |
|
|
81
|
+
|---|---|
|
|
82
|
+
| `netdryrun run [path]` | Deploy the lab, run the checks, destroy the lab. Add `--keep` to leave it up for debugging |
|
|
83
|
+
| `netdryrun check [path]` | Run the checks against a lab that is already running |
|
|
84
|
+
| `netdryrun validate [path]` | Validate `netdryrun.yml` without running anything |
|
|
85
|
+
|
|
86
|
+
Reports: `--json FILE` (full evidence), `--markdown FILE`, `--junit FILE`. Under GitHub Actions, a summary is appended to the job page automatically. Exit codes: `0` passed, `1` a check failed, `2` config or lab error.
|
|
87
|
+
|
|
88
|
+
## GitHub Action
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
name: Network dry run
|
|
92
|
+
on: pull_request
|
|
93
|
+
jobs:
|
|
94
|
+
dryrun:
|
|
95
|
+
runs-on: ubuntu-latest
|
|
96
|
+
steps:
|
|
97
|
+
- uses: actions/checkout@v4
|
|
98
|
+
- uses: netdryrun/netdryrun@v0.1.0
|
|
99
|
+
with:
|
|
100
|
+
path: network/ # folder containing netdryrun.yml
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The action installs containerlab, runs the checks, uploads the JSON and JUnit reports as an artifact, and fails the job if any check fails. Outputs: `status`, `passed`, `failed`.
|
|
104
|
+
|
|
105
|
+
## For AI agents (MCP)
|
|
106
|
+
|
|
107
|
+
AI agents are starting to change networks. NetDryRun gives them a safety gate: an [MCP](https://modelcontextprotocol.io) server that lets an agent dry-run its change in a real lab and proceed only if every check passes.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install "netdryrun[mcp]"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Add it to your MCP client (for example Claude Code):
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
claude mcp add netdryrun -- netdryrun-mcp
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Tools: `dry_run` (deploy, check, destroy, verdict), `run_checks` (against a running lab), `validate`, `check_types`. Each result carries a separate `verdict` field: `SAFE TO PROCEED` or `DO NOT APPLY THIS CHANGE`.
|
|
120
|
+
|
|
121
|
+
Safety model:
|
|
122
|
+
- The server **never touches production**. It has no tool that pushes config anywhere; it only builds and tests labs.
|
|
123
|
+
- Tool results contain normalized check results, not raw device output, so text inside a lab (a banner, a route description) can't inject instructions into the agent. Raw evidence goes to the JSON report file.
|
|
124
|
+
- A lab is code: containerlab runs privileged containers. Only point the server at topologies you trust, on a machine you'd let run Docker.
|
|
125
|
+
|
|
126
|
+
## How it compares
|
|
127
|
+
|
|
128
|
+
NetDryRun complements these tools; it doesn't replace them.
|
|
129
|
+
|
|
130
|
+
| Tool | What it does best | Where NetDryRun fits |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| [Batfish](https://batfish.org) | Static analysis of configs, without booting anything; fast and broad | NetDryRun runs the real control plane, so it sees runtime behavior: convergence, timers, what actually lands in the RIB |
|
|
133
|
+
| [netlab](https://netlab.tools) | Builds labs from a high-level topology, with built-in validation | Use netlab to build the lab and NetDryRun for convergence-aware CI gates and evidence reports |
|
|
134
|
+
| [pyATS / Genie](https://developer.cisco.com/pyats/) | A full test framework with deep Cisco parsers | NetDryRun is a small declarative YAML file plus one GitHub Action, with no test code to write |
|
|
135
|
+
| [containerlab](https://containerlab.dev) | Runs the lab | NetDryRun drives containerlab; it doesn't replace it |
|
|
136
|
+
|
|
137
|
+
What NetDryRun adds: positive checks wait for convergence, negative checks run only after convergence and must hold, received-but-not-selected routes count as present, and every run produces one pass/fail plus an evidence file.
|
|
138
|
+
|
|
139
|
+
## Honest limits
|
|
140
|
+
|
|
141
|
+
- Open-source routers are not your vendor's routers. FRR and SR Linux pass/fail is strong evidence for protocol logic and policy intent, but not proof of vendor-specific behavior. Running your own licensed vendor images is on the roadmap.
|
|
142
|
+
- v0.1 covers IPv4/IPv6 unicast BGP, routes and ping. More checks are coming: OSPF/IS-IS adjacencies, path/traceroute, policy, failure scenarios.
|
|
143
|
+
|
|
144
|
+
## Roadmap
|
|
145
|
+
|
|
146
|
+
- **Outage replays:** famous real-world outages (route leaks, mass withdrawals) rebuilt as runnable labs and check packs. Would your change have caused one?
|
|
147
|
+
- Failure scenarios (link down, node down), more check types (OSPF/IS-IS, policy attributes, traceroute) and drivers
|
|
148
|
+
- PR comments with diffs, and signed evidence for change tickets
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
Apache-2.0
|