We recently added a simple feature that makes it easier to achieve more thorough coverage automatically. (A draft of this post had a lot of words that were confusing even to me. Pictures should make the whole thing easier.)
Let’s say you have a CPE with two ports, and you’re connecting a pair of this CPE to your RCG-4001. Further, let’s say your CPE supports SIP, MGCP, and H.248, and that you support a flavor of MGCP that is “native” all the way back to a softswitch, and another that is gatewayed over a GR-303 link back to a switch (so when we say “GR-303″ we mean this flavor of MGCP). The picture below shows this pair of CPEs with one port set up for each protocol type:
On the RCG, the config file that maps a physical port to the named port you use in a script is called portmap.conf. You can have multiple mappings configured in the file, each with a unique name. And you can choose between which portmap is active when you launch a test suite. Here’s a possible portmap for the RCG shown above:
[DEFAULT]
port_map = {'A': 'port0', 'C': 'port1', 'B': 'port2', 'D': 'port3'}
[sip-mgcp]
port_map = {'A': 'port0', 'B': 'port1', 'C': 'port2', 'D': 'port3'}
[sip-h248]
port_map = {'A': 'port0', 'C': 'port1', 'B': 'port2', 'D': 'port3'}
[sip-gr303]
port_map = {'A': 'port0', 'D': 'port1', 'C': 'port2', 'B': 'port3'}
[mgcp-sip]
port_map = {'B': 'port0', 'A': 'port1', 'C': 'port2', 'D': 'port3'}
You could list all of the possible combinations — this is enough for this example. The scripts that ship with the RCG refer to ports as “A”, “B”, “C”, “D”. The “a_calls_b” script places a call from “port A” to “port B”; whichever physical ports map to A and B are the ones that will be used by the test. You’ll notice that we’ve provided a “DEFAULT” mapping — this is required. We’ve chosen to make the “sip-mgcp” mapping the same so that we have a convenient mnemonic that refers to this mapping.
In our most recent release, the test suites take a “–portmap=” argument that allows you to select the portmap. For example:
bash$ a_calls_b.py --portmap=sip-h248 a_calls_b$
This will place a call from physical port 0 to physical port 2 (the SIP port on CPE1 to the H.248 port on CPE2).
In our upcoming release, you can list multiple portmaps on the command line. For example:
bash$ a_calls_b.py --portmap=sip-mgcp,sip-h248-sip-gr303,mgcp-sip a_calls_b$
This will run the script four times, once each using each listed portmap. You can run a custom test suite with this argument, and the suite will be run in the various mappings. You can kick off an three hour long test suite with ten different portmaps on Friday evening and not have to worry about relaunching the test, touching config files, or changing cables every few hours over the weekend.
We’ve talked internally about how we might automatically generate all of the relevant maps. How would you like to see this work? Leave a comment below or drop us a note.
Related posts:


