mirror of
https://github.com/ansible/awx.git
synced 2026-08-01 18:39:54 -02:30
Fixes AC-470. Disable host name validation for now.
This commit is contained in:
@@ -296,23 +296,6 @@ class InventoryTest(BaseTest):
|
||||
self.assertEqual(Host.objects.get(id=host_data3['id']).variables, host_data3['variables'])
|
||||
self.assertEqual(Host.objects.get(id=host_data3['id']).variables_dict, {'angry': 'penguin'})
|
||||
|
||||
# Try with invalid hostnames and invalid IPs.
|
||||
data = dict(name='', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=400)
|
||||
data = dict(name='not a valid host name', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=400)
|
||||
data = dict(name='validhost:99999', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=400)
|
||||
data = dict(name='123.234.345.456', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=400)
|
||||
data = dict(name='2001::1::3F', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=400)
|
||||
|
||||
###########################################
|
||||
# GROUPS
|
||||
|
||||
@@ -353,7 +336,6 @@ class InventoryTest(BaseTest):
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(groups, data=data, expect=400)
|
||||
|
||||
|
||||
#################################################
|
||||
# HOSTS->inventories POST via subcollection
|
||||
|
||||
@@ -687,6 +669,25 @@ class InventoryTest(BaseTest):
|
||||
self.assertFalse(gx3 in gx2.children.all())
|
||||
self.assertTrue(gx4 in gx2.children.all())
|
||||
|
||||
# Try with invalid hostnames and invalid IPs.
|
||||
hosts = reverse('main:host_list')
|
||||
invalid_expect = 201 # hostname validation is disabled for now.
|
||||
data = dict(name='', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=400)
|
||||
data = dict(name='not a valid host name', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=invalid_expect)
|
||||
data = dict(name='validhost:99999', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=invalid_expect)
|
||||
data = dict(name='123.234.345.456', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=invalid_expect)
|
||||
data = dict(name='2001::1::3F', inventory=inv.pk)
|
||||
with self.current_user(self.super_django_user):
|
||||
response = self.post(hosts, data=data, expect=invalid_expect)
|
||||
|
||||
#########################################################
|
||||
# FIXME: TAGS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user