Skip to content

Commit

Permalink
added unit tests for port-security
Browse files Browse the repository at this point in the history
  • Loading branch information
AAYUSH2091 committed Nov 17, 2024
1 parent 2368fcd commit 78c0ee0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Feature Name Instance State
-------------------- -------- -----
nve 1 disabled
ospf 1 enabled
eth-port-sec 1 enabled
9 changes: 9 additions & 0 deletions tests/unit/modules/network/nxos/test_nxos_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def test_nxos_feature_disable(self):
result = self.execute_module(changed=True)
self.assertEqual(result["commands"], ["terminal dont-ask", "no feature ospf"])

def test_nxos_feature_port_security_disable(self):
set_module_args(dict(feature="port-security", state="disabled"))
result = self.execute_module(changed=True)
self.assertEqual(result["commands"], ["terminal dont-ask", "no feature port-security"])

class TestNxosFeatureModuleMDS(TestNxosModule):
module = nxos_feature
Expand Down Expand Up @@ -171,3 +175,8 @@ def test_nxos_feature_disable_already_disabled(self):
set_module_args(dict(feature="sftp-server", state="disabled"))
result = self.execute_module(changed=False)
self.assertEqual(result["commands"], [])

def test_nxos_feature_port_security_enable(self):
set_module_args(dict(feature="port-security", state="enabled"))
result = self.execute_module(changed=True)
self.assertEqual(result["commands"], ["terminal dont-ask", "feature port-security"])

0 comments on commit 78c0ee0

Please sign in to comment.