Skip to content

Commit 24958ff

Browse files
committed
Updated review comments.
1 parent d9e9df6 commit 24958ff

File tree

3 files changed

+23
-31
lines changed

3 files changed

+23
-31
lines changed

tests/mock_tables/config_db.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,10 @@
13551355
"vni" : "200",
13561356
"vlan": "Vlan200"
13571357
},
1358+
"VRF|Vrf1": {
1359+
"fallback": "false",
1360+
"vni" : "1000"
1361+
},
13581362
"BUFFER_POOL|egress_lossless_pool": {
13591363
"mode": "dynamic",
13601364
"size": "13945824",

tests/vxlan_test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@
3131
3232
"""
3333

34+
show_vxlan_vrfvnimap_output="""\
35+
+-------+-------+
36+
| VRF | VNI |
37+
+=======+=======+
38+
| Vrf1 | 1000 |
39+
+-------+-------+
40+
Total count : 1
41+
42+
"""
43+
44+
3445
show_vxlan_tunnel_output="""\
3546
+---------+-------------+-------------------+--------------+
3647
| SIP | DIP | Creation Source | OperStatus |
@@ -110,6 +121,14 @@ def test_show_vxlan_vlanvnimap(self):
110121
assert result.exit_code == 0
111122
assert result.output == show_vxlan_vlanvnimap_output
112123

124+
def test_show_vxlan_vrfvnimap(self):
125+
runner = CliRunner()
126+
result = runner.invoke(show.cli.commands["vxlan"].commands["vrfvnimap"], [])
127+
print(result.exit_code)
128+
print(result.output)
129+
assert result.exit_code == 0
130+
assert result.output == show_vxlan_vrfvnimap_output
131+
113132
def test_show_vxlan_tunnel(self):
114133
runner = CliRunner()
115134
result = runner.invoke(show.cli.commands["vxlan"].commands["remotevtep"], [])

utilities_common/cli.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -301,37 +301,6 @@ def is_port_mirror_dst_port(config_db, port):
301301

302302
return False
303303

304-
#
305-
# Use this method to validate unicast IPv4 address
306-
#
307-
def is_ip4_addr_valid(addr, display):
308-
v4_invalid_list = [ipaddress.IPv4Address(unicode('0.0.0.0')), ipaddress.IPv4Address(unicode('255.255.255.255'))]
309-
try:
310-
ip = ipaddress.ip_address(unicode(addr))
311-
if (ip.version == 4):
312-
if (ip.is_reserved):
313-
if display:
314-
click.echo ("{} Not Valid, Reason: IPv4 reserved address range.".format(addr))
315-
return False
316-
elif (ip.is_multicast):
317-
if display:
318-
click.echo ("{} Not Valid, Reason: IPv4 Multicast address range.".format(addr))
319-
return False
320-
elif (ip in v4_invalid_list):
321-
if display:
322-
click.echo ("{} Not Valid.".format(addr))
323-
return False
324-
else:
325-
return True
326-
327-
else:
328-
if display:
329-
click.echo ("{} Not Valid, Reason: Not an IPv4 address".format(addr))
330-
return False
331-
332-
except ValueError:
333-
return False
334-
335304
def vni_id_is_valid(vni):
336305
"""Check if the vni id is in acceptable range (between 1 and 2^24)
337306
"""

0 commit comments

Comments
 (0)