Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[link-local]Modify RIF check to include link-local enabled interfaces #2394

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/ipv6_link_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
+------------------+----------+
| Ethernet36 | Disabled |
+------------------+----------+
| Ethernet40 | Disabled |
| Ethernet40 | Enabled |
+------------------+----------+
| Ethernet44 | Disabled |
+------------------+----------+
Expand Down Expand Up @@ -224,6 +224,16 @@ def test_config_enable_disable_ipv6_link_local_on_all_valid_interfaces(self):
assert result.exit_code == 0
assert result.output == ''

def test_vlan_member_add_on_link_local_interface(self):
runner = CliRunner()
db = Db()
obj = {'config_db':db.cfgdb, 'namespace':db.db.namespace}

result = runner.invoke(config.config.commands["vlan"].commands["member"].commands["add"], ["4000", "Ethernet40"], obj=obj)
print(result.output)
assert result.exit_code != 0
assert 'Error: Ethernet40 is a router interface!' in result.output

@classmethod
def teardown_class(cls):
os.environ['UTILITIES_UNIT_TESTING'] = "0"
Expand Down
3 changes: 3 additions & 0 deletions tests/mock_tables/config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,9 @@
"INTERFACE|Ethernet0|14.14.0.1/24": {
"NULL": "NULL"
},
"INTERFACE|Ethernet40": {
"ipv6_use_link_local_only": "enable"
},
"DEBUG_COUNTER|DEBUG_0": {
"type": "PORT_INGRESS_DROPS"
},
Expand Down
4 changes: 2 additions & 2 deletions utilities_common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def is_port_router_interface(config_db, port):

interface_table = config_db.get_table('INTERFACE')
for intf in interface_table:
if port == intf[0]:
if port == intf:
return True

return False
Expand All @@ -304,7 +304,7 @@ def is_pc_router_interface(config_db, pc):

pc_interface_table = config_db.get_table('PORTCHANNEL_INTERFACE')
for intf in pc_interface_table:
if pc == intf[0]:
if pc == intf:
return True

return False
Expand Down