From d8210c935ad3b19ab797f62ae9fa82fc242dfe7a Mon Sep 17 00:00:00 2001 From: Lei Xue Date: Sat, 14 Mar 2026 20:49:55 +0800 Subject: [PATCH] ci: fix LU verification to check array length instead of path The SCSILu.Path field is not populated during LU creation, so grep for the file path won't work. Use python3 JSON validation to check the array length instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/gotgt.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gotgt.yml b/.github/workflows/gotgt.yml index 5b0bb31..1392e3f 100644 --- a/.github/workflows/gotgt.yml +++ b/.github/workflows/gotgt.yml @@ -207,7 +207,7 @@ jobs: echo "--- verify new lu in list ---" curl -sf "$API/lu/list?target=$NEW_TARGET" | tee /tmp/list_lu2.out echo "" - grep -q "ci_disk.img" /tmp/list_lu2.out + python3 -c "import json,sys; data=json.load(sys.stdin); assert len(data)==1, f'expected 1 LU, got {len(data)}'" < /tmp/list_lu2.out echo "PASS: new LU visible in list" # 8. Remove the LU @@ -224,10 +224,7 @@ jobs: echo "--- verify lu removed ---" curl -sf "$API/lu/list?target=$NEW_TARGET" | tee /tmp/list_lu3.out echo "" - if grep -q "ci_disk.img" /tmp/list_lu3.out; then - echo "FAIL: LU still present after removal" - exit 1 - fi + python3 -c "import json,sys; data=json.load(sys.stdin); assert len(data)==0, f'expected 0 LUs, got {len(data)}'" < /tmp/list_lu3.out echo "PASS: LU no longer in list" # 10. Remove the target