diff --git a/tests/motion/g0/test.sh b/tests/motion/g0/test.sh index 0a7f9c2630b..b54482c459d 100755 --- a/tests/motion/g0/test.sh +++ b/tests/motion/g0/test.sh @@ -23,6 +23,21 @@ wait_for_pin() { linuxcnc motion-test.ini & linuxcncpid=$! +# let linuxcnc come up +TOGO=80 +while [ $TOGO -gt 0 ]; do + echo trying to connect to linuxcncrsh TOGO=$TOGO + if nc -z localhost 5007; then + break + fi + sleep 0.25 + TOGO=$(($TOGO - 1)) +done +if [ $TOGO -eq 0 ]; then + echo connection to linuxcncrsh timed out + exit 1 +fi + wait_for_pin motion.in-position TRUE echo starting to capture data