Fix some failing tests, script tests seem to indicate magic variables are not being provided
to scripted inventory so need to investigate this.
This commit is contained in:
parent
6b72804cb4
commit
fe558f680a
1 changed files with 9 additions and 6 deletions
|
@ -134,16 +134,18 @@ class TestInventory(unittest.TestCase):
|
||||||
|
|
||||||
print vars
|
print vars
|
||||||
assert vars == {'group_names': ['norse'],
|
assert vars == {'group_names': ['norse'],
|
||||||
'inventory_hostname': 'thor'}
|
'inventory_hostname': 'thor',
|
||||||
|
'inventory_hostname_short': 'thor'}
|
||||||
|
|
||||||
def test_simple_port(self):
|
def test_simple_port(self):
|
||||||
inventory = self.simple_inventory()
|
inventory = self.simple_inventory()
|
||||||
vars = inventory.get_variables('hera')
|
vars = inventory.get_variables('hera')
|
||||||
|
|
||||||
print vars
|
print vars
|
||||||
expected = {'ansible_ssh_port': 3000,
|
expected = { 'ansible_ssh_port': 3000,
|
||||||
'group_names': ['greek'],
|
'group_names': ['greek'],
|
||||||
'inventory_hostname': 'hera'}
|
'inventory_hostname': 'hera',
|
||||||
|
'inventory_hostname_short': 'hera' }
|
||||||
print expected
|
print expected
|
||||||
assert vars == expected
|
assert vars == expected
|
||||||
|
|
||||||
|
@ -158,7 +160,7 @@ class TestInventory(unittest.TestCase):
|
||||||
|
|
||||||
expected = dict(
|
expected = dict(
|
||||||
a='1', b='2', c='3', d='100002', rga='1', rgb='2', rgc='3',
|
a='1', b='2', c='3', d='100002', rga='1', rgb='2', rgc='3',
|
||||||
inventory_hostname='rtp_a',
|
inventory_hostname='rtp_a', inventory_hostname_short='rtp_a',
|
||||||
group_names=[ 'eastcoast', 'nc', 'redundantgroup', 'redundantgroup2', 'redundantgroup3', 'rtp', 'us' ]
|
group_names=[ 'eastcoast', 'nc', 'redundantgroup', 'redundantgroup2', 'redundantgroup3', 'rtp', 'us' ]
|
||||||
)
|
)
|
||||||
print vars
|
print vars
|
||||||
|
@ -232,5 +234,6 @@ class TestInventory(unittest.TestCase):
|
||||||
|
|
||||||
assert vars == {'hammer':True,
|
assert vars == {'hammer':True,
|
||||||
'group_names': ['norse'],
|
'group_names': ['norse'],
|
||||||
'inventory_hostname': 'thor'}
|
'inventory_hostname': 'thor',
|
||||||
|
'inventory_hostname_short': 'thor'}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue