RSRV Configuration Test Plan

From EPICSWIKI

Scope

This document describes some of the possible network configurations for RSRV and the expected results with the RSRV interface binding changes https://code.launchpad.net/~epics-core/epics-base/rsrvbindiface.

The expected results are given as the output various IOC shell commands (eg. epicsParamShow/casr/dbcar).

Note that the output of dbcar "" 8 is quite verbose. Searching for the string Search Destination List in the output is suggested.

Preparation

This testing should be done on a computer with more than one physical/virtual network interface in additional to the loopback.

On Linux additional tun/tap virtual interfaces can easily be added. In the following examples the addresses 10.5.1.1 and 10.5.2.1 name two such interfacess. Additional interfaces may be present.

ip tuntap add dev tap0 mode tap
ip addr add 10.5.1.1/24 dev tap0
ip tuntap add dev tap1 mode tap
ip addr add 10.5.2.1/24 dev tap1

These can later be removed

ip tuntap del dev tap0 mode tap
ip tuntap del dev tap1 mode tap

Test IOC

In addition to inspecting the output of the iocsh commands, it is recommended to test a live softIoc.

cat << EOF > test.db
record(calc, "test") {
    field(SCAN, "1 second")
    field(CALC, "VAL+1")
    field(FLNK, "invalid")
}
EOF

Each Test section includes an example invocation of softIoc and several caget.

Tests

Test #1 Defaults

The default configuration is for RSRV is to bind to the wildcard interface (0.0.0.0), and for libca to search on all local interfaces.

./bin/linux-x86/softIoc -d test.db

Client gets should work.

./bin/linux-x86/caget test

A warning "Identical process variable names on multiple servers" should be seen.

epicsParamShow

EPICS_CA_ADDR_LIST is undefined
EPICS_CA_AUTO_ADDR_LIST: YES
EPICS_CA_NAME_SERVERS is undefined
EPICS_CAS_INTF_ADDR_LIST is undefined
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined
EPICS_CAS_BEACON_ADDR_LIST is undefined


casr 1

...
CAS-TCP server on 0.0.0.0:5064 with
    CAS-UDP name server on 0.0.0.0:5064
Sending CAS-beacons to 4 addresses:
    10.5.1.255:5065
    10.5.2.255:5065
    127.255.255.255:5065
    <local address>:5065

dbcar "" 8

...
Search Destination List with 4 items
UDP Search destination "10.5.1.255:5064"
UDP Search destination "10.5.2.255:5064"
... one for remaining local interfaces
...

Test #2 Client address list only

Bind the server to the wildcard address. Client searches only on a sub-set of interfaces.

EPICS_CA_ADDR_LIST=10.5.1.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/softIoc -d test.db

Client gets should work on either interface.

EPICS_CA_ADDR_LIST=10.5.1.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test
EPICS_CA_ADDR_LIST=10.5.2.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

epicsParamShow

EPICS_CA_ADDR_LIST: 10.5.1.255
EPICS_CA_AUTO_ADDR_LIST: NO
EPICS_CA_NAME_SERVERS is undefined
EPICS_CAS_INTF_ADDR_LIST is undefined
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined
EPICS_CAS_BEACON_ADDR_LIST is undefined

casr 1

...
CAS-TCP server on 0.0.0.0:5064 with
    CAS-UDP name server on 0.0.0.0:5064
Sending CAS-beacons to 1 address:
    10.5.1.255:5065

ANJ: Is this beacon list right?

dbcar "" 8

...
Search Destination List with 1 items
UDP Search destination "10.5.1.255:5064"
... No more destinations
...

Test #3 Client and Server on a single interface

RSRV binds to a single interface, and libca only searches on this interface.

EPICS_CAS_INTF_ADDR_LIST=10.5.1.1 \
EPICS_CA_ADDR_LIST=10.5.1.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/softIoc -d test.db

Client gets should work only when the 10.5.1.255 interface.

EPICS_CA_ADDR_LIST=10.5.1.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

and fail on any other interface

EPICS_CA_ADDR_LIST=10.5.2.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

epicsParamShow

EPICS_CA_ADDR_LIST: 10.5.1.255
EPICS_CA_AUTO_ADDR_LIST: NO
EPICS_CA_NAME_SERVERS is undefined
EPICS_CAS_INTF_ADDR_LIST: 10.5.1.1
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined
EPICS_CAS_BEACON_ADDR_LIST is undefined

casr 1

...
CAS-TCP server on 10.5.1.1:5064 with
    CAS-UDP unicast name server on 10.5.1.1:5064
    CAS-UDP broadcast name server on 10.5.1.255:5064
Sending CAS-beacons to 1 address:
    10.5.1.255:5065

Note that on Windows targets only one CAS-UDP name server address will be listed.

dbcar "" 8

