diff --git a/tests/ioc_instance/ioc.db b/tests/ioc_instance/ioc.db new file mode 100644 index 0000000..aecf0bb --- /dev/null +++ b/tests/ioc_instance/ioc.db @@ -0,0 +1,27 @@ +############################################################################# +# DB substitution file generated by http://github.com/epics-containers/ibek # +############################################################################# + +file "$(ADARAVIS)/db/aravisCamera.template" { +pattern + { "P", "R", "PORT", "TIMEOUT", "ADDR" } + { "BL45P-EA-MAP-01", ":DET:", "DET.DET", "1", "0" } +} + +file "$(ADGENICAM)/db/AVT_Mako_G234B.template" { +pattern + { "P", "R", "PORT", "TIMEOUT", "ADDR" } + { "BL45P-EA-MAP-01", ":DET:", "DET.DET", "1", "0" } +} + +file "$(ADCORE)/db/NDPva.template" { +pattern + { "NDARRAY_PORT", "ADDR", "SCANRATE", "NDARRAY_ADDR", "ENABLED", "P", "R", "TIMEOUT", "PORT" } + { "DET.DET", "0", "I/O Intr", "0", "0", "BL45P-EA-MAP-01", ":PVA:", "1", "DET.PVA" } +} + +file "$(ADCORE)/db/NDFileHDF5.template" { +pattern + { "NDARRAY_PORT", "ADDR", "SCANRATE", "NDARRAY_ADDR", "ENABLED", "XMLSIZE", "P", "R", "TIMEOUT", "PORT" } + { "DET.DET", "0", "I/O Intr", "0", "0", "2048", "BL45P-EA-MAP-01", ":HDF5:", "1", "DET.HDF5" } +} diff --git a/tests/ioc_instance/ioc.yaml b/tests/ioc_instance/ioc.yaml new file mode 100644 index 0000000..d64c319 --- /dev/null +++ b/tests/ioc_instance/ioc.yaml @@ -0,0 +1,35 @@ +# yaml-language-server: $schema=https://github.com/epics-containers/ioc-adaravis/releases/download/23.9.4/ibek.ioc.schema.json + +ioc_name: bl45p-ea-ioc-01 +description: Sample camera IOC for BL45P + +entities: + - type: epics.EpicsCaMaxArrayBytes + max_bytes: 6000000 + + - type: ADAravis.aravisCamera + CLASS: AVT_Mako_G234B + PORT: DET.DET + P: BL45P-EA-MAP-01 + R: ":DET:" + ID: 172.23.59.11 + PV_ALIAS: "0" # TODO this ARG should have default + + - type: ADCore.NDPvaPlugin + PORT: DET.PVA + PVNAME: BL45P-EA-MAP-01:PVA:OUTPUT + P: BL45P-EA-MAP-01 + R: ":PVA:" + NDARRAY_PORT: DET.DET + BLOCK: 1 # TODO remaining ARGS should have defaults + PRIORITY: 0 + STACKSIZE: 0 + NDARRAY_ADDR: 0 + + - type: ADCore.NDFileHDF5 + PORT: DET.HDF5 + P: BL45P-EA-MAP-01 + R: ":HDF5:" + NDARRAY_PORT: DET.DET + BLOCK: 1 + NDARRAY_ADDR: 0 diff --git a/tests/ioc_instance/st.cmd b/tests/ioc_instance/st.cmd new file mode 100644 index 0000000..a0c004a --- /dev/null +++ b/tests/ioc_instance/st.cmd @@ -0,0 +1,20 @@ +# EPICS IOC Startup Script generated by https://github.com/epics-containers/ibek + +cd "/epics/ioc" + +epicsEnvSet EPICS_CA_MAX_ARRAY_BYTES 6000000 + +dbLoadDatabase dbd/ioc.dbd +ioc_registerRecordDeviceDriver pdbbase + +aravisConfig(const char *portName, const char *cameraName, size_t maxMemory, int priority, int stackSize) +aravisConfig("DET.DET", "172.23.59.11", -1, 0, 1) +# NDPvaConfigure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr, pvName, maxBuffers, maxMemory, priority, stackSize) +NDPvaConfigure("DET.PVA", 2, 1, "DET.DET", 0, BL45P-EA-MAP-01:PVA:OUTPUT, 0, 0, 0, 0) +startPVAServer +# NDFileHDF5Configure(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr) +NDFileHDF5Configure("DET.HDF5", 2, 1, "DET.DET", 0) + +dbLoadRecords /tmp/ioc.db +iocInit + diff --git a/tests/test_ioc_instance.sh b/tests/test_ioc_instance.sh new file mode 100755 index 0000000..5f9b6c5 --- /dev/null +++ b/tests/test_ioc_instance.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -xe + +THIS_DIR=$(dirname ${0}) +cd ${THIS_DIR}/ioc_instance + +if ! ibek --version; then + pip install ibek +fi + +tmpdir=$(mktemp -d) + +ibek startup generate ioc.yaml ../../*/*.support.yaml --out ${tmpdir}/st.cmd \ + --db-out ${tmpdir}/ioc.db + +if not diff ${tmpdir}/st.cmd ./st.cmd || not diff ${tmpdir}/ioc.db ./ioc.db; then + echo "ERROR: Generated files st.cmd / db.subst differ from expected" + exit 1 +fi + +rm -r ${tmpdir} +