Compare commits

..

2 commits

View file

@ -152,11 +152,8 @@ echo -e "Subject: Test ${BOOT_ID} Started\n\nTest ${BOOT_ID} has commenced." | m
FAILED_START=$(get_tx_failed)
DUMMY_SPEEDTEST=$(speedtest --format=csv --output-header)
SPEEDTEST_HEADER=$(echo "$DUMMY_SPEEDTEST" | head -n 1)
# CSV setup
TEST_HEADER="StartTimestamp,EndTimestamp,Link,Level,Noise,BSSID,TX Bitrate,RX Bitrate,${SPEEDTEST_HEADER},TX Failures,Channel,Frequency,Packet Loss,Jitter,LocalTCPUp,LocalTCPDown,LocalUDPUp,LocalUDPDown,RemoteTCPUp,RemoteTCPDown,RemoteUDPUp,RemoteUDPDown"
TEST_HEADER="StartTimestamp,EndTimestamp,Link,Level,Noise,BSSID,TX Bitrate,RX Bitrate,$(speedtest --csv-header),TX Failures,Channel,Frequency,Packet Loss,Jitter,LocalTCPUp,LocalTCPDown,LocalUDPUp,LocalUDPDown,RemoteTCPUp,RemoteTCPDown,RemoteUDPUp,RemoteUDPDown"
LISTENER_HEADER="Timestamp,ClientsOnAP,ClientsOnChannel,APsOnChannel,AvgAPSignal,StrongestAPSignal,UnlinkedDevices,NumberofBSSIDsOnSSID,AvgSSIDSignal,MaxSSIDSignal,NumberofChannelsOnSSID,PacketCount,Deadpoints"
echo "Speedtest,LocalTCPUp,LocalTCPDown,LocalUDPUp,LocalUDPDown,RemoteTCPUp,RemoteTCPDown,RemoteUDPUp,RemoteUDPDown" >"${TEST_FILE}_durations.csv"
@ -177,7 +174,7 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do
if [ "$LISTENER_ENABLED" -eq 1 ]; then
LISTENER_SAMPLE_FILE="${TEST_FILE%.csv}-listener-$COUNTER-$i.csv"
log "Launching listener for sample $i/$NUM_TESTS..."
log "Launching listener for sample $i/$NUM_SAMPLES..."
READY_FILE="/tmp/listener_ready_${COUNTER}_${i}"
@ -198,8 +195,18 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do
"${ADAPTIVE_ARGS[@]}" > >(tee "$READY_FILE") &
LISTENER_PID=$!
# Wait for the READY_FILE to contain "LISTENING_STARTED"
bash -c "until grep -q LISTENING_STARTED $READY_FILE; do sleep 0.2; done"
# Wait up to 10 seconds for LISTENING_STARTED
log "Waiting for listener to initialize (timeout in 10s)..."
for ((j = 0; j < 50; j++)); do
if grep -q LISTENING_STARTED "$READY_FILE"; then
break
fi
sleep 0.2
done
if ! grep -q LISTENING_STARTED "$READY_FILE"; then
warn "Listener did not start properly (LISTENING_STARTED not found in time). Proceeding without it."
fi
fi
log " Sample $i of $NUM_SAMPLES"
@ -222,8 +229,7 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do
for ((retry = 1; retry <= MAX_RETRIES; retry++)); do
SECONDS=0
log "Speed test attempt $retry"
# speed_results=$(speedtest --secure --csv --server 57444 --server 16797 --server 40818 --server 24079 --server 55661 2>/dev/null || true)
speed_results=$(speedtest --format=csv 2>/dev/null || true)
speed_results=$(speedtest --secure --csv 2>/dev/null || true)
speedtest_duration=$SECONDS
[[ -n "$speed_results" ]] && break
warn "Speedtest failed. Retrying in $RETRY_DELAY seconds..."