File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
.github/workflows/scripts/adj-tester Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,26 @@ def check_packet_json(
448448 )
449449 is_valid = False
450450
451+ # Ensure that if one of period_type, period, socket is present, all must be present
452+ has_period_type = "period_type" in pkt
453+ has_period = "period" in pkt
454+ has_socket = "socket" in pkt
455+
456+ # Count how many of the three fields are present
457+ fields_present = sum ([has_period_type , has_period , has_socket ])
458+
459+ # If any field is present, all three must be present
460+ if fields_present > 0 and fields_present < 3 :
461+ error_list .append (
462+ logError (
463+ path ,
464+ f"id { pkt_id } " ,
465+ f"Fields 'period_type', 'period', and 'socket' must all be present together or all be absent. "
466+ f"Found: period_type={ has_period_type } , period={ has_period } , socket={ has_socket } " ,
467+ )
468+ )
469+ is_valid = False
470+
451471 except RuntimeError as e :
452472 error_list .append (logError (path , "<load>" , str (e )))
453473 is_valid = False
You can’t perform that action at this time.
0 commit comments