|
ZeroSDN Controller
1.0
A modular distributed Software-Defined Network Controller
|
This class contains and runs Unit-Tests for SwitchRegistryModule. More...
#include <SwitchRegistryModuleTests.h>
This class contains and runs Unit-Tests for SwitchRegistryModule.
The class contains Unit-Tests for SwitchRegistryModule. Each test starts by setting up an environment for the test, with the startup()-method. Then the test itself is run, and it is evaluated, whether the test is successful. At last the test-environment is cleaned up again. If not stated different, the Switch-Version should be OpenFlow 1.3
| SwitchRegistryModuleTests::SwitchRegistryModuleTests | ( | ) |
Constructor for the Class
| void SwitchRegistryModuleTests::setUp | ( | ) |
This method sets the environment for tests up. It initializes the module and adds some dummy-Switches to test with. Additionally there will be a second ZMF-Instance initialized, that listens to messages from our module, to see wether messages are actually sent.
| void SwitchRegistryModuleTests::tearDown | ( | ) |
This method shuts down and cleans the environment for each Unit-Test. It is called after each test is done.
| void SwitchRegistryModuleTests::testDisableAndEnableModuleWithInvalidSwitchInZMF | ( | ) |
This test emulates a disable() and enable() of the SwitchRegistryModule with one invalid Switch in ZMF. Result should be after disable() Switch-list is empty, after enable() nothing happens
| void SwitchRegistryModuleTests::testDisableAndEnableModuleWithValidSwitchInZMF | ( | ) |
This test emulates a disable() and enable() of the SwitchRegistryModule with one valid Switch in ZMF. Result should be after disable() Swich-list is empty, after enable() 1 Switch added to list and feature/multipart-request sent.
| void SwitchRegistryModuleTests::testEchoKnownActiveSwitch | ( | ) |
This test emulates a Echo-Request from a known and active switch. Result should be nothing happens.
| void SwitchRegistryModuleTests::testEchoKnownSwitch | ( | ) |
This test emulates a Echo-Request from a known, but as inactive marked switch. Result should be Feature-Request and Multipart-Request are sent.
| void SwitchRegistryModuleTests::testEchoUnknownSwitch | ( | ) |
This test emulates a Echo-Request from an unknown switch. Result should be Switch is added and Feature-Request and Multipart-Request are sent.
| void SwitchRegistryModuleTests::testFeatureReplyKnownSwitchActiveToBeginWith | ( | ) |
This test emulates a Feature-Reply From a known, as active marked Switch. Result should be Information is updated and a CHANGED-message is sent.
| void SwitchRegistryModuleTests::testFeatureReplyKnownSwitchBecomeActive | ( | ) |
This test emulates a Feature-Reply From a known, as inactive marked Switch. Result should be Information is added and a ADDED-message is sent.
| void SwitchRegistryModuleTests::testFeatureReplyKnownSwitchNoBecomeActive | ( | ) |
This test emulates a Feature-Reply From a known, as inactive marked Switch. Result should be Information is added, but no messages sent.
| void SwitchRegistryModuleTests::testFeatureReplyKnownSwitchOf1_0NotActive | ( | ) |
This test emulates a Feature-Reply From a known, as inactive marked Switch with OF-Version 1.0. Result should be Information is added and a ADDED-messages is sent.
| void SwitchRegistryModuleTests::testFeatureReplyUnknownSwitch | ( | ) |
This test emulates a Feature-Reply from an unknown switch. Result should be nothing happens.
| void SwitchRegistryModuleTests::testModuleStateChangeAddKnownSwitchAdapterAndDeleteActiveOne | ( | ) |
This test emulates a known SwitchAdapter become active and an as active marked SwitchAdapter to become dead. Result should be nothing happens for the first part and remove 1 Switch and REMOVED-message sent for 2nd part.
| void SwitchRegistryModuleTests::testModuleStateChangeAddNew1_0SwitchAdapter | ( | ) |
This test emulates a SwitchAdapterModule with OF 1.0 to become active. Result should be 1 Switch added and Feature-Request sent.
| void SwitchRegistryModuleTests::testModuleStateChangeAddNew1_3SwitchAdapterAndDeleteNoActiveOne | ( | ) |
This test emulates a SwitchAdapterModule with OF 1.3 to become active and an as inactive marked SwitchAdapter to become dead. Result should be 1 Switch added and Multipart/Feature-Request sent for first part and 1 Switch removed for 2nd part.
| void SwitchRegistryModuleTests::testModuleStateChangeNoSwitchAdapter | ( | ) |
This test emulates a non-SwitchAdapterModule to become active. Result should be nothing happens.
| void SwitchRegistryModuleTests::testMultiPartAnyUnknownSwitch | ( | ) |
This test emulates a Multipart-Reply from an unknown Switch. Result should be nothing happens.
| void SwitchRegistryModuleTests::testMultiPartPortDescReplyKnownSwitchActiveToBeginWith | ( | ) |
This test emulates a Port-Desc-Multipart-Reply from a known, as active marked Switch. Result should be Information is updated and a CHANGED-message is sent.
| void SwitchRegistryModuleTests::testMultiPartPortDescReplyKnownSwitchBecomeActive | ( | ) |
This test emulates a Port-Desc-Multipart-Reply from a known, as inactive marked Switch. Result should be Information is added and a ADDED-message is sent.
| void SwitchRegistryModuleTests::testMultiPartPortDescReplyKnownSwitchNoBecomeActive | ( | ) |
This test emulates a Port-Desc-Multipart-Reply from a known, as inactive marked Switch. Result should be Information is added, but no messages sent.
| void SwitchRegistryModuleTests::testMultiPartPortNoDescReply | ( | ) |
This test emulates a Multipart-Reply of a different type from a known, as active marked Switch. Result should be nothing happens.
| void SwitchRegistryModuleTests::testPortStatusKnownSwitchReasonInvalid | ( | ) |
This test emulates a Port-Status-message from a known switch with a invalid reason. Result should be nothing happens.
| void SwitchRegistryModuleTests::testPortStatusKnownSwitchReasonPortAdded | ( | ) |
This test emulates a Port-Status-message from a known switch with a new port added. Result should be the new port is added to Switch-Info and CHANGED-messge is sent.
| void SwitchRegistryModuleTests::testPortStatusKnownSwitchReasonPortDeleted | ( | ) |
This test emulates a Port-Status-message from a known switch with a deleted port. Result should be the port is deleted from Switch-Info and CHANGED-messge is sent.
| void SwitchRegistryModuleTests::testPortStatusKnownSwitchReasonPortModified | ( | ) |
This test emulates a Port-Status-message from a known switch with a modified port. Result should be the portinfo is updated and CHANGED-messge is sent.
| void SwitchRegistryModuleTests::testPortStatusUnknownSwitch | ( | ) |
This test emulates a Port-Status-message from an unknown switch. Result should be nothing happens.
| void SwitchRegistryModuleTests::testRequestAllSwitches | ( | ) |
This test sends an All-Switches-Request to the module per Request-Reply. Answer should be all added Switches.
| void SwitchRegistryModuleTests::testRequestSwitchByID | ( | ) |
This test sends a Switch-Request to the module per Request-Reply. Answer should be the Switch with the requested ID.
| void SwitchRegistryModuleTests::testRequestTrollRequest | ( | ) |
This test sends a serialized String to the Switch, which should not be parseable to a request. Answer should be NO-REPLY.
| void SwitchRegistryModuleTests::testRequestUnknownRequest | ( | ) |
This test sends a valid Request of unkonwn type to the Switch. Answer should be a NO-REPLY.