From e65f22846bf5e941fb0d8cee8fb16b1486b4a57e Mon Sep 17 00:00:00 2001 From: roundspring2003 Date: Wed, 17 Jun 2026 18:41:26 +0800 Subject: [PATCH 1/3] fix: modify script --- ci-operation-pr.sh | 97 +++++++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 44 deletions(-) diff --git a/ci-operation-pr.sh b/ci-operation-pr.sh index 6024c7f..02de9f9 100755 --- a/ci-operation-pr.sh +++ b/ci-operation-pr.sh @@ -9,7 +9,7 @@ # ./ci-operation-pr.sh nf [ ...] [ ...] [OPTIONS] # ./ci-operation-pr.sh nf [...] lib [...] [OPTIONS] # ./ci-operation-pr.sh lib [OPTIONS] -# ./ci-operation-pr.sh free5gc nf [ ...] [OPTIONS] +# ./ci-operation-pr.sh free5gc [nf [ ...]] [OPTIONS] # # OPTIONS: # --skip-docker Skip Docker Compose tests @@ -76,7 +76,7 @@ usage() { echo " $0 nf [ ...] [ ...] [OPTIONS]" echo " $0 nf [...] lib [...] [OPTIONS]" echo " $0 lib [OPTIONS]" - echo " $0 free5gc nf [ ...] [OPTIONS]" + echo " $0 free5gc [nf [ ...]] [OPTIONS]" echo "" echo "OPTIONS:" echo " --skip-docker Skip Docker Compose tests" @@ -89,6 +89,7 @@ usage() { echo " $0 nf smf 170 183 udm 80 81 amf 50 # Multiple NFs with multiple PRs" echo " $0 nf udm 76 lib util 37 # NF PR + library PR combined" echo " $0 lib openapi 67" + echo " $0 free5gc 787 # Test main repo PR #787 only" echo " $0 free5gc 787 nf amf 194 # Test main repo PR #787 with AMF PR #194" echo "" echo "Supported NFs: $SUPPORTED_NFS" @@ -151,15 +152,21 @@ is_number() { [[ "$1" =~ ^[0-9]+$ ]] } -# Check minimum args -if [ $# -lt 3 ]; then - usage -fi - # Parse type TYPE=$1 shift +# Check minimum args based on command type +if [ "$TYPE" = "free5gc" ]; then + if [ $# -lt 1 ]; then + usage + fi +else + if [ $# -lt 2 ]; then + usage + fi +fi + # Parse optional flags first (find and remove them from args) SKIP_DOCKER=false SKIP_TESTALL=false @@ -186,10 +193,10 @@ FREE5GC_PR="" case $TYPE in free5gc) - # Format: free5gc nf [ ...] - if [ ${#REMAINING_ARGS[@]} -lt 4 ]; then - echo "Error: free5gc PR number and at least one NF with PR required" - echo "Format: $0 free5gc nf ..." + # Format: free5gc [nf [ ...]] + if [ ${#REMAINING_ARGS[@]} -lt 1 ]; then + echo "Error: free5gc PR number required" + echo "Format: $0 free5gc [nf ...]" usage fi @@ -200,41 +207,43 @@ case $TYPE in fi FREE5GC_PR="${REMAINING_ARGS[0]}" - # Second argument should be 'nf' - if [ "${REMAINING_ARGS[1]}" != "nf" ]; then - echo "Error: Expected 'nf' after free5gc PR number, got '${REMAINING_ARGS[1]}'" - usage - fi - - # Parse remaining NF/PR pairs (starting from index 2) - CURRENT_NF="" - for ((i=2; i<${#REMAINING_ARGS[@]}; i++)); do - arg="${REMAINING_ARGS[$i]}" - if is_nf "$arg"; then - CURRENT_NF="$arg" - if [ -z "${NF_PRS[$CURRENT_NF]}" ]; then - NF_PRS[$CURRENT_NF]="" - fi - elif is_number "$arg"; then - if [ -z "$CURRENT_NF" ]; then - echo "Error: PR number '$arg' without NF name" - usage - fi - if [ -z "${NF_PRS[$CURRENT_NF]}" ]; then - NF_PRS[$CURRENT_NF]="$arg" - else - NF_PRS[$CURRENT_NF]="${NF_PRS[$CURRENT_NF]} $arg" - fi - else - echo "Error: Unknown argument '$arg' (not a valid NF or PR number)" + # Optional second argument can start NF parsing. + if [ ${#REMAINING_ARGS[@]} -gt 1 ]; then + if [ "${REMAINING_ARGS[1]}" != "nf" ]; then + echo "Error: Expected 'nf' after free5gc PR number, got '${REMAINING_ARGS[1]}'" usage fi - done - - # Validate that we have at least one NF with PRs - if [ ${#NF_PRS[@]} -eq 0 ]; then - echo "Error: No valid NF/PR pairs found" - usage + + if [ ${#REMAINING_ARGS[@]} -lt 4 ]; then + echo "Error: 'nf' was provided but no NF/PR pairs were found" + echo "Format: $0 free5gc nf ..." + usage + fi + + # Parse remaining NF/PR pairs (starting from index 2) + CURRENT_NF="" + for ((i=2; i<${#REMAINING_ARGS[@]}; i++)); do + arg="${REMAINING_ARGS[$i]}" + if is_nf "$arg"; then + CURRENT_NF="$arg" + if [ -z "${NF_PRS[$CURRENT_NF]}" ]; then + NF_PRS[$CURRENT_NF]="" + fi + elif is_number "$arg"; then + if [ -z "$CURRENT_NF" ]; then + echo "Error: PR number '$arg' without NF name" + usage + fi + if [ -z "${NF_PRS[$CURRENT_NF]}" ]; then + NF_PRS[$CURRENT_NF]="$arg" + else + NF_PRS[$CURRENT_NF]="${NF_PRS[$CURRENT_NF]} $arg" + fi + else + echo "Error: Unknown argument '$arg' (not a valid NF or PR number)" + usage + fi + done fi # Set TYPE to nf for later processing, but remember we have FREE5GC_PR From e361fa6bc84b7066543722215740dcc5dd64fb6c Mon Sep 17 00:00:00 2001 From: roundspring2003 Date: Thu, 18 Jun 2026 14:20:37 +0800 Subject: [PATCH 2/3] fix: delete volume --- ci-operation-pr.sh | 2 +- ci-operation.sh | 6 +-- .../pr_test_free5gc_1062_20260617_190608.txt | 50 +++++++++++++++++++ .../pr_test_free5gc_1062_20260617_193254.txt | 27 ++++++++++ 4 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 testing_output/pr_test_free5gc_1062_20260617_190608.txt create mode 100644 testing_output/pr_test_free5gc_1062_20260617_193254.txt diff --git a/ci-operation-pr.sh b/ci-operation-pr.sh index 02de9f9..4dc2557 100755 --- a/ci-operation-pr.sh +++ b/ci-operation-pr.sh @@ -881,7 +881,7 @@ if [ "$SKIP_DOCKER" = false ]; then log_warn "Failed to start $scenario" DOCKER_FAILED="$DOCKER_FAILED $scenario" echo " $scenario: FAIL (compose up failed)" >> "$REPORT_FILE" - sudo docker compose -f "$COMPOSE_FILE" down 2>/dev/null || true + sudo docker compose -f "$COMPOSE_FILE" down -v 2>/dev/null || true continue fi sleep 5 diff --git a/ci-operation.sh b/ci-operation.sh index b592114..37c5c7d 100755 --- a/ci-operation.sh +++ b/ci-operation.sh @@ -72,13 +72,13 @@ main() { "down") case "$2" in "basic-charging") - docker compose -f docker-compose-basic.yaml down + docker compose -f docker-compose-basic.yaml down -v ;; "ulcl-ti") - docker compose -f docker-compose-ulcl-ti.yaml down + docker compose -f docker-compose-ulcl-ti.yaml down -v ;; "ulcl-mp") - docker compose -f docker-compose-ulcl-mp.yaml down + docker compose -f docker-compose-ulcl-mp.yaml down -v ;; *) usage diff --git a/testing_output/pr_test_free5gc_1062_20260617_190608.txt b/testing_output/pr_test_free5gc_1062_20260617_190608.txt new file mode 100644 index 0000000..4ca229e --- /dev/null +++ b/testing_output/pr_test_free5gc_1062_20260617_190608.txt @@ -0,0 +1,50 @@ +========================================== +free5GC PR Test Report +========================================== +Date: Wed Jun 17 07:06:08 PM CST 2026 +Type: nf +Main free5gc Repo PR: #1062 +NF/PR Configuration: + +[STEP 1] Pull: SUCCESS +[STEP 2] Fetch/Merge PRs: + - free5gc #1062: MERGED +[STEP 3] Build: SUCCESS + +[STEP 4] Unit Tests: + TestRegistration: PASS + TestGUTIRegistration: PASS + TestServiceRequest: PASS + TestXnHandover: PASS + TestN2Handover: PASS + TestDeregistration: PASS + TestPDUSessionReleaseRequest: PASS + TestPaging: PASS + TestReSynchronization: PASS + TestDuplicateRegistration: PASS + TestEAPAKAPrimeAuthentication: PASS + TestMultiAmfRegistration: PASS + TestNasReroute: PASS + TestDC: PASS + TestDynamicDC: PASS + TestXnDCHandover: PASS + TestNon3GPP: PASS + TestOAuth2Callback: PASS + TestTngf: PASS + + Summary: + Passed: TestRegistration TestGUTIRegistration TestServiceRequest TestXnHandover TestN2Handover TestDeregistration TestPDUSessionReleaseRequest TestPaging TestReSynchronization TestDuplicateRegistration TestEAPAKAPrimeAuthentication TestMultiAmfRegistration TestNasReroute TestDC TestDynamicDC TestXnDCHandover TestNon3GPP TestOAuth2Callback TestTngf +[STEP 5] Docker Build: SUCCESS + +[STEP 6] Docker Compose Tests: + basic: FAIL + ulcl-ti: FAIL + ulcl-mp: PASS + + Summary: + Passed: ulcl-mp + Failed: basic ulcl-ti + +========================================== +Test Complete: Wed Jun 17 07:22:49 PM CST 2026 +========================================== diff --git a/testing_output/pr_test_free5gc_1062_20260617_193254.txt b/testing_output/pr_test_free5gc_1062_20260617_193254.txt new file mode 100644 index 0000000..8534d52 --- /dev/null +++ b/testing_output/pr_test_free5gc_1062_20260617_193254.txt @@ -0,0 +1,27 @@ +========================================== +free5GC PR Test Report +========================================== +Date: Wed Jun 17 07:32:54 PM CST 2026 +Type: nf +Main free5gc Repo PR: #1062 +NF/PR Configuration: + +[STEP 1] Pull: SKIPPED +[STEP 2] Fetch/Merge PRs: + - free5gc #1062: MERGED +[STEP 3] Build: SUCCESS +[STEP 4] Unit Tests: SKIPPED +[STEP 5] Docker Build: SUCCESS + +[STEP 6] Docker Compose Tests: + basic: FAIL + ulcl-ti: PASS + ulcl-mp: PASS + + Summary: + Passed: ulcl-ti ulcl-mp + Failed: basic + +========================================== +Test Complete: Wed Jun 17 07:37:45 PM CST 2026 +========================================== From 23ab981ea65e86a7a270ddb526cb3985a80e198c Mon Sep 17 00:00:00 2001 From: roundspring2003 Date: Thu, 18 Jun 2026 16:23:46 +0800 Subject: [PATCH 3/3] delete: testing output --- .../pr_test_free5gc_1062_20260617_190608.txt | 50 ------------------- .../pr_test_free5gc_1062_20260617_193254.txt | 27 ---------- 2 files changed, 77 deletions(-) delete mode 100644 testing_output/pr_test_free5gc_1062_20260617_190608.txt delete mode 100644 testing_output/pr_test_free5gc_1062_20260617_193254.txt diff --git a/testing_output/pr_test_free5gc_1062_20260617_190608.txt b/testing_output/pr_test_free5gc_1062_20260617_190608.txt deleted file mode 100644 index 4ca229e..0000000 --- a/testing_output/pr_test_free5gc_1062_20260617_190608.txt +++ /dev/null @@ -1,50 +0,0 @@ -========================================== -free5GC PR Test Report -========================================== -Date: Wed Jun 17 07:06:08 PM CST 2026 -Type: nf -Main free5gc Repo PR: #1062 -NF/PR Configuration: - -[STEP 1] Pull: SUCCESS -[STEP 2] Fetch/Merge PRs: - - free5gc #1062: MERGED -[STEP 3] Build: SUCCESS - -[STEP 4] Unit Tests: - TestRegistration: PASS - TestGUTIRegistration: PASS - TestServiceRequest: PASS - TestXnHandover: PASS - TestN2Handover: PASS - TestDeregistration: PASS - TestPDUSessionReleaseRequest: PASS - TestPaging: PASS - TestReSynchronization: PASS - TestDuplicateRegistration: PASS - TestEAPAKAPrimeAuthentication: PASS - TestMultiAmfRegistration: PASS - TestNasReroute: PASS - TestDC: PASS - TestDynamicDC: PASS - TestXnDCHandover: PASS - TestNon3GPP: PASS - TestOAuth2Callback: PASS - TestTngf: PASS - - Summary: - Passed: TestRegistration TestGUTIRegistration TestServiceRequest TestXnHandover TestN2Handover TestDeregistration TestPDUSessionReleaseRequest TestPaging TestReSynchronization TestDuplicateRegistration TestEAPAKAPrimeAuthentication TestMultiAmfRegistration TestNasReroute TestDC TestDynamicDC TestXnDCHandover TestNon3GPP TestOAuth2Callback TestTngf -[STEP 5] Docker Build: SUCCESS - -[STEP 6] Docker Compose Tests: - basic: FAIL - ulcl-ti: FAIL - ulcl-mp: PASS - - Summary: - Passed: ulcl-mp - Failed: basic ulcl-ti - -========================================== -Test Complete: Wed Jun 17 07:22:49 PM CST 2026 -========================================== diff --git a/testing_output/pr_test_free5gc_1062_20260617_193254.txt b/testing_output/pr_test_free5gc_1062_20260617_193254.txt deleted file mode 100644 index 8534d52..0000000 --- a/testing_output/pr_test_free5gc_1062_20260617_193254.txt +++ /dev/null @@ -1,27 +0,0 @@ -========================================== -free5GC PR Test Report -========================================== -Date: Wed Jun 17 07:32:54 PM CST 2026 -Type: nf -Main free5gc Repo PR: #1062 -NF/PR Configuration: - -[STEP 1] Pull: SKIPPED -[STEP 2] Fetch/Merge PRs: - - free5gc #1062: MERGED -[STEP 3] Build: SUCCESS -[STEP 4] Unit Tests: SKIPPED -[STEP 5] Docker Build: SUCCESS - -[STEP 6] Docker Compose Tests: - basic: FAIL - ulcl-ti: PASS - ulcl-mp: PASS - - Summary: - Passed: ulcl-ti ulcl-mp - Failed: basic - -========================================== -Test Complete: Wed Jun 17 07:37:45 PM CST 2026 -==========================================