This commit is contained in:
@@ -126,10 +126,37 @@ if [[ "$RUNNER_STATE" == "running" ]]; then
|
||||
assert_code "POST /api/mission_queue/continue" 200 "$TMP/cont.json" \
|
||||
-X POST "$BASE/api/mission_queue/continue"
|
||||
assert_json_true "runner not paused" "$TMP/cont.json" 'doc.get("state") != "paused"'
|
||||
for _ in $(seq 1 15); do
|
||||
curl -s "$BASE/api/mission_queue" -o "$TMP/runner_poll.json"
|
||||
RUNNER_STATE="$(python3 -c "import json; print(json.load(open('$TMP/runner_poll.json')).get('runner',{}).get('state',''))")"
|
||||
if [[ "$RUNNER_STATE" == "running" || "$RUNNER_STATE" == "paused" ]]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.2
|
||||
done
|
||||
if [[ "$RUNNER_STATE" == "running" || "$RUNNER_STATE" == "paused" ]]; then
|
||||
assert_code "POST /api/mission_queue/cancel" 200 "$TMP/cancel.json" \
|
||||
-X POST "$BASE/api/mission_queue/cancel"
|
||||
for _ in $(seq 1 40); do
|
||||
curl -s "$BASE/api/mission_queue" -o "$TMP/runner_poll.json"
|
||||
RUNNER_STATE="$(python3 -c "import json; print(json.load(open('$TMP/runner_poll.json')).get('runner',{}).get('state',''))")"
|
||||
if [[ "$RUNNER_STATE" == "idle" ]]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.15
|
||||
done
|
||||
assert_json_true "runner idle after cancel" "$TMP/runner_poll.json" \
|
||||
'doc.get("runner",{}).get("state") == "idle"'
|
||||
else
|
||||
log_fail "runner not active for cancel test (skipped)"
|
||||
fi
|
||||
else
|
||||
log_fail "runner never reached running (pause test skipped)"
|
||||
fi
|
||||
|
||||
assert_code "POST /api/mission_queue/cancel idle" 400 "$TMP/cancel_idle.json" \
|
||||
-X POST "$BASE/api/mission_queue/cancel"
|
||||
|
||||
# --- LiDAR CRUD ---
|
||||
assert_code "POST /api/lidars" 201 "$TMP/lidar.json" \
|
||||
-X POST "$BASE/api/lidars" \
|
||||
|
||||
Reference in New Issue
Block a user