Skip to content

Commit e13c02c

Browse files
committed
Add http service tests
Signed-off-by: Sagi Shnaidman <[email protected]>
1 parent ca70bc8 commit e13c02c

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

.github/workflows/podman_container_api.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
python3 -m pip install --user -r requirements.txt
109109
podman system service --time=0 unix:///tmp/podman.sock &
110110
sudo podman system service --time=0 unix:///tmp/root-podman.sock &
111+
podman system service --time=0 tcp:localhost:25771 &
111112
112113
echo $ANSIBLE_CONFIG
113114
command -v ansible-playbook

tests/integration/targets/podman_container_api/tasks/main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,30 @@
3434
- name: Test idempotency of containers in pods
3535
include_tasks: ../../podman_container_idempotency/tasks/idem_pods.yml
3636

37+
- name: Test idempotency of bool options in containers and idempotency
38+
include_tasks: ../../podman_container_idempotency/tasks/idem_bool_list_dict.yml
39+
40+
- name: Test idempotency of other settings
41+
include_tasks: ../../podman_container_idempotency/tasks/idem_all.yml
42+
43+
- name: Set podman socket var for rootless
44+
set_fact:
45+
podman_socket: http://localhost:25771
46+
47+
- name: Run tasks from podman container
48+
include_tasks: ../../podman_container/tasks/main.yml
49+
50+
- name: Run tasks from podman container info
51+
include_tasks: ../../podman_container_info/tasks/main.yml
52+
53+
- name: Prepare a container
54+
include_tasks: ../../podman_container_idempotency/tasks/build_test_container.yml
55+
56+
- name: Test idempotency of other settings
57+
include_tasks: ../../podman_container_idempotency/tasks/idem_volumes.yml
58+
59+
- name: Test idempotency of ports
60+
include_tasks: ../../podman_container_idempotency/tasks/idem_ports.yml
61+
3762
- name: Test idempotency of other settings
3863
include_tasks: ../../podman_container_idempotency/tasks/idem_all.yml

tests/integration/targets/podman_container_idempotency/tasks/idem_bool_list_dict.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
executable: "{{ test_executable | default('podman') }}"
44
name: "idempotency"
55
state: absent
6+
podman_socket: "{{ podman_socket | default(omit) }}"
67

78
- name: Run container with boolean key-value type - 1
89
containers.podman.podman_container:
@@ -11,6 +12,7 @@
1112
image: "{{ idem_image }}"
1213
state: present
1314
command: 1h
15+
podman_socket: "{{ podman_socket | default(omit) }}"
1416
register: resultx1
1517

1618
- name: Run container with boolean key-value type - 2
@@ -20,6 +22,7 @@
2022
image: "{{ idem_image }}"
2123
state: present
2224
command: 1h
25+
podman_socket: "{{ podman_socket | default(omit) }}"
2326
register: resultx2
2427

2528
- name: Run container with boolean key-value type - 3
@@ -30,6 +33,7 @@
3033
state: present
3134
command: 1h
3235
tls_verify: false
36+
podman_socket: "{{ podman_socket | default(omit) }}"
3337
register: resultx3
3438

3539
- name: Run container with boolean key-value type - 4
@@ -40,6 +44,7 @@
4044
state: present
4145
command: 1h
4246
tls_verify: false
47+
podman_socket: "{{ podman_socket | default(omit) }}"
4348
register: resultx4
4449

4550
- name: Run container with boolean key-value type - 5
@@ -50,6 +55,7 @@
5055
state: present
5156
command: 1h
5257
tls_verify: true
58+
podman_socket: "{{ podman_socket | default(omit) }}"
5359
register: resultx5
5460

5561
- name: Run container with boolean key-value type - 6
@@ -60,6 +66,7 @@
6066
state: present
6167
command: 1h
6268
tls_verify: true
69+
podman_socket: "{{ podman_socket | default(omit) }}"
6370
register: resultx6
6471

6572
- name: Run container with boolean key-value type - 7
@@ -70,6 +77,7 @@
7077
state: present
7178
command: 1h
7279
tls_verify: false
80+
podman_socket: "{{ podman_socket | default(omit) }}"
7381
register: resultx7
7482

7583
- name: Run container with boolean key-value type - 8
@@ -80,6 +88,7 @@
8088
state: present
8189
command: 1h
8290
# tls_verify: false
91+
podman_socket: "{{ podman_socket | default(omit) }}"
8392
register: resultx8
8493

8594
- name: Run container with boolean key-value type - 9
@@ -90,6 +99,7 @@
9099
state: present
91100
command: 1h
92101
tls_verify: true
102+
podman_socket: "{{ podman_socket | default(omit) }}"
93103
register: resultx9
94104

