Skip to content

Commit 532fd46

Browse files
committed
Additional tests
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
1 parent ee6fde3 commit 532fd46

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- hosts: all
2+
gather_facts: no
3+
4+
tasks:
5+
- debug:
6+
msg: "In project"

test/integration/test_interface.py

+48
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,19 @@ def test_multiple_inventories(project_fixtures):
190190
assert 'host_2' in stdout
191191

192192

193+
def test_default_project_dir(project_fixtures):
194+
private_data_dir = project_fixtures / 'project_dir_test'
195+
196+
res = run(
197+
private_data_dir=private_data_dir,
198+
playbook='debug.yml',
199+
)
200+
stdout = res.stdout.read()
201+
202+
assert res.rc == 0, stdout
203+
assert 'project' in stdout
204+
205+
193206
def test_project_dir(project_fixtures):
194207
private_data_dir = project_fixtures / 'project_dir_test'
195208

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

206219

220+
@pytest.mark.test_all_runtimes
221+
def test_default_project_dir_process_isolation(project_fixtures, runtime):
222+
private_data_dir = project_fixtures / 'project_dir_test'
223+
224+
res = run(
225+
private_data_dir=private_data_dir,
226+
playbook='debug.yml',
227+
process_isolation_executable=runtime,
228+
process_isolation=True,
229+
container_image=defaults.default_container_image,
230+
)
231+
stdout = res.stdout.read()
232+
233+
assert res.rc == 0, stdout
234+
assert 'project' in stdout
235+
236+
237+
@pytest.mark.test_all_runtimes
238+
def test_project_dir_process_isolation(project_fixtures, runtime):
239+
private_data_dir = project_fixtures / 'project_dir_test'
240+
241+
res = run(
242+
private_data_dir=private_data_dir,
243+
container_workdir='/runner/my_project',
244+
playbook='debug.yml',
245+
process_isolation_executable=runtime,
246+
process_isolation=True,
247+
container_image=defaults.default_container_image,
248+
)
249+
stdout = res.stdout.read()
250+
251+
assert res.rc == 0, stdout
252+
assert 'my_project' in stdout
253+
254+
207255
def test_inventory_absolute_path(project_fixtures):
208256
private_data_dir = project_fixtures / 'debug'
209257

0 commit comments

Comments
 (0)