...
Search Destination List with 1 items
UDP Search destination "10.5.1.255:5064"
... No more destinations
...

Test #4 Client and Server on a multiple interfaces

RSRV binds to two interfaces, and libca only searches on these interfaces.

EPICS_CAS_INTF_ADDR_LIST="10.5.1.1 10.5.2.1" \
EPICS_CA_ADDR_LIST="10.5.1.255 10.5.2.255" \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/softIoc -d test.db

Client gets should work only when the 10.5.1.255 and 10.5.2.255 interfaces, and fail on any others.

EPICS_CA_ADDR_LIST=10.5.1.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test
EPICS_CA_ADDR_LIST=10.5.2.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

epicsParamShow

EPICS_CA_ADDR_LIST: 10.5.1.255 10.5.2.255
EPICS_CA_AUTO_ADDR_LIST: NO
EPICS_CA_NAME_SERVERS is undefined
EPICS_CAS_INTF_ADDR_LIST: 10.5.1.1 10.5.2.1
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined
EPICS_CAS_BEACON_ADDR_LIST is undefined

casr 1

...
CAS-TCP server on 10.5.1.1:5064 with
    CAS-UDP unicast name server on 10.5.1.1:5064
    CAS-UDP broadcast name server on 10.5.1.255:5064
CAS-TCP server on 10.5.2.1:5064 with
    CAS-UDP unicast name server on 10.5.2.1:5064
    CAS-UDP broadcast name server on 10.5.2.255:5064
Sending CAS-beacons to 2 addresses:
    10.5.1.255:5065
    10.5.2.255:5065

Note that on Windows targets only one CAS-UDP name server address will be listed.

dbcar "" 8

...
Search Destination List with 2 items
UDP Search destination "10.5.1.255:5064"
UDP Search destination "10.5.2.255:5064"
... No more destinations
...

Test #5 Client and Server on different, single, interfaces

RSRV binds to one interface, and libca only searches on another interface. This is a "gateway"-like situation.

EPICS_CAS_INTF_ADDR_LIST=10.5.1.1 \
EPICS_CA_ADDR_LIST=10.5.2.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/softIoc -d test.db

Client gets should work only when the 10.5.1.255 interface.

EPICS_CA_ADDR_LIST=10.5.1.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

and fail on any other interface

EPICS_CA_ADDR_LIST=10.5.2.255 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

Additionally, the IOC's CA client will only search on 10.5.2.255.

epicsParamShow

EPICS_CA_ADDR_LIST: 10.5.2.255
EPICS_CA_AUTO_ADDR_LIST: NO
EPICS_CA_NAME_SERVERS is undefined
EPICS_CAS_INTF_ADDR_LIST: 10.5.1.1
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined
EPICS_CAS_BEACON_ADDR_LIST is undefined

casr 1

...
CAS-TCP server on 10.5.1.1:5064 with
    CAS-UDP unicast name server on 10.5.1.1:5064
    CAS-UDP broadcast name server on 10.5.1.255:5064
Sending CAS-beacons to 1 address:
    10.5.1.255:5065

Note that on Windows targets only one CAS-UDP name server address will be listed.

dbcar "" 8

...
Search Destination List with 1 items
UDP Search destination "10.5.2.255:5064"
... No more destinations
...

Test #6 IPv4 Multicast for search and beacons

Server bound to wildcard. Searches and beacons only with multicast. In addtional a multicast address is specified for name search and beacon messages.

EPICS_CAS_INTF_ADDR_LIST=224.0.2.9 \
EPICS_CA_ADDR_LIST=224.0.2.9 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/softIoc -d test.db

Client searches using the specified multicast address will succeed.

EPICS_CA_ADDR_LIST=224.0.2.9 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

Searches using other multicast addresses will fail.

EPICS_CA_ADDR_LIST=224.0.2.10 \
EPICS_CA_AUTO_ADDR_LIST=NO \
./bin/linux-x86/caget test

epicsParamShow

EPICS_CA_ADDR_LIST: 224.0.2.9
EPICS_CA_AUTO_ADDR_LIST: NO
EPICS_CA_NAME_SERVERS is undefined
EPICS_CAS_INTF_ADDR_LIST: 224.0.2.9
EPICS_CAS_AUTO_BEACON_ADDR_LIST is undefined
EPICS_CAS_BEACON_ADDR_LIST is undefined


casr 1

...
CAS-TCP server on 0.0.0.0:5064 with
    CAS-UDP name server on 0.0.0.0:5064
Monitoring 1 multicast address:
    224.0.2.9:5064
Sending CAS-beacons to 1 address:
    224.0.2.9:5065

dbcar "" 8

...
Search Destination List with 1 items
... no destinations for local interfaces
UDP Search destination "224.0.2.9:5064"
...