Fix tests and tnc after merge.

This commit is contained in:
Paul Kronenwetter 2022-05-28 20:32:35 -04:00
parent 1f8106258d
commit c15b11fe7b
9 changed files with 34 additions and 20 deletions

View file

@ -191,15 +191,5 @@ add_test(NAME highsnr_virtual5_P_P_multi_callback_outside
./test_virtual4b.sh") ./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") 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() endif()

View file

@ -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 # pylint: disable=global-statement, invalid-name, unused-import
import glob
import os import os
import subprocess import subprocess
import sys import sys
@ -37,14 +38,25 @@ def test_HighSNR_C_P_DATACx(
:param testframes: Number of test frames to transmit :param testframes: Number of test frames to transmit
:type testframes: str :type testframes: str
""" """
tx_side = "freedv_data_raw_tx"
# Facilitate running from main directory as well as inside test/ # Facilitate running from main directory as well as inside test/
rx_side = "util_rx.py" rx_side = "util_rx.py"
if os.path.exists("test") and os.path.exists(os.path.join("test", rx_side)): if os.path.exists("test") and os.path.exists(os.path.join("test", rx_side)):
rx_side = os.path.join("test", rx_side) rx_side = os.path.join("test", rx_side)
os.environ["PYTHONPATH"] += ":." 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( with subprocess.Popen(
args=[ args=[
tx_side, tx_side,

View file

@ -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 # pylint: disable=global-statement, invalid-name, unused-import
import glob
import os import os
import subprocess import subprocess
import sys import sys
@ -35,11 +36,23 @@ def test_HighSNR_P_C_DATACx(bursts: int, frames_per_burst: int, mode: str):
:type testframes: str :type testframes: str
""" """
# Facilitate running from main directory as well as inside test/ # 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" tx_side = "util_tx.py"
if os.path.exists("test") and os.path.exists(os.path.join("test", tx_side)): if os.path.exists("test") and os.path.exists(os.path.join("test", tx_side)):
tx_side = os.path.join("test", tx_side) tx_side = os.path.join("test", tx_side)
os.environ["PYTHONPATH"] += ":." os.environ["PYTHONPATH"] += ":."
rx_side = "freedv_data_raw_rx"
print(f"{tx_side=} / {rx_side=}")
with subprocess.Popen( with subprocess.Popen(
args=[ args=[

View file

@ -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) rx_side = os.path.join("test", rx_side)
os.environ["PYTHONPATH"] += ":." os.environ["PYTHONPATH"] += ":."
print(f"{tx_side=} / {rx_side=}")
with subprocess.Popen( with subprocess.Popen(
args=[ args=[
"python3", "python3",

View file

@ -39,6 +39,8 @@ def test_HighSNR_P_P_Multi(bursts: int, frames_per_burst: int):
rx_side = os.path.join("test", rx_side) rx_side = os.path.join("test", rx_side)
os.environ["PYTHONPATH"] += ":." os.environ["PYTHONPATH"] += ":."
print(f"{tx_side=} / {rx_side=}")
with subprocess.Popen( with subprocess.Popen(
args=[ args=[
"python3", "python3",

View file

@ -75,7 +75,7 @@ def t_highsnr_arq_short_station1(
modem.TESTMODE = True modem.TESTMODE = True
modem.TXCHANNEL = "/tmp/hfchannel2" modem.TXCHANNEL = "/tmp/hfchannel2"
static.HAMLIB_RADIOCONTROL = "disabled" static.HAMLIB_RADIOCONTROL = "disabled"
static.LOW_BANDWITH_MODE = lowbwmode static.LOW_BANDWIDTH_MODE = lowbwmode
static.MYGRID = bytes("AA12aa", "utf-8") static.MYGRID = bytes("AA12aa", "utf-8")
static.RESPOND_TO_CQ = True static.RESPOND_TO_CQ = True

View file

@ -75,7 +75,7 @@ def t_highsnr_arq_short_station2(
modem.TESTMODE = True modem.TESTMODE = True
modem.TXCHANNEL = "/tmp/hfchannel1" modem.TXCHANNEL = "/tmp/hfchannel1"
static.HAMLIB_RADIOCONTROL = "disabled" static.HAMLIB_RADIOCONTROL = "disabled"
static.LOW_BANDWITH_MODE = lowbwmode static.LOW_BANDWIDTH_MODE = lowbwmode
static.MYGRID = bytes("AA12aa", "utf-8") static.MYGRID = bytes("AA12aa", "utf-8")
static.RESPOND_TO_CQ = True static.RESPOND_TO_CQ = True

View file

@ -49,7 +49,6 @@ def signal_handler(sig, frame):
signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGINT, signal_handler)
class DAEMON: class DAEMON:
""" """

View file

@ -244,10 +244,6 @@ class RF:
) )
mkfifo_read_callback_thread.start() 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 # --------------------------------------------INIT AND OPEN HAMLIB
# Check how we want to control the radio # Check how we want to control the radio
if static.HAMLIB_RADIOCONTROL == "direct": if static.HAMLIB_RADIOCONTROL == "direct":