|
|
|
@ -60,14 +60,15 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
|
|
|
|
|
def test_nios_ptr_record_create(self):
|
|
|
|
|
self.module.params = {'provider': None, 'state': 'present', 'ptrdname': 'ansible.test.com',
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': None, 'extattrs': None}
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': None, 'extattrs': None, 'view': 'default'}
|
|
|
|
|
|
|
|
|
|
test_object = None
|
|
|
|
|
test_spec = {
|
|
|
|
|
"ipv4addr": {"ib_req": True},
|
|
|
|
|
"ptrdname": {"ib_req": True},
|
|
|
|
|
"comment": {},
|
|
|
|
|
"extattrs": {}
|
|
|
|
|
"extattrs": {},
|
|
|
|
|
"view": {"ib_req": True}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wapi = self._get_wapi(test_object)
|
|
|
|
@ -75,11 +76,11 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
res = wapi.run('testobject', test_spec)
|
|
|
|
|
|
|
|
|
|
self.assertTrue(res['changed'])
|
|
|
|
|
wapi.create_object.assert_called_once_with('testobject', {'ipv4addr': '10.36.241.14', 'ptrdname': 'ansible.test.com'})
|
|
|
|
|
wapi.create_object.assert_called_once_with('testobject', {'ipv4addr': '10.36.241.14', 'ptrdname': 'ansible.test.com', 'view': 'default'})
|
|
|
|
|
|
|
|
|
|
def test_nios_ptr_record_remove(self):
|
|
|
|
|
self.module.params = {'provider': None, 'state': 'absent', 'ptrdname': 'ansible.test.com',
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': None, 'extattrs': None}
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': None, 'extattrs': None, 'view': 'default'}
|
|
|
|
|
|
|
|
|
|
ref = "record:ptr/ZG5zLm5ldHdvcmtfdmlldyQw:14.241.36.10.in-addr.arpa/default"
|
|
|
|
|
|
|
|
|
@ -88,6 +89,7 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
"_ref": ref,
|
|
|
|
|
"ptrdname": "ansible.test.com",
|
|
|
|
|
"ipv4addr": "10.36.241.14",
|
|
|
|
|
"view": "default",
|
|
|
|
|
"extattrs": {'Site': {'value': 'test'}}
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
@ -95,7 +97,8 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
"ipv4addr": {"ib_req": True},
|
|
|
|
|
"ptrdname": {"ib_req": True},
|
|
|
|
|
"comment": {},
|
|
|
|
|
"extattrs": {}
|
|
|
|
|
"extattrs": {},
|
|
|
|
|
"view": {"ib_req": True}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wapi = self._get_wapi(test_object)
|
|
|
|
@ -105,7 +108,7 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
|
|
|
|
|
def test_nios_ptr_record_update_comment(self):
|
|
|
|
|
self.module.params = {'provider': None, 'state': 'present', 'ptrdname': 'ansible.test.com',
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': 'updated comment', 'extattrs': None}
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': 'updated comment', 'extattrs': None, 'view': 'default'}
|
|
|
|
|
|
|
|
|
|
test_object = [
|
|
|
|
|
{
|
|
|
|
@ -113,7 +116,8 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
"_ref": "record:ptr/ZG5zLm5ldHdvcmtfdmlldyQw:14.241.36.10.in-addr.arpa/default",
|
|
|
|
|
"ptrdname": "ansible.test.com",
|
|
|
|
|
"ipv4addr": "10.36.241.14",
|
|
|
|
|
"extattrs": {}
|
|
|
|
|
"extattrs": {},
|
|
|
|
|
"view": "default"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
@ -121,7 +125,8 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
"ipv4addr": {"ib_req": True},
|
|
|
|
|
"ptrdname": {"ib_req": True},
|
|
|
|
|
"comment": {},
|
|
|
|
|
"extattrs": {}
|
|
|
|
|
"extattrs": {},
|
|
|
|
|
"view": {"ib_req": True}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wapi = self._get_wapi(test_object)
|
|
|
|
@ -132,7 +137,7 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
|
|
|
|
|
def test_nios_ptr_record_update_record_ptrdname(self):
|
|
|
|
|
self.module.params = {'provider': None, 'state': 'present', 'ptrdname': 'ansible.test.org',
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': 'comment', 'extattrs': None}
|
|
|
|
|
'ipv4addr': '10.36.241.14', 'comment': 'comment', 'extattrs': None, 'view': 'default'}
|
|
|
|
|
|
|
|
|
|
test_object = [
|
|
|
|
|
{
|
|
|
|
@ -140,7 +145,8 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
"_ref": "record:ptr/ZG5zLm5ldHdvcmtfdmlldyQw:14.241.36.10.in-addr.arpa/default",
|
|
|
|
|
"ptrdname": "ansible.test.com",
|
|
|
|
|
"ipv4addr": "10.36.241.14",
|
|
|
|
|
"extattrs": {}
|
|
|
|
|
"extattrs": {},
|
|
|
|
|
"view": "default"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
@ -148,7 +154,8 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
"ipv4addr": {"ib_req": True},
|
|
|
|
|
"ptrdname": {"ib_req": True},
|
|
|
|
|
"comment": {},
|
|
|
|
|
"extattrs": {}
|
|
|
|
|
"extattrs": {},
|
|
|
|
|
"view": {"ib_req": True}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wapi = self._get_wapi(test_object)
|
|
|
|
@ -159,17 +166,19 @@ class TestNiosPTRRecordModule(TestNiosModule):
|
|
|
|
|
|
|
|
|
|
def test_nios_ptr6_record_create(self):
|
|
|
|
|
self.module.params = {'provider': None, 'state': 'present', 'ptrdname': 'ansible6.test.com',
|
|
|
|
|
'ipv6addr': '2002:8ac3:802d:1242:20d:60ff:fe38:6d16', 'comment': None, 'extattrs': None}
|
|
|
|
|
'ipv6addr': '2002:8ac3:802d:1242:20d:60ff:fe38:6d16', 'comment': None, 'extattrs': None, 'view': 'default'}
|
|
|
|
|
|
|
|
|
|
test_object = None
|
|
|
|
|
test_spec = {"ipv6addr": {"ib_req": True},
|
|
|
|
|
"ptrdname": {"ib_req": True},
|
|
|
|
|
"comment": {},
|
|
|
|
|
"extattrs": {}}
|
|
|
|
|
"extattrs": {},
|
|
|
|
|
"view": {"ib_req": True}}
|
|
|
|
|
|
|
|
|
|
wapi = self._get_wapi(test_object)
|
|
|
|
|
print("WAPI: ", wapi)
|
|
|
|
|
res = wapi.run('testobject', test_spec)
|
|
|
|
|
|
|
|
|
|
self.assertTrue(res['changed'])
|
|
|
|
|
wapi.create_object.assert_called_once_with('testobject', {'ipv6addr': '2002:8ac3:802d:1242:20d:60ff:fe38:6d16', 'ptrdname': 'ansible6.test.com'})
|
|
|
|
|
wapi.create_object.assert_called_once_with('testobject', {'ipv6addr': '2002:8ac3:802d:1242:20d:60ff:fe38:6d16',
|
|
|
|
|
'ptrdname': 'ansible6.test.com', 'view': 'default'})
|
|
|
|
|