1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Move inventory tests into subdir, prune non-integration tests.

This commit is contained in:
Michael DeHaan 2014-02-20 17:16:16 -05:00
parent fe7d3773ae
commit 379fe02104
30 changed files with 2 additions and 100 deletions

View file

@ -8,8 +8,9 @@ from ansible.inventory import Inventory
class TestInventory(unittest.TestCase):
def setUp(self):
self.cwd = os.getcwd()
self.test_dir = os.path.join(self.cwd, 'test')
self.test_dir = os.path.join(self.cwd, 'test', 'inventory_test_data')
self.inventory_file = os.path.join(self.test_dir, 'simple_hosts')
self.large_range_inventory_file = os.path.join(self.test_dir, 'large_range')

View file

@ -1,15 +0,0 @@
from ansible.runner import return_data
class ActionModule (object):
def __init__(self, runner):
self.runner = runner
def run(self, conn, tmp, module_name, module_args, inject,
complex_args=None, **kwargs):
# This plug-in should be ignored in deference to
# category/categorized_plugin.py, so it should never actually
# run.
return return_data.ReturnData(
conn=conn, comm_ok=True,
result={"msg": "this plug-in should never be run"})

View file

@ -1,11 +0,0 @@
from ansible.runner import return_data
class ActionModule (object):
def __init__(self, runner):
self.runner = runner
def run(self, conn, tmp, module_name, module_args, inject,
complex_args=None, **kwargs):
return return_data.ReturnData(conn=conn, comm_ok=True,
result={"msg": "categorized"})

View file

@ -1,11 +0,0 @@
from ansible.runner import return_data
class ActionModule (object):
def __init__(self, runner):
self.runner = runner
def run(self, conn, tmp, module_name, module_args, inject,
complex_args=None, **kwargs):
return return_data.ReturnData(conn=conn, comm_ok=True,
result={"msg": "uncategorized"})

View file

@ -1,27 +0,0 @@
# (C) 2013, Michael Scherer, <misc@zarb.org>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import os
class CallbackModule(object):
def playbook_on_play_start(self, foo):
if os.path.exists('/tmp/ansible_test_disable'):
self.disabled = True
def playbook_on_stats(self, stats):
open('/tmp/ansible_test_finish', 'w').close()

View file

@ -1,5 +0,0 @@
---
- hosts: 127.0.0.1
connection: local
tasks:
shell: id

View file

@ -1,3 +0,0 @@
---
messages:
goodbye: "Goodbye World!"

View file

@ -1,3 +0,0 @@
---
messages:
hello: "Hello World!"

View file

@ -1,3 +0,0 @@
{% for k, v in messages.iteritems() %}
{{ k }}: {{ v }}
{% endfor %}

View file

@ -1,16 +0,0 @@
---
- hosts: all
connection: local
vars_files:
- hello.yml
- goodbye.yml
tasks:
- name: generate messages
action: template src=message.j2 dest=/tmp/ansible_test_messages.out
roles:
- role: hash_behavior_test_role
messages:
inside_a_role: "Indeed!"

View file

@ -1,2 +0,0 @@
- name: generate role messages
action: template src=role_message.j2 dest=/tmp/ansible_test_role_messages.out

View file

@ -1,3 +0,0 @@
{% for k, v in messages.iteritems() %}
{{ k }}: {{ v }}
{% endfor %}