Skip to content

Commit

Permalink
Additional tests
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde committed Mar 22, 2023
1 parent ee6fde3 commit 532fd46
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/fixtures/projects/project_dir_test/project/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- hosts: all
gather_facts: no

tasks:
- debug:
msg: "In project"
48 changes: 48 additions & 0 deletions test/integration/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ def test_multiple_inventories(project_fixtures):
assert 'host_2' in stdout


def test_default_project_dir(project_fixtures):
private_data_dir = project_fixtures / 'project_dir_test'

res = run(
private_data_dir=private_data_dir,
playbook='debug.yml',
)
stdout = res.stdout.read()

assert res.rc == 0, stdout
assert 'project' in stdout


def test_project_dir(project_fixtures):
private_data_dir = project_fixtures / 'project_dir_test'

Expand All @@ -204,6 +217,41 @@ def test_project_dir(project_fixtures):
assert 'my_project' in stdout


@pytest.mark.test_all_runtimes
def test_default_project_dir_process_isolation(project_fixtures, runtime):
private_data_dir = project_fixtures / 'project_dir_test'

res = run(
private_data_dir=private_data_dir,
playbook='debug.yml',
process_isolation_executable=runtime,
process_isolation=True,
container_image=defaults.default_container_image,
)
stdout = res.stdout.read()

assert res.rc == 0, stdout
assert 'project' in stdout


@pytest.mark.test_all_runtimes
def test_project_dir_process_isolation(project_fixtures, runtime):
private_data_dir = project_fixtures / 'project_dir_test'

res = run(
private_data_dir=private_data_dir,
container_workdir='/runner/my_project',
playbook='debug.yml',
process_isolation_executable=runtime,
process_isolation=True,
container_image=defaults.default_container_image,
)
stdout = res.stdout.read()

assert res.rc == 0, stdout
assert 'my_project' in stdout


def test_inventory_absolute_path(project_fixtures):
private_data_dir = project_fixtures / 'debug'

Expand Down

0 comments on commit 532fd46

Please sign in to comment.