Skip to content

Commit 41d3786

Browse files
authored
Merge pull request #12 from A3S-Lab/feat/init-wait-exit-status
feat(runtime): preserve init exit status through wait
2 parents 91cb3c8 + 4dbfd76 commit 41d3786

41 files changed

Lines changed: 1685 additions & 281 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/native-linux-smoke.sh

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,33 @@ run_smoke() {
4343
printf '%s\n' "$output"
4444
jq --exit-status \
4545
--argjson expected "$expected_kvm_present" \
46-
'.status == "available" and .kvm_device_present == $expected' \
46+
'.schema_version == "a3s.oci.native-linux-smoke.v2"
47+
and .platform == "linux" and .status == "available"
48+
and .kvm_device_present == $expected
49+
and .bundle_loaded
50+
and .service_operations
51+
== ["features", "create", "state", "start", "kill", "delete", "wait"]
52+
and .dedicated_vm_rejected_before_create
53+
and .create_returned_created
54+
and .create_replayed
55+
and (.created_pid > 0)
56+
and .marker_absent_after_create
57+
and .start_released
58+
and .running_observed
59+
and .kill_delivered
60+
and .kill_replayed
61+
and .wait_timeout_enforced
62+
and .wait_exit_status == {"signal": 9, "oom_killed": false}
63+
and .wait_replayed
64+
and .stopped_observed
65+
and .marker_verified
66+
and .delete_succeeded
67+
and .delete_replayed
68+
and .state_missing_after_delete
69+
and .marker_removed
70+
and .executor_runtime_clean
71+
and .session_root_clean
72+
and (.reason == null)' \
4773
<<<"$output" >/dev/null
4874
}
4975

