Skip to content

Commit

Permalink
[pfsense_interface] Test removal of interface that is part of an inte…
Browse files Browse the repository at this point in the history
…rface group
  • Loading branch information
opoplawski committed Jan 4, 2024
1 parent a40f1ac commit 3663636
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@
<ifgroupentry>
<ifname>IFGROUP1</ifname>
<descr></descr>
<members>opt1 opt2 opt3</members>
<members>opt1 opt3</members>
</ifgroupentry>
</ifgroups>
<vlans>
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/plugins/modules/test_pfsense_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ def test_interface_delete_lan(self):
]
self.do_module_test(interface, delete=True, command=commands)

def test_interface_delete_fails(self):
""" test deletion of an interface that is part of a group """
interface = dict(descr='vmx1.1100', state='absent')
msg = "The interface is part of the group IFGROUP1. Please remove it from the group first."
self.do_module_test(interface, failed=True, msg=msg)

def test_interface_update_noop(self):
""" test not updating a interface """
interface = dict(descr='lan_1100', interface='vmx1.1100', enable=True, ipv4_type='static', ipv4_address='172.16.151.210', ipv4_prefixlen=24)
Expand Down

0 comments on commit 3663636

Please sign in to comment.