Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
opoplawski committed Jan 5, 2024
1 parent 9cddfab commit 4833d26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/unit/plugins/modules/test_pfsense_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_interface_delete_lan(self):

def test_interface_delete_fails(self):
""" test deletion of an interface that is part of a group """
interface = dict(descr='vmx1.1100', state='absent')
interface = dict(descr='lan_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)

Expand Down
18 changes: 9 additions & 9 deletions tests/unit/plugins/modules/test_pfsense_interface_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def tearDown(self):
def get_target_elt(self, obj, absent=False, module_result=None):
""" get the generated interface group xml definition """
elt_filter = {}
elt_filter['descr'] = obj['descr']
elt_filter['ifname'] = obj['name']

return self.assert_has_xml_tag('ifgroups', elt_filter, absent=absent)

Expand All @@ -66,12 +66,12 @@ def check_target_elt(self, obj, target_elt):

# descr, members
if obj.get('descr'):
self.assert_xml_elt_equal(target_elt, 'descr', obj['mac'])
self.assert_xml_elt_equal(target_elt, 'descr', obj['descr'])
else:
self.assert_xml_elt_is_none_or_empty(target_elt, 'descr')

if obj.get('members'):
self.assert_xml_elt_equal(target_elt, 'members', str(obj['mtu']))
self.assert_xml_elt_equal(target_elt, 'members', ' '.join(obj['members'])))
else:
self.assert_not_find_xml_elt(target_elt, 'members')

Expand All @@ -80,14 +80,14 @@ def check_target_elt(self, obj, target_elt):
#
def test_interface_group_create(self):
""" test creation of a new interface group """
interface_group = dict(name='IFGROUP2', members=['vmx0', 'vmx1'])
command = "create interface group 'IFGROUP2', members='vmx0,vmx1'"
interface_group = dict(name='IFGROUP2', members=['wan', 'lan'])
command = "create interface group 'IFGROUP2', members='wan,lan'"
self.do_module_test(interface_group, command=command)

def test_interface_group_create_with_descr(self):
""" test creation of a new interface group with a description """
interface_group = dict(name='IFGROUP2', members=['vmx0', 'vmx1'], descr='Primary interfaces')
command = "create interface group 'IFGROUP2', descr='Primary interfaces', members='vmx0,vmx1'"
interface_group = dict(name='IFGROUP2', members=['wan', 'lan'], descr='Primary interfaces')
command = "create interface group 'IFGROUP2', descr='Primary interfaces', members='wan,lan'"
self.do_module_test(interface_group, command=command)

def test_interface_group_delete(self):
Expand Down Expand Up @@ -116,13 +116,13 @@ def test_interface_group_update_members(self):
def test_interface_group_error_no_members(self):
""" test error no members specified """
interface_group = dict(name='IFGROUP2', descr='Primary interfaces')
msg = "missing required arguments: members"
msg = "state is present but all of the following are missing: members"
self.do_module_test(interface_group, failed=True, msg=msg)

def test_interface_group_error_member_does_not_exist(self):
""" test error member does not exist """
interface_group = dict(name='IFGROUP2', members=['blah'], descr='Primary interfaces')
msg = 'Unknown interface name "blah"'
msg = 'Unknown interface name "blah".'
self.do_module_test(interface_group, failed=True, msg=msg)

def test_interface_group_error_members_not_uniq(self):
Expand Down

0 comments on commit 4833d26

Please sign in to comment.