diff --git a/test/units/TestInventory.py b/test/units/TestInventory.py index dc3a0ce6d6..b4bee4300e 100644 --- a/test/units/TestInventory.py +++ b/test/units/TestInventory.py @@ -56,7 +56,7 @@ class TestInventory(unittest.TestCase): 'thrudgelmir0', 'thrudgelmir1', 'thrudgelmir2', 'thrudgelmir3', 'thrudgelmir4', 'thrudgelmir5', 'Hotep-a', 'Hotep-b', 'Hotep-c', - 'BastC', 'BastD', 'neptun', ] + 'BastC', 'BastD', 'neptun', 'goldorak', ] ##################################### ### Empty inventory format tests @@ -222,6 +222,11 @@ class TestInventory(unittest.TestCase): inventory.subset('@' + os.path.join(self.test_dir, 'restrict_pattern')) self.assertEqual(sorted(inventory.list_hosts()), sorted(['thor','odin'])) + def test_vars_yaml_extension(self): + inventory = self.simple_inventory() + vars = inventory.get_variables('goldorak') + assert vars['YAML_FILENAME_EXTENSIONS_TEST'] + @raises(errors.AnsibleError) def testinvalid_entry(self): Inventory('1234') diff --git a/test/units/inventory_test_data/group_vars/noparse/all.yml~ b/test/units/inventory_test_data/group_vars/noparse/all.yml~ new file mode 100644 index 0000000000..6f52f114b1 --- /dev/null +++ b/test/units/inventory_test_data/group_vars/noparse/all.yml~ @@ -0,0 +1,2 @@ +--- +YAML_FILENAME_EXTENSIONS_TEST: False diff --git a/test/units/inventory_test_data/group_vars/noparse/file.txt b/test/units/inventory_test_data/group_vars/noparse/file.txt new file mode 100644 index 0000000000..6f52f114b1 --- /dev/null +++ b/test/units/inventory_test_data/group_vars/noparse/file.txt @@ -0,0 +1,2 @@ +--- +YAML_FILENAME_EXTENSIONS_TEST: False diff --git a/test/units/inventory_test_data/group_vars/parse/all.yml b/test/units/inventory_test_data/group_vars/parse/all.yml new file mode 100644 index 0000000000..8687c86c7c --- /dev/null +++ b/test/units/inventory_test_data/group_vars/parse/all.yml @@ -0,0 +1,2 @@ +--- +YAML_FILENAME_EXTENSIONS_TEST: True diff --git a/test/units/inventory_test_data/simple_hosts b/test/units/inventory_test_data/simple_hosts index 4625b3dbab..08c62b4537 100644 --- a/test/units/inventory_test_data/simple_hosts +++ b/test/units/inventory_test_data/simple_hosts @@ -20,3 +20,9 @@ Bast[C:D] [auth] neptun auth="YWRtaW46YWRtaW4=" + +[parse:children] +noparse + +[noparse] +goldorak