mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
fix nios modules (#48559)
* resolves 47839 * update name * update name Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * update name tests Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * update name tests Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * modifying the condn Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
This commit is contained in:
@@ -131,3 +131,29 @@ class TestNiosARecordModule(TestNiosModule):
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.delete_object.assert_called_once_with(ref)
|
||||
|
||||
def test_nios_a_record_update_record_name(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': {'new_name': 'a_new.ansible.com', 'old_name': 'a.ansible.com'},
|
||||
'comment': 'comment', 'extattrs': None}
|
||||
|
||||
test_object = [
|
||||
{
|
||||
"comment": "test comment",
|
||||
"_ref": "arecord/ZG5zLm5ldHdvcmtfdmlldyQw:default/true",
|
||||
"name": "a_new.ansible.com",
|
||||
"old_name": "a.ansible.com",
|
||||
"extattrs": {}
|
||||
}
|
||||
]
|
||||
|
||||
test_spec = {
|
||||
"name": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
|
||||
wapi = self._get_wapi(test_object)
|
||||
res = wapi.run('testobject', test_spec)
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.update_object.called_once_with(test_object)
|
||||
|
||||
@@ -131,3 +131,29 @@ class TestNiosAAAARecordModule(TestNiosModule):
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.delete_object.assert_called_once_with(ref)
|
||||
|
||||
def test_nios_aaaa_record_update_record_name(self):
|
||||
self.module.params = {'provider': None, 'state': 'present', 'name': {'new_name': 'aaaa_new.ansible.com', 'old_name': 'aaaa.ansible.com'},
|
||||
'comment': 'comment', 'extattrs': None}
|
||||
|
||||
test_object = [
|
||||
{
|
||||
"comment": "test comment",
|
||||
"_ref": "aaaarecord/ZG5zLm5ldHdvcmtfdmlldyQw:default/true",
|
||||
"name": "aaaa_new.ansible.com",
|
||||
"old_name": "aaaa.ansible.com",
|
||||
"extattrs": {}
|
||||
}
|
||||
]
|
||||
|
||||
test_spec = {
|
||||
"name": {"ib_req": True},
|
||||
"comment": {},
|
||||
"extattrs": {}
|
||||
}
|
||||
|
||||
wapi = self._get_wapi(test_object)
|
||||
res = wapi.run('testobject', test_spec)
|
||||
|
||||
self.assertTrue(res['changed'])
|
||||
wapi.update_object.called_once_with(test_object)
|
||||
|
||||
Reference in New Issue
Block a user