This repository was archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Home
Diego Rabatone Oliveira edited this page Jul 20, 2016
·
4 revisions
Welcome to the python-openflow wiki!
Here we have the main Tests guidelines of the python-openflow library.
The main guidelines are:
- Follow TDD, which means: Write testes before writing codes!!
- We aim test coverage of 100%;
- Invalid messages must raise exceptions, and these exceptions must be covered by unittests;
- All Messages must be tested (for attributes order and also size);
- All reimplemented methods must be tested.
Considering the above described guidelines, bellow are some tasks that need to be done:
- Struct size: assert the basic class size according to OFSpec (structs asserts) (get_size method);
-
Pack:
- Check by comparing the result of pack() with raw files;
- This must be done for all messages, 'structs' and basic_types;
-
Unpack:
- Check by unpacking a known raw file and evaluating the values of the unpacked object with the expected ones;
- This must be done for all messages, 'structs' and basic_types;
- OpenFlow Spec compliance for attributes restrictions:
- Look for constrains defined on the OpenFlow specification for each attribute (Not all attributes have constrains);
- Main constrains: value limitation based on pre-defined constants