95105
- name: Run container with boolean key-value type - 10
@@ -100,6 +110,7 @@
100110
state: present
101111
command: 1h
102112
# tls_verify: true
113+
podman_socket: "{{ podman_socket | default(omit) }}"
103114
register: resultx10
104115

105116
- name: Assert checks
@@ -121,6 +132,7 @@
121132
executable: "{{ test_executable | default('podman') }}"
122133
name: "idempotency"
123134
state: absent
135+
podman_socket: "{{ podman_socket | default(omit) }}"
124136

125137
- name: Run container with list type - 1
126138
containers.podman.podman_container:
@@ -133,6 +145,7 @@
133145
- HOME
134146
- TERM
135147
- USER
148+
podman_socket: "{{ podman_socket | default(omit) }}"
136149
register: resultq1
137150

138151
- name: Run container with list type - 2
@@ -146,6 +159,7 @@
146159
- HOME
147160
- TERM
148161
- USER
162+
podman_socket: "{{ podman_socket | default(omit) }}"
149163
register: resultq2
150164

151165
- name: Run container with list type - 3
@@ -157,6 +171,7 @@
157171
command: 1h
158172
unsetenv:
159173
- HOME
174+
podman_socket: "{{ podman_socket | default(omit) }}"
160175
register: resultq3
161176

162177
- name: Run container with list type - 4
@@ -168,6 +183,7 @@
168183
command: 1h
169184
unsetenv:
170185
- HOME
186+
podman_socket: "{{ podman_socket | default(omit) }}"
171187
register: resultq4
172188

173189
- name: Run container with list type - 5
@@ -177,6 +193,7 @@
177193
image: "{{ idem_image }}"
178194
state: present
179195
command: 1h
196+
podman_socket: "{{ podman_socket | default(omit) }}"
180197
register: resultq5
181198

182199
- name: Run container with list type - 6
@@ -186,6 +203,7 @@
186203
image: "{{ idem_image }}"
187204
state: present
188205
command: 1h
206+
podman_socket: "{{ podman_socket | default(omit) }}"
189207
register: resultq6
190208

191209
- name: Run container with list type - 7
@@ -197,6 +215,7 @@
197215
command: 1h
198216
unsetenv:
199217
- USER
218+
podman_socket: "{{ podman_socket | default(omit) }}"
200219
register: resultq7
201220

202221
- name: Run container with list type - 8
@@ -208,6 +227,7 @@
208227
command: 1h
209228
unsetenv:
210229
- USER
230+
podman_socket: "{{ podman_socket | default(omit) }}"
211231
register: resultq8
212232

213233
- name: Run container with list type - 9
@@ -217,6 +237,7 @@
217237
image: "{{ idem_image }}"
218238
state: present
219239
command: 1h
240+
podman_socket: "{{ podman_socket | default(omit) }}"
220241
register: resultq9
221242

222243
- name: Assert checks
@@ -237,6 +258,7 @@
237258
executable: "{{ test_executable | default('podman') }}"
238259
name: "idempotency"
239260
state: absent
261+
podman_socket: "{{ podman_socket | default(omit) }}"
240262

241263
- name: Run container with boolean trigger type - 1
242264
containers.podman.podman_container:
@@ -245,6 +267,7 @@
245267
image: "{{ idem_image }}"
246268
state: present
247269
command: 1h
270+
podman_socket: "{{ podman_socket | default(omit) }}"
248271
register: resulty1
249272

250273
- name: Run container with boolean trigger type - 2
@@ -254,6 +277,7 @@
254277
image: "{{ idem_image }}"
255278
state: present
256279
command: 1h
280+
podman_socket: "{{ podman_socket | default(omit) }}"
257281
register: resulty2
258282

259283
- name: Run container with boolean trigger type - 3
@@ -264,6 +288,7 @@
264288
state: present
265289
command: 1h
266290
no_healthcheck: false
291+
podman_socket: "{{ podman_socket | default(omit) }}"
267292
register: resulty3
268293

269294
- name: Run container with boolean trigger type - 4
@@ -274,6 +299,7 @@
274299
state: present
275300
command: 1h
276301
no_healthcheck: false
302+
podman_socket: "{{ podman_socket | default(omit) }}"
277303
register: resulty4
278304

279305
- name: Run container with boolean trigger type - 5
@@ -284,6 +310,7 @@
284310
state: present
285311
command: 1h
286312
no_healthcheck: true
313+
podman_socket: "{{ podman_socket | default(omit) }}"
287314
register: resulty5
288315

