mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Fix tests and tnc after merge.
This commit is contained in:
parent
1f8106258d
commit
c15b11fe7b
9 changed files with 34 additions and 20 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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=[
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -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":
|
||||||
|
|
Loading…
Reference in a new issue