...
Anchor Contribute Contribute
How to Contribute to CHOTestMonkey
| Contribute | |
| Contribute |
CHOTestMonkey is still experimental and there are many TODOs. Any contribution to CHOTestMonkey framework is welcomed.
Specifically, adding more events into the framework can be the first step to contribute. CHOTestMonkey is designed to be extensible, and as a result, only two steps are needed to add a new event:
- Put related information e.g. event name, type, status, etc. into .params file, and
- Write a new class for the event
For example, to add a new event which checks onos logs for errors, first we need to put the following information into CHOTestMonkey.params file:
| Code Block |
|---|
<LogCheck>
<status>on</status>
<typeIndex>15</typeIndex>
<typeString>CHECK_LOG</typeString>
<CLI>check-log</CLI>
<CLIParamNum>0</CLIParamsNum>
<rerunInterval>5</rerunInterval>
<maxRerunNum>5</maxRerunNum>
</LogCheck> |
"LogCheck" is the name of the class which contains all functionalities of the event. The "status" tag devices whether this event is enabled in the test or not. "TypeIndex" and "TypeString" are identifiers of the event inside CHOTestMonkey. It is suggested to start typeString with the "event family", namely CHECK, NETWORK, APP, ONOS and TEST, and also to aggregate typeIndex (e.g. 10 <= typeIndex < 20 for all check events). "CLI" and "CLIParamNum" tags indicate the CLI command string to trigger this event and the number of arguments it takes. Finally, "rerunInterval" and "maxRerunNum" are used to configure retry intervals and numbers upon event failures. Besides, it is also encouraged to add other event specific parameters here.
The rest of the work is to implement the functionality of the event. As described above, events belong to individual events or group events. We make LogCheck an individual event since it makes sense to regard it as an atomic operation in CHOTestMonkey. Therefore, we suggest adding "LogCheck" class into CheckEvent.py since it belongs to the check event family. Please refer to CheckEvent.py for more implementation details. Group events should be added into EventGenerator.py where it needs to be broken down into multiple individual events. Please check EventGenerator.py (e.g. installAllHostIntents class) for more details.Add more events