Skip to content

Commit b152f2a

Browse files
authored
[sonic-cfggen]: Update unit test to remove asn 0 (#10454)
Why I did it ASN range is from 1 to 4294967295, need to remove invalid ASN. How I did it Update unit test and replace ASN 0. How to verify it Run unit test for sonic-config-engine. Signed-off-by: Gang Lv [email protected]
1 parent ce26c04 commit b152f2a

6 files changed

+6
-6
lines changed

src/sonic-config-engine/tests/radv-test-sample-graph.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</PeeringSessions>
9191
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
9292
<a:BGPRouterDeclaration>
93-
<a:ASN>0</a:ASN>
93+
<a:ASN>1</a:ASN>
9494
<a:BgpGroups/>
9595
<a:Hostname>BGPMonitor</a:Hostname>
9696
<a:Peers>

src/sonic-config-engine/tests/sample-graph-resource-type.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</PeeringSessions>
7373
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
7474
<a:BGPRouterDeclaration>
75-
<a:ASN>0</a:ASN>
75+
<a:ASN>1</a:ASN>
7676
<a:BgpGroups/>
7777
<a:Hostname>BGPMonitor</a:Hostname>
7878
<a:Peers>

src/sonic-config-engine/tests/sample-graph-subintf.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</PeeringSessions>
7373
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
7474
<a:BGPRouterDeclaration>
75-
<a:ASN>0</a:ASN>
75+
<a:ASN>1</a:ASN>
7676
<a:BgpGroups/>
7777
<a:Hostname>BGPMonitor</a:Hostname>
7878
<a:Peers>

src/sonic-config-engine/tests/simple-sample-graph.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</PeeringSessions>
7373
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
7474
<a:BGPRouterDeclaration>
75-
<a:ASN>0</a:ASN>
75+
<a:ASN>1</a:ASN>
7676
<a:BgpGroups/>
7777
<a:Hostname>BGPMonitor</a:Hostname>
7878
<a:Peers>

src/sonic-config-engine/tests/t0-sample-graph.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</PeeringSessions>
9191
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
9292
<a:BGPRouterDeclaration>
93-
<a:ASN>0</a:ASN>
93+
<a:ASN>1</a:ASN>
9494
<a:BgpGroups/>
9595
<a:Hostname>BGPMonitor</a:Hostname>
9696
<a:Peers>

src/sonic-config-engine/tests/test_cfggen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ def test_minigraph_bgp_mon(self):
685685
output = self.run_script(argument)
686686
self.assertEqual(
687687
utils.to_dict(output.strip()),
688-
utils.to_dict("{'10.20.30.40': {'rrclient': 0, 'name': 'BGPMonitor', 'local_addr': '10.1.0.32', 'nhopself': 0, 'holdtime': '10', 'asn': '0', 'keepalive': '3'}}")
688+
utils.to_dict("{'10.20.30.40': {'rrclient': 0, 'name': 'BGPMonitor', 'local_addr': '10.1.0.32', 'nhopself': 0, 'holdtime': '10', 'asn': '1', 'keepalive': '3'}}")
689689
)
690690

691691
def test_minigraph_bgp_voq_chassis_peer(self):

0 commit comments

Comments
 (0)