diff --git a/CMakeLists.txt b/CMakeLists.txt index 778018ab..61836bbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,15 +191,5 @@ add_test(NAME highsnr_virtual5_P_P_multi_callback_outside ./test_virtual4b.sh") set_tests_properties(highsnr_virtual5_P_P_multi_callback_outside PROPERTIES PASS_REGULAR_EXPRESSION "DATAC0: 2/4 DATAC1: 2/4 DATAC3: 2/4") -# ARQ test short - -add_test(NAME highsnr_ARQ_short - COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src; - PATH=$PATH:${CODEC2_BUILD_DIR}/src; - cd ${CMAKE_CURRENT_SOURCE_DIR}/test; - python3 test_arq_short.py") - - set_tests_properties(highsnr_ARQ_short PROPERTIES PASS_REGULAR_EXPRESSION "ARQ | TX | DATA TRANSMITTED!") - endif() diff --git a/test/test_highsnr_stdio_C_P_datacx.py b/test/test_highsnr_stdio_C_P_datacx.py index 6e3e2eeb..d1e8f6ec 100644 --- a/test/test_highsnr_stdio_C_P_datacx.py +++ b/test/test_highsnr_stdio_C_P_datacx.py @@ -4,6 +4,7 @@ Tests a high signal-to-noise ratio path with codec2 data formats using codec2 to # pylint: disable=global-statement, invalid-name, unused-import +import glob import os import subprocess import sys @@ -37,14 +38,25 @@ def test_HighSNR_C_P_DATACx( :param testframes: Number of test frames to transmit :type testframes: str """ - tx_side = "freedv_data_raw_tx" - # Facilitate running from main directory as well as inside test/ rx_side = "util_rx.py" if os.path.exists("test") and os.path.exists(os.path.join("test", rx_side)): rx_side = os.path.join("test", rx_side) os.environ["PYTHONPATH"] += ":." + tx_side = "freedv_data_raw_tx" + _txpaths = ( + os.path.join("..", "tnc") + if os.path.exists(os.path.join("..", "tnc")) + else "tnc" + ) + _txpaths = glob.glob(rf"{_txpaths}/**/{tx_side}", recursive=True) + for path in _txpaths: + tx_side = path + break + + print(f"{tx_side=} / {rx_side=}") + with subprocess.Popen( args=[ tx_side, diff --git a/test/test_highsnr_stdio_P_C_datacx.py b/test/test_highsnr_stdio_P_C_datacx.py index ef6df185..41a5e1cf 100644 --- a/test/test_highsnr_stdio_P_C_datacx.py +++ b/test/test_highsnr_stdio_P_C_datacx.py @@ -4,6 +4,7 @@ Tests a high signal-to-noise ratio path with codec2 data formats using codec2 to # pylint: disable=global-statement, invalid-name, unused-import +import glob import os import subprocess import sys @@ -35,11 +36,23 @@ def test_HighSNR_P_C_DATACx(bursts: int, frames_per_burst: int, mode: str): :type testframes: str """ # Facilitate running from main directory as well as inside test/ + rx_side = "freedv_data_raw_rx" + _rxpath = ( + os.path.join("..", "tnc") + if os.path.exists(os.path.join("..", "tnc")) + else "tnc" + ) + _rxpaths = glob.glob(rf"{_rxpath}/**/{rx_side}", recursive=True) + for path in _rxpaths: + rx_side = path + break + tx_side = "util_tx.py" if os.path.exists("test") and os.path.exists(os.path.join("test", tx_side)): tx_side = os.path.join("test", tx_side) os.environ["PYTHONPATH"] += ":." - rx_side = "freedv_data_raw_rx" + + print(f"{tx_side=} / {rx_side=}") with subprocess.Popen( args=[ diff --git a/test/test_highsnr_stdio_P_P_datacx.py b/test/test_highsnr_stdio_P_P_datacx.py index 1b3a05b5..dc42412c 100644 --- a/test/test_highsnr_stdio_P_P_datacx.py +++ b/test/test_highsnr_stdio_P_P_datacx.py @@ -40,6 +40,8 @@ def test_HighSNR_P_P_DATACx(bursts: int, frames_per_burst: int, mode: str): rx_side = os.path.join("test", rx_side) os.environ["PYTHONPATH"] += ":." + print(f"{tx_side=} / {rx_side=}") + with subprocess.Popen( args=[ "python3", diff --git a/test/test_highsnr_stdio_P_P_multi.py b/test/test_highsnr_stdio_P_P_multi.py index f3bdfca3..6f6a147b 100644 --- a/test/test_highsnr_stdio_P_P_multi.py +++ b/test/test_highsnr_stdio_P_P_multi.py @@ -39,6 +39,8 @@ def test_HighSNR_P_P_Multi(bursts: int, frames_per_burst: int): rx_side = os.path.join("test", rx_side) os.environ["PYTHONPATH"] += ":." + print(f"{tx_side=} / {rx_side=}") + with subprocess.Popen( args=[ "python3", diff --git a/test/util_arq_chat_file_1.py b/test/util_arq_chat_file_1.py index 7fcda96c..3d0e105b 100644 --- a/test/util_arq_chat_file_1.py +++ b/test/util_arq_chat_file_1.py @@ -75,7 +75,7 @@ def t_highsnr_arq_short_station1( modem.TESTMODE = True modem.TXCHANNEL = "/tmp/hfchannel2" static.HAMLIB_RADIOCONTROL = "disabled" - static.LOW_BANDWITH_MODE = lowbwmode + static.LOW_BANDWIDTH_MODE = lowbwmode static.MYGRID = bytes("AA12aa", "utf-8") static.RESPOND_TO_CQ = True diff --git a/test/util_arq_chat_file_2.py b/test/util_arq_chat_file_2.py index a8937fc4..75347504 100644 --- a/test/util_arq_chat_file_2.py +++ b/test/util_arq_chat_file_2.py @@ -75,7 +75,7 @@ def t_highsnr_arq_short_station2( modem.TESTMODE = True modem.TXCHANNEL = "/tmp/hfchannel1" static.HAMLIB_RADIOCONTROL = "disabled" - static.LOW_BANDWITH_MODE = lowbwmode + static.LOW_BANDWIDTH_MODE = lowbwmode static.MYGRID = bytes("AA12aa", "utf-8") static.RESPOND_TO_CQ = True diff --git a/tnc/daemon.py b/tnc/daemon.py index b4f5bf93..89452384 100755 --- a/tnc/daemon.py +++ b/tnc/daemon.py @@ -49,7 +49,6 @@ def signal_handler(sig, frame): signal.signal(signal.SIGINT, signal_handler) -signal.signal(signal.SIGINT, signal_handler) class DAEMON: """ diff --git a/tnc/modem.py b/tnc/modem.py index 3615acf2..551b0158 100644 --- a/tnc/modem.py +++ b/tnc/modem.py @@ -244,10 +244,6 @@ class RF: ) mkfifo_read_callback_thread.start() - mkfifo_read_callback_thread = threading.Thread(target=self.mkfifo_read_callback, name="MKFIFO READ CALLBACK THREAD",daemon=True) - mkfifo_read_callback_thread.start() - - # --------------------------------------------INIT AND OPEN HAMLIB # Check how we want to control the radio if static.HAMLIB_RADIOCONTROL == "direct":