From 01ac24cc9131641617a4484c0f51d6cfcf55b9f0 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 22 Sep 2023 15:03:11 +0100 Subject: [PATCH] adding IOC verifcation to adsim test --- tests/Verify.adsimdetector.sh | 36 +++++++++++++++++++++++++++++++++++ tests/Verify.asyn.sh | 2 +- tests/Verify.busy.sh | 2 +- tests/_test_support_build.sh | 4 ++-- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100755 tests/Verify.adsimdetector.sh mode change 100644 => 100755 tests/Verify.asyn.sh mode change 100644 => 100755 tests/Verify.busy.sh diff --git a/tests/Verify.adsimdetector.sh b/tests/Verify.adsimdetector.sh new file mode 100755 index 0000000..9158e60 --- /dev/null +++ b/tests/Verify.adsimdetector.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -xe + +tmpdir=$(mktemp -d) + +# TODO - we should really be sending ibek IOC YAML here instead of +# a hand coded startup script - baby steps ... +echo ' +cd "$(TOP)" + +dbLoadDatabase "dbd/ioc.dbd" +ioc_registerRecordDeviceDriver(pdbbase) +simDetectorConfig("TEST.CAM", 2560, 2160, 1, 50, 0) + +dbLoadRecords (simDetector.template, "P=TEST, R=:CAM:, PORT=TEST.CAM, TIMEOUT=1, ADDR=0") + +iocInit +' > ${tmpdir}/st.cmd + +$docker cp ${tmpdir}/st.cmd test_me:/epics/ioc/config/st.cmd +$docker exec -dit test_me bash -c "cd /epics/ioc; ./start.sh" + +# verify that the IOC is running +$docker exec test_me caget TEST:CAM:Acquire +# now try and run the simdetector and verify that it delivers some frames +$docker exec test_me caput TEST:CAM:Acquire 1 + +first=$($docker exec test_me caget TEST:CAM:ArrayCounter_RBV) +second=$($docker exec test_me caget TEST:CAM:ArrayCounter_RBV) +if [[ $first == 0 || $first == $second ]] ; then + echo "ERROR: simdetector did not deliver any frames" + exit 1 +fi + + diff --git a/tests/Verify.asyn.sh b/tests/Verify.asyn.sh old mode 100644 new mode 100755 index ce1ae74..92d2dda --- a/tests/Verify.asyn.sh +++ b/tests/Verify.asyn.sh @@ -1,3 +1,3 @@ #!/bin/bash -echo "HELLO WORLD" \ No newline at end of file +# TODO add tests for asyn here see adsimdetector example \ No newline at end of file diff --git a/tests/Verify.busy.sh b/tests/Verify.busy.sh old mode 100644 new mode 100755 index 8ce1569..92d2dda --- a/tests/Verify.busy.sh +++ b/tests/Verify.busy.sh @@ -1,3 +1,3 @@ #!/bin/bash -echo TODO add tests for busy support module +# TODO add tests for asyn here see adsimdetector example \ No newline at end of file diff --git a/tests/_test_support_build.sh b/tests/_test_support_build.sh index dd45bdb..14c1ddb 100755 --- a/tests/_test_support_build.sh +++ b/tests/_test_support_build.sh @@ -35,10 +35,10 @@ fi # decide on container build tool if which docker > /dev/null ; then - docker=docker + export docker=docker else echo using podman - docker=podman + export docker=podman fi NEWCACHE=${CACHE}-new