Skip to content

Commit f6584ec

Browse files
committed
Automate testing info tag removal bug in recceiver
Bug can be reproduced manually as follows 1. Create recceiver with infotag (X) set to be updated in channelfinder. 2. Add IOC with PV with infotag X set to A 3. Channelfinder has PV with X=A 4. Reboot recceiver with infotag X removed 5. Channelfinder has PV with X=A still even after IOC update Or by 1. Create recceiver with infotag (X) set to be updated in channelfinder. 2. Add IOC with PV with infotag X set to A 3. Channelfinder has PV with X=A 4. Reboot IOC with PV with infotag X removed 5. Channelfinder has PV with X=A still
1 parent 08c366c commit f6584ec

File tree

15 files changed

+361
-60
lines changed

15 files changed

+361
-60
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"server"
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true
7+
}

client/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ configure/*.local
1313

1414
*~
1515
.*.swp
16+
.ci

client/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ RUN mv docker/RELEASE.local configure/RELEASE.local
5050
ENV EPICS_ROOT=/epics
5151
ENV EPICS_BASE=${EPICS_ROOT}/base
5252
RUN make
53-
WORKDIR /recsync/iocBoot/iocdemo
5453

5554
FROM recsync-base AS ioc-runner
5655

57-
CMD /recsync/bin/${EPICS_HOST_ARCH}/demo st.cmd
56+
WORKDIR /recsync/bin/${EPICS_HOST_ARCH}
57+
58+
CMD ./demo /recsync/iocBoot/iocdemo/st.cmd

client/demoApp/Db/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ include $(TOP)/configure/CONFIG
1111
# Create and install (or just install) into <top>/db
1212
# databases, templates, substitutions like this
1313
DB += somerecords.db
14-
14+
DB += archive.db
15+
DB += archive_bugtest.db
1516
#----------------------------------------------------
1617
# If <anyname>.db template is not named <anyname>*.template add
1718
# <anyname>_template = <templatename>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
record(ai, "$(P)ai:archive") {
3+
info("test", "testing")
4+
}
5+
6+
record(longout, "$(P)lo:archive") {
7+
info("test", "testing")
8+
info("hello", "world")
9+
info("archive", "default")
10+
}

client/iocBoot/iocdemo/st.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ addReccasterEnvVars("BUILDING")
2626
## Load record instances
2727
dbLoadRecords("../../db/reccaster.db", "P=$(IOCSH_NAME):")
2828
dbLoadRecords("../../db/somerecords.db","P=$(IOCSH_NAME):")
29+
dbLoadRecords("../../db/archive.db", "P=$(IOCSH_NAME):")
2930

3031
iocInit()
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!../../bin/linux-x86_64-debug/demo
2+
3+
## You may have to change demo to something else
4+
## everywhere it appears in this file
5+
6+
< envPaths
7+
8+
## Register all support components
9+
dbLoadDatabase("../../dbd/demo.dbd",0,0)
10+
demo_registerRecordDeviceDriver(pdbbase)
11+
12+
var(reccastTimeout, 5.0)
13+
var(reccastMaxHoldoff, 5.0)
14+
15+
epicsEnvSet("IOCNAME", "$(IOCSH_NAME)")
16+
epicsEnvSet("ENGINEER", "myself")
17+
epicsEnvSet("LOCATION", "myplace")
18+
19+
epicsEnvSet("CONTACT", "mycontact")
20+
epicsEnvSet("BUILDING", "mybuilding")
21+
epicsEnvSet("SECTOR", "mysector")
22+
23+
addReccasterEnvVars("CONTACT", "SECTOR")
24+
addReccasterEnvVars("BUILDING")
25+
26+
## Load record instances
27+
dbLoadRecords("../../db/reccaster.db", "P=$(IOCSH_NAME):")
28+
dbLoadRecords("../../db/somerecords.db","P=$(IOCSH_NAME):")
29+
dbLoadRecords("../../db/archive_bugtest.db", "P=$(IOCSH_NAME):")
30+
31+
iocInit()

server/test-compose.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: recceiver-test-compose
12
services:
23
cf:
34
image: ghcr.io/channelfinder/channelfinderservice:master
@@ -42,8 +43,6 @@ services:
4243
interval: 10s
4344
timeout: 60s
4445
retries: 5
45-
volumes:
46-
- channelfinder-es-data:/usr/share/elasticsearch/data
4746

4847
recc1:
4948
build: .
@@ -143,10 +142,6 @@ services:
143142
condition: service_healthy
144143
restart: true
145144

146-
volumes:
147-
channelfinder-es-data:
148-
driver: local
149-
150145
networks:
151146
net-2-cf:
152147
driver: bridge

server/test-remove-compose.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: recceiver-test-remove-compose
2+
services:
3+
cf:
4+
image: ghcr.io/channelfinder/channelfinderservice:master
5+
hostname: cf
6+
networks:
7+
- net-2-cf
8+
ports:
9+
- "8080:8080"
10+
depends_on:
11+
elasticsearch:
12+
condition: service_healthy
13+
restart: true
14+
environment:
15+
ELASTICSEARCH_NETWORK_HOST: elasticsearch-cf
16+
ELASTICSEARCH_QUERY_SIZE: 10000
17+
demo_auth.enabled: true
18+
demo_auth.users: admin
19+
demo_auth.pwds: password
20+
demo_auth.roles: ADMIN
21+
EPICS_PVAS_INTF_ADDR_LIST: "0.0.0.0"
22+
aa.enabled: false
23+
logging.level.org.springframework.web: INFO
24+
healthcheck:
25+
test: curl -s -f http://cf:8080/ChannelFinder
26+
interval: 10s
27+
timeout: 60s
28+
retries: 5
29+
30+
elasticsearch:
31+
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.4
32+
hostname: elasticsearch-cf
33+
networks:
34+
- net-2-cf
35+
environment:
36+
cluster.name: channelfinder
37+
discovery.type: single-node
38+
bootstrap.memory_lock: "true"
39+
xpack.security.enabled: "false"
40+
logger.level: WARN
41+
healthcheck:
42+
test: curl -s -f http://localhost:9200/_cluster/health
43+
interval: 10s
44+
timeout: 60s
45+
retries: 5
46+
47+
recc1:
48+
build: .
49+
hostname: recc1
50+
networks:
51+
- net-0-recc-1
52+
- net-2-cf
53+
depends_on:
54+
cf:
55+
condition: service_healthy
56+
restart: true
57+
healthcheck:
58+
test: netstat | grep cf
59+
interval: 10s
60+
timeout: 30s
61+
retries: 3
62+
volumes:
63+
- type: bind
64+
source: docker/config/cf1.conf
65+
target: /home/recceiver/cf.conf
66+
read_only: true
67+
- type: bind
68+
source: docker/config/cf1.conf
69+
target: /home/recceiver/channelfinderapi.conf
70+
read_only: true
71+
ioc1-1:
72+
build: ../client
73+
hostname: ioc1-1
74+
command: bash
75+
tty: true
76+
environment:
77+
- IOCSH_NAME=IOC1-1
78+
networks:
79+
- net-0-recc-1
80+
depends_on:
81+
recc1:
82+
condition: service_healthy
83+
restart: true
84+
networks:
85+
net-2-cf:
86+
driver: bridge
87+
net-0-recc-1:
88+
driver: bridge

server/tests/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import logging
2+
3+
logging.basicConfig(
4+
level=logging.DEBUG,
5+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
6+
encoding="utf-8",
7+
)

0 commit comments

Comments
 (0)