@@ -59,12 +85,12 @@ run_multi_container_smoke() {
5985
printf '%s\n' "$output"
6086
jq --exit-status \
6187
--argjson expected "$expected_kvm_present" \
62-
'.schema_version == "a3s.oci.native-linux-multi-container-smoke.v1"
88+
'.schema_version == "a3s.oci.native-linux-multi-container-smoke.v2"
6389
and .platform == "linux" and .status == "available"
6490
and .kvm_device_present == $expected
6591
and .bundles_loaded
6692
and .service_operations
67-
== ["features", "create", "state", "start", "kill", "delete"]
93+
== ["features", "create", "state", "start", "kill", "delete", "wait"]
6894
and .lifecycle.distinct_bundle_directories
6995
and .lifecycle.distinct_rootfs_directories
7096
and .lifecycle.both_created_before_start
@@ -80,8 +106,11 @@ run_multi_container_smoke() {
80106
and .lifecycle.marker_a_verified
81107
and .lifecycle.b_unchanged_after_a_start
82108
and .lifecycle.marker_b_absent_after_a_start
109+
and .lifecycle.wait_a_did_not_block_b
83110
and .lifecycle.kill_a_replayed
84111
and .lifecycle.a_stopped
112+
and .lifecycle.wait_status_a == {"signal": 9, "oom_killed": false}
113+
and .lifecycle.wait_a_replayed
85114
and .lifecycle.b_unchanged_after_a_kill
86115
and .lifecycle.marker_b_absent_after_a_kill
87116
and .lifecycle.delete_a_replayed
@@ -98,6 +127,8 @@ run_multi_container_smoke() {
98127
and .lifecycle.marker_b_verified
99128
and .lifecycle.kill_b_replayed
100129
and .lifecycle.b_stopped
130+
and .lifecycle.wait_status_b == {"signal": 9, "oom_killed": false}
131+
and .lifecycle.wait_b_replayed
101132
and .lifecycle.delete_b_replayed
102133
and .lifecycle.b_missing_after_delete
103134
and .markers_removed
@@ -121,11 +152,11 @@ run_fault_cleanup() {
121152
--fault-after "$phase")"
122153
printf '%s\n' "$output"
123154
jq --exit-status --arg phase "$phase" \
124-
'.schema_version == "a3s.oci.native-linux-fault-cleanup.v1"
155+
'.schema_version == "a3s.oci.native-linux-fault-cleanup.v2"
125156
and .platform == "linux" and .status == "available"
126157
and .bundle_loaded
127158
and .service_operations
128-
== ["features", "create", "state", "start", "kill", "delete"]
159+
== ["features", "create", "state", "start", "kill", "delete", "wait"]
129160
and .lifecycle.requested_fault == $phase
130161
and .lifecycle.injected_fault == $phase
131162
and .lifecycle.create_completed

.github/workflows/ci.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,19 @@ jobs:
226226
if [[ "$support" == "1" ]]; then
227227
test "$status" -eq 0
228228
jq --exit-status --arg agent_version "$agent_version" \
229-
'.schema_version == "a3s.oci.agent-vm-smoke.v3"
229+
'.schema_version == "a3s.oci.agent-vm-smoke.v4"
230230
and .platform == "macos" and .status == "available"
231231
and .endpoint_bound and .shim_spawned
232232
and (.endpoint_name | startswith("a3s-oci-agent-"))
233233
and (.shim_process_id > 0)
234234
and (.bridge_process_id > 0)
235235
and (.bridge_process_id != .shim_process_id)
236236
and .shim_client_verified and .protocol_negotiated
237-
and .selected_protocol == 1
237+
and .selected_protocol == 2
238238
and .agent_version == $agent_version
239239
and .guest_architecture == "aarch64"
240240
and .advertised_operations
241-
== ["create", "state", "start", "kill", "delete"]
241+
== ["create", "state", "start", "kill", "delete", "wait"]
242242
and .shim_report_verified and .shim_exit_code == 0
243243
and .console_created
244244
and .shim_report.platform == "macos"
@@ -256,7 +256,7 @@ jobs:
256256
else
257257
test "$status" -eq 2
258258
jq --exit-status \
259-
'.schema_version == "a3s.oci.agent-vm-smoke.v3"
259+
'.schema_version == "a3s.oci.agent-vm-smoke.v4"
260260
and .platform == "macos" and .status == "unavailable"
261261
and (.endpoint_name | startswith("a3s-oci-agent-"))
262262
and (.protocol_negotiated | not)
@@ -287,7 +287,7 @@ jobs:
287287
printf '%s\n' "$unsigned_output"
288288
test "$unsigned_status" -eq 2
289289
jq --exit-status \
290-
'.schema_version == "a3s.oci.agent-vm-smoke.v3"
290+
'.schema_version == "a3s.oci.agent-vm-smoke.v4"
291291
and .platform == "macos" and .status == "unavailable"
292292
and .endpoint_bound and .shim_spawned
293293
and (.endpoint_name | startswith("a3s-oci-agent-"))
@@ -346,14 +346,18 @@ jobs:
346346
if [[ "$support" == "1" ]]; then
347347
test "$status" -eq 0
348348
jq --exit-status \
349-
'.schema_version == "a3s.oci.oci-vm-smoke.v3"
349+
'.schema_version == "a3s.oci.oci-vm-smoke.v4"
350350
and .platform == "macos" and .status == "available"
351351
and .bundle_loaded
352352
and .create_returned_created and .create_replayed
353353
and (.created_pid > 0)
354354
and .marker_absent_after_create
355355
and .start_released and .running_observed
356356
and .kill_delivered and .kill_replayed
357+
and .wait_timeout_enforced
358+
and .wait_exit_status
359+
== {"exit_code": 0, "oom_killed": false}
360+
and .wait_replayed
357361
and .stopped_observed and .marker_verified
358362
and .delete_succeeded and .delete_replayed
359363
and .state_missing_after_delete
@@ -369,10 +373,10 @@ jobs:
369373
!= .bridge.shim_process_id)
370374
and .bridge.shim_client_verified
371375
and .bridge.protocol_negotiated
372-
and .bridge.selected_protocol == 1
376+
and .bridge.selected_protocol == 2
373377
and .bridge.guest_architecture == "aarch64"
374378
and .bridge.advertised_operations
375-
== ["create", "state", "start", "kill", "delete"]
379+
== ["create", "state", "start", "kill", "delete", "wait"]
376380
and .bridge.shim_report_verified
377381
and .bridge.shim_exit_code == 0
378382
and .bridge.console_created
@@ -388,7 +392,7 @@ jobs:
388392
else
389393
test "$status" -eq 2
390394
jq --exit-status \
391-
'.schema_version == "a3s.oci.oci-vm-smoke.v3"
395+
'.schema_version == "a3s.oci.oci-vm-smoke.v4"
392396
and .platform == "macos" and .status == "unavailable"
393397
and .bundle_loaded
394398
and .bridge.platform == "macos"
@@ -421,7 +425,7 @@ jobs:
421425
printf '%s\n' "$unsigned_output"
422426
test "$unsigned_status" -eq 2
423427
jq --exit-status \
424-
'.schema_version == "a3s.oci.oci-vm-smoke.v3"
428+
'.schema_version == "a3s.oci.oci-vm-smoke.v4"
425429
and .platform == "macos" and .status == "unavailable"
426430
and .bundle_loaded
427431
and (.create_returned_created | not)
@@ -490,7 +494,7 @@ jobs:
490494
if [[ "$support" == "1" ]]; then
491495
test "$status" -eq 0
492496
jq --exit-status \
493-
'.schema_version == "a3s.oci.oci-vm-multi-container-smoke.v1"
497+
'.schema_version == "a3s.oci.oci-vm-multi-container-smoke.v2"
494498
and .platform == "macos" and .status == "available"
495499
and .bundles_loaded
496500
and .lifecycle.distinct_bundle_directories
@@ -508,8 +512,12 @@ jobs:
508512
and .lifecycle.marker_a_verified
509513
and .lifecycle.b_unchanged_after_a_start
510514
and .lifecycle.marker_b_absent_after_a_start
515+
and .lifecycle.wait_a_did_not_block_b
511516
and .lifecycle.kill_a_replayed
512517
and .lifecycle.a_stopped
518+
and .lifecycle.wait_status_a
519+
== {"exit_code": 0, "oom_killed": false}
520+
and .lifecycle.wait_a_replayed
513521
and .lifecycle.b_unchanged_after_a_kill
514522
and .lifecycle.marker_b_absent_after_a_kill
515523
and .lifecycle.delete_a_replayed
@@ -526,14 +534,18 @@ jobs:
526534
and .lifecycle.marker_b_verified
527535
and .lifecycle.kill_b_replayed
528536
and .lifecycle.b_stopped
537+
and .lifecycle.wait_status_b
538+
== {"exit_code": 0, "oom_killed": false}
539+
and .lifecycle.wait_b_replayed
529540
and .lifecycle.delete_b_replayed
530541
and .lifecycle.b_missing_after_delete
531542
and .markers_removed and .guest_runtime_clean
532543
and .bridge.platform == "macos"
533544
and .bridge.status == "available"
534545
and .bridge.protocol_negotiated
546+
and .bridge.selected_protocol == 2
535547
and .bridge.advertised_operations
536-
== ["create", "state", "start", "kill", "delete"]
548+
== ["create", "state", "start", "kill", "delete", "wait"]
537549
and .bridge.shim_report_verified
538550
and .bridge.shim_exit_code == 0
539551
and .bridge.macos_cleanup.endpoint_removed
@@ -549,7 +561,7 @@ jobs:
549561
else
550562
test "$status" -eq 2
551563
jq --exit-status \
552-
'.schema_version == "a3s.oci.oci-vm-multi-container-smoke.v1"
564+
'.schema_version == "a3s.oci.oci-vm-multi-container-smoke.v2"
553565
and .platform == "macos" and .status == "unavailable"
554566
and .bundles_loaded
555567
and .bridge.platform == "macos"
@@ -615,7 +627,7 @@ jobs:
615627
if [[ "$support" == "1" ]]; then
616628
test "$status" -eq 0
617629
jq --exit-status --arg phase "$phase" \
618-
'.schema_version == "a3s.oci.oci-vm-fault-cleanup.v1"
630+
'.schema_version == "a3s.oci.oci-vm-fault-cleanup.v2"
619631
and .platform == "macos" and .status == "available"
620632
and .bundle_loaded
621633
and .lifecycle.requested_fault == $phase
@@ -640,6 +652,9 @@ jobs:
640652
and .marker_removed and .guest_runtime_clean
641653
and .bridge.status == "available"
642654
and .bridge.protocol_negotiated
655+
and .bridge.selected_protocol == 2
656+
and .bridge.advertised_operations
657+
== ["create", "state", "start", "kill", "delete", "wait"]
643658
and .bridge.shim_report_verified
644659
and .bridge.shim_exit_code == 0
645660
and .bridge.macos_cleanup.endpoint_removed
@@ -655,7 +670,7 @@ jobs:
655670
else
656671
test "$status" -eq 2
657672
jq --exit-status --arg phase "$phase" \
658-
'.schema_version == "a3s.oci.oci-vm-fault-cleanup.v1"
673+
'.schema_version == "a3s.oci.oci-vm-fault-cleanup.v2"
659674
and .platform == "macos" and .status == "unavailable"
660675
and .bundle_loaded
661676
and .lifecycle.requested_fault == $phase

0 commit comments

Comments
 (0)