mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
fixing tests that use inventory data
This commit is contained in:
parent
71a1547c3a
commit
320a5b7776
@ -1014,7 +1014,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest):
|
||||
parts.query, parts.fragment])
|
||||
os.environ.setdefault('REST_API_URL', rest_api_url)
|
||||
os.environ['INVENTORY_ID'] = str(old_inv.pk)
|
||||
source = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'plugins',
|
||||
source = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', 'plugins',
|
||||
'inventory', 'awxrest.py')
|
||||
result, stdout, stderr = self.run_command('inventory_import',
|
||||
inventory_id=new_inv.pk,
|
||||
@ -1051,7 +1051,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest):
|
||||
new_inv = self.organizations[0].inventories.create(name='newec2')
|
||||
self.assertEqual(new_inv.hosts.count(), 0)
|
||||
self.assertEqual(new_inv.groups.count(), 0)
|
||||
os.chdir(os.path.join(os.path.dirname(__file__), '..', 'data'))
|
||||
os.chdir(os.path.join(os.path.dirname(__file__), '..', '..', 'data'))
|
||||
inv_file = 'large_ec2_inventory.py'
|
||||
result, stdout, stderr = self.run_command('inventory_import',
|
||||
inventory_id=new_inv.pk,
|
||||
@ -1072,7 +1072,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest):
|
||||
new_inv = self.organizations[0].inventories.create(name='splunk')
|
||||
self.assertEqual(new_inv.hosts.count(), 0)
|
||||
self.assertEqual(new_inv.groups.count(), 0)
|
||||
inv_file = os.path.join(os.path.dirname(__file__), '..', 'data',
|
||||
inv_file = os.path.join(os.path.dirname(__file__), '..', '..', 'data',
|
||||
'splunk_inventory.py')
|
||||
result, stdout, stderr = self.run_command('inventory_import',
|
||||
inventory_id=new_inv.pk,
|
||||
@ -1095,7 +1095,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest):
|
||||
|
||||
def _check_largeinv_import(self, new_inv, nhosts, nhosts_inactive=0):
|
||||
self._start_time = time.time()
|
||||
inv_file = os.path.join(os.path.dirname(__file__), '..', 'data', 'largeinv.py')
|
||||
inv_file = os.path.join(os.path.dirname(__file__), '..', '..', 'data', 'largeinv.py')
|
||||
ngroups = self._get_ngroups_for_nhosts(nhosts)
|
||||
os.environ['NHOSTS'] = str(nhosts)
|
||||
result, stdout, stderr = self.run_command('inventory_import',
|
||||
|
@ -130,7 +130,7 @@ class InventoryScriptTest(BaseScriptTest):
|
||||
os.environ.setdefault('REST_API_URL', rest_api_url)
|
||||
#os.environ.setdefault('REST_API_TOKEN',
|
||||
# self.super_django_user.auth_token.key)
|
||||
name = os.path.join(os.path.dirname(__file__), '..', '..', 'plugins',
|
||||
name = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'plugins',
|
||||
'inventory', 'awxrest.py')
|
||||
return self.run_script(name, *args, **options)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user