- allow test run from command line (config is no more needed)

This commit is contained in:
Dmytro Bogovych 2023-08-14 17:18:38 +03:00
parent 2d8d95f3c3
commit 6b28615f1f
2 changed files with 13 additions and 3 deletions

View File

@ -17,5 +17,12 @@ pkill pulseaudio
# Ensure BT stack is here
python3 -u $SCRIPT_DIR/src/bt_preconnect.py $SCRIPT_DIR/config/agent.yaml
# Run main script
python3 -u $SCRIPT_DIR/src/agent_gsm.py --config $SCRIPT_DIR/config/agent.yaml
#!/bin/bash
if [ -n "$1" ]
then
# Run main script
python3 -u $SCRIPT_DIR/src/agent_gsm.py --config $SCRIPT_DIR/config/agent.yaml "$1"
else
python3 -u $SCRIPT_DIR/src/agent_gsm.py --config $SCRIPT_DIR/config/agent.yaml
fi

View File

@ -311,7 +311,7 @@ def run_caller_task(t):
# Runs caller probe - load task list and perform calls
def run_probe():
global TASK_LIST, REFERENCE_AUDIO, LOADED_AUDIO, CURRENT_TASK
global TASK_LIST, REFERENCE_AUDIO, LOADED_AUDIO, CURRENT_TASK, FORCE_RUN
while True:
# Get task list update
@ -403,6 +403,9 @@ if len(sys.argv) < 2:
parser.print_help()
sys.exit(EXIT_OK)
if args.test:
FORCE_RUN = True
if Path(QUALTEST_PID).exists() and args.check_pid_file:
print(f'File {QUALTEST_PID} exists, seems another instance of script is running. Please delete {QUALTEST_PID} to allow the start.')
sys.exit(EXIT_OK)