Modules File
Modules File
CDRouter requires there be a file named modules
at the top-level of
every testpath. This file is known as a modules file. A modules
file defines the test modules in a testpath using calls to
buddy::module_define
which take the following form:
buddy::module_define mymodule.tcl {
PROPERTIES...
}
The properties inside the module definition tell cdrouter-cli
when a
module should or should not be loaded.
Properties
Below are the properties that can be assigned to a module.
description
Module descriptions are declared in the modules file using the
description
property. This is the module description which is
displayed when running cdrouter-cli -list
or in CDRouter’s
documentation section.
buddy::module_define mymodule.tcl {
description "The module description goes here"
}
group
This property indicates which CDRouter addon the test module belongs
to. This determines where a test module shows up in CDRouter’s
package editor (/packages/new
and /packages/:id/edit
). The
possible values for this property are:
Group | Description |
---|---|
CDRouter |
Modules exclusive to CDRouter base |
Multiport |
Modules exclusive to CDRouter Multiport product |
TR-069 |
Modules exclusive to CDRouter TR-069 / TR-069 EDM addon |
BBF.069 |
Modules exclusive to CDRouter BBF.069 addon |
IKE |
Modules exclusive to CDRouter IKE addon |
IPv6 |
Modules exclusive to CDRouter IPv6 addon |
Storage |
Modules exclusive to CDRouter Storage addon |
SNMP |
Modules exclusive to CDRouter SNMP addon |
Nmap |
Modules exclusive to CDRouter Nmap addon |
Performance |
Modules exclusive to CDRouter Performance addon |
Custom |
Used only for user-created, custom test modules |
For example, the following snippet would make the mymodule.tcl
test
module show up under the IPv6 group in CDRouter:
buddy::module_define mymodule.tcl {
group IPv6
}
required-addons
This property tells cdrouter-cli
which addons must be enabled in the
license file to allow the module to be loaded. The value of the
property should be a Tcl list whose values are options that can be
passed to the qacafe
Tcl command and which return either yes
or
no
. The current valid options are:
Addon | Description |
---|---|
bbf.069 |
Test module requires BBF.069 addon |
ics |
Test module requires ICS addon |
ike |
Test module requires IKE addon |
ipv6 |
Test module requires IPv6 addon |
multiport |
Test module requires Multiport addon |
nmap |
Test module requires Nmap addon |
performance |
Test module requires Performance addon |
snmp |
Test module requires SNMP addon |
storage |
Test module requires Storage addon |
tr69 |
Test module requires TR-069 addon |
tr69-edm |
Test module requires TR-069 EDM addon |
For example, to only load the test module mymodule.tcl
if the both
the Storage and IPv6 addons are enabled, use the following snippet:
buddy::module_define mymodule.tcl {
required-addons { storage ipv6 }
}
demo
When running CDRouter Demo, any module without a demo
property of
yes
will not be loaded. The absence of a demo
property implies a
value of no
. To allow a module to be loaded in CDRouter Demo, use
the following snippet:
buddy::module_define mymodule.tcl {
demo yes
}