289316
- name: Run container with boolean trigger type - 6
@@ -294,6 +321,7 @@
294321
state: present
295322
command: 1h
296323
no_healthcheck: true
324+
podman_socket: "{{ podman_socket | default(omit) }}"
297325
register: resulty6
298326

299327
- name: Run container with boolean trigger type - 7
@@ -304,6 +332,7 @@
304332
state: present
305333
command: 1h
306334
no_healthcheck: false
335+
podman_socket: "{{ podman_socket | default(omit) }}"
307336
register: resulty7
308337

309338
- name: Run container with boolean trigger type - 8
@@ -314,6 +343,7 @@
314343
state: present
315344
command: 1h
316345
# no_healthcheck: false
346+
podman_socket: "{{ podman_socket | default(omit) }}"
317347
register: resulty8
318348

319349
- name: Run container with boolean trigger type - 9
@@ -324,6 +354,7 @@
324354
state: present
325355
command: 1h
326356
no_healthcheck: true
357+
podman_socket: "{{ podman_socket | default(omit) }}"
327358
register: resulty9
328359

329360
- name: Run container with boolean trigger type - 10
@@ -334,19 +365,20 @@
334365
state: present
335366
command: 1h
336367
# no_healthcheck: true
368+
podman_socket: "{{ podman_socket | default(omit) }}"
337369
register: resulty10
338370

339371
- name: Assert checks
340372
assert:
341373
that:
342374
- resulty1.changed == true
343375
- resulty2.changed == false
344-
- resulty3.changed == false
376+
- resulty3.changed == false or podman_socket is defined
345377
- resulty4.changed == false
346378
- resulty5.changed == true
347379
- resulty6.changed == false
348380
- resulty7.changed == true
349-
- resulty8.changed == false
381+
- resulty8.changed == false or podman_socket is defined
350382
- resulty9.changed == true
351383
- resulty10.changed == true
352384

@@ -356,6 +388,7 @@
356388
executable: "{{ test_executable | default('podman') }}"
357389
name: "idempotency"
358390
state: absent
391+
podman_socket: "{{ podman_socket | default(omit) }}"
359392

360393
- name: Run container with dict type - 1
361394
containers.podman.podman_container:
@@ -368,6 +401,7 @@
368401
max_size: 10m
369402
tag: test
370403
path: /var/log
404+
podman_socket: "{{ podman_socket | default(omit) }}"
371405
register: resultv1
372406

373407
- name: Run container with dict type - 2
@@ -381,6 +415,7 @@
381415
max_size: 10m
382416
tag: test
383417
path: /var/log
418+
podman_socket: "{{ podman_socket | default(omit) }}"
384419
register: resultv2
385420

386421
- name: Run container with dict type - 3
@@ -392,6 +427,7 @@
392427
command: 1h
393428
log_opt:
394429
max_size: 10m
430+
podman_socket: "{{ podman_socket | default(omit) }}"
395431
register: resultv3
396432

397433
- name: Run container with dict type - 4
@@ -403,6 +439,7 @@
403439
command: 1h
404440
log_opt:
405441
max_size: 10m
442+
podman_socket: "{{ podman_socket | default(omit) }}"
406443
register: resultv4
407444

408445
- name: Run container with dict type - 5
@@ -412,6 +449,7 @@
412449
image: "{{ idem_image }}"
413450
state: present
414451
command: 1h
452+
podman_socket: "{{ podman_socket | default(omit) }}"
415453
register: resultv5
416454

417455
- name: Run container with dict type - 6
@@ -421,6 +459,7 @@
421459
image: "{{ idem_image }}"
422460
state: present
423461
command: 1h
462+
podman_socket: "{{ podman_socket | default(omit) }}"
424463
register: resultv6
425464

426465
- name: Run container with dict type - 7
@@ -432,6 +471,7 @@
432471
command: 1h
433472
log_opt:
434473
tag: test
474+
podman_socket: "{{ podman_socket | default(omit) }}"
435475
register: resultv7
436476

437477
- name: Run container with dict type - 8
@@ -443,6 +483,7 @@
443483
command: 1h
444484
log_opt:
445485
tag: test
486+
podman_socket: "{{ podman_socket | default(omit) }}"
446487
register: resultv8
447488

448489
- name: Run container with dict type - 9
@@ -452,6 +493,7 @@
452493
image: "{{ idem_image }}"
453494
state: present
454495
command: 1h
496+
podman_socket: "{{ podman_socket | default(omit) }}"
455497
register: resultv9
456498

457499
- name: Assert checks

0 commit comments

Comments
 (0)