# Just wait for 3 seconds
timeout 3 ip netns exec "${NAMESPACE}" \
- socat "${SOCAT_MODE}":"${PORT}",fork "${OUTPUT}" 2> /dev/null
+ socat "${SOCAT_MODE}":"${PORT}",fork,shut-none "${OUTPUT}" 2> /dev/null
}
# Only validate that the message arrived properly
# This is necessary if running multiple tests in a row
function pkill_socat() {
- PROCESS_NAME4="socat UDP-LISTEN:6666,fork ${OUTPUT_FILE}"
- PROCESS_NAME6="socat UDP6-LISTEN:6666,fork ${OUTPUT_FILE}"
+ PROCESS_NAME4="socat UDP-LISTEN:6666,fork,shut-none ${OUTPUT_FILE}"
+ PROCESS_NAME6="socat UDP6-LISTEN:6666,fork,shut-none ${OUTPUT_FILE}"
# socat runs under timeout(1), kill it if it is still alive
# do not fail if socat doesn't exist anymore
set +e
cfg.require_cmd("socat", remote=True)
rx_udp_cmd = f"socat -{cfg.addr_ipver} -T 2 -u UDP-RECV:{port},reuseport STDOUT"
- tx_udp_cmd = f"echo -n {test_string} | socat -t 2 -u STDIN UDP:{cfg.baddr}:{port}"
+ tx_udp_cmd = f"echo -n {test_string} | socat -t 2 -u STDIN UDP:{cfg.baddr}:{port},shut-none"
with bkg(rx_udp_cmd, exit_wait=True) as nc:
wait_port_listen(port, proto="udp")
# Writing zero bytes to stdin gets ignored by socat,
# but with the shut-null flag socat generates a zero sized packet
# when the socket is closed.
- tx_cmd_suffix = ",shut-null" if payload_len == 0 else ""
+ tx_cmd_suffix = ",shut-null" if payload_len == 0 else ",shut-none"
tx_udp = f"echo -n {test_string} | socat -t 2 " + \
f"-u STDIN UDP:{cfg.baddr}:{port}{tx_cmd_suffix}"