![]() |
Kea
2.5.2
|
Test fixture for testing loading and unloading of hook libraries. More...
#include <lib_load_test_fixture.h>
Public Member Functions | |
LibLoadTest (const std::string lib_so_name="no-lib-specified") | |
Constructor. More... | |
~LibLoadTest () | |
Destructor. Unloads any previously loaded libraries. More... | |
void | addLibrary (const std::string &library, isc::data::ConstElementPtr parameters) |
Adds a library along with its parameters to the list of libraries to be loaded. More... | |
void | clearLibraries () |
void | invalidDaemonTest (const std::string &daemon_name, uint16_t family=AF_INET, const isc::data::ElementPtr ¶ms=isc::data::ElementPtr()) |
Verifies that an invalid daemon cannot load the library. More... | |
bool | loadLibraries () |
Load all libraries. More... | |
virtual void | SetUp () |
bool | unloadLibraries () |
Unloads all libraries. More... | |
virtual isc::data::ElementPtr | validConfigParams () |
Creates a set configuration parameters valid for the library. More... | |
void | validDaemonTest (const std::string &daemon_name, uint16_t family=AF_INET, const isc::data::ElementPtr ¶ms=isc::data::ElementPtr()) |
Verifies that a valid daemon can load and unload a library multiple times. More... | |
Public Attributes | |
std::string | lib_so_name_ |
full pathname to the library so file under test; More... | |
isc::hooks::HookLibsCollection | libraries_ |
Libraries. More... | |
isc::data::ElementPtr | valid_params_ |
Contains a set configuration parameters valid for the library. More... | |
Test fixture for testing loading and unloading of hook libraries.
Definition at line 19 of file lib_load_test_fixture.h.
|
inline |
Constructor.
Unloads any previously loaded libraries.
lib_so_name_ | full pathname to the library so file under test |
Definition at line 24 of file lib_load_test_fixture.h.
References unloadLibraries().
|
inline |
Destructor. Unloads any previously loaded libraries.
Definition at line 34 of file lib_load_test_fixture.h.
References unloadLibraries().
|
inline |
Adds a library along with its parameters to the list of libraries to be loaded.
library | the path to the library to be loaded |
parameters | the library's parameters in Element format |
Definition at line 43 of file lib_load_test_fixture.h.
References libraries_.
Referenced by invalidDaemonTest(), and validDaemonTest().
|
inline |
Definition at line 48 of file lib_load_test_fixture.h.
References libraries_.
Referenced by invalidDaemonTest(), and validDaemonTest().
|
inline |
Verifies that an invalid daemon cannot load the library.
libname | full path to the library's SO. Typically this value is defined in the Makefile (e.g. -DLIBDHCP_BOOTP_SO=...) |
daemon_name | name of the daemon that should try to load the library |
family | Protocol family of the loading daemon, either AF_INET or AF_INET6. Defaults to AF_INET. |
params | ElementPtr to set of parameters that are valid for the library. Defaults to an empty pointer. |
Definition at line 113 of file lib_load_test_fixture.h.
References addLibrary(), ASSERT_NO_THROW_LOG, clearLibraries(), isc::dhcp::CfgMgr::instance(), lib_so_name_, loadLibraries(), isc::dhcp::CfgMgr::setFamily(), and isc::process::Daemon::setProcName().
|
inline |
Load all libraries.
Definition at line 56 of file lib_load_test_fixture.h.
References libraries_, and isc::hooks::HooksManager::loadLibraries().
Referenced by invalidDaemonTest(), and validDaemonTest().
|
inlinevirtual |
Definition at line 29 of file lib_load_test_fixture.h.
References valid_params_, and validConfigParams().
|
inline |
Unloads all libraries.
Definition at line 66 of file lib_load_test_fixture.h.
References isc::hooks::HooksManager::unloadLibraries().
Referenced by LibLoadTest(), ~LibLoadTest(), and validDaemonTest().
|
inlinevirtual |
Creates a set configuration parameters valid for the library.
Definition at line 131 of file lib_load_test_fixture.h.
References isc::data::Element::createMap().
Referenced by SetUp().
|
inline |
Verifies that a valid daemon can load and unload a library multiple times.
daemon_name | name of the daemon that should try to load the library |
family | Protocol family of the loading daemon, either AF_INET or AF_INET6. Defaults to AF_INET. |
params | ElementPtr to set of parameters that are valid for the library. Defaults to an empty pointer. |
Definition at line 82 of file lib_load_test_fixture.h.
References addLibrary(), ASSERT_NO_THROW_LOG, clearLibraries(), isc::dhcp::CfgMgr::instance(), lib_so_name_, loadLibraries(), isc::dhcp::CfgMgr::setFamily(), isc::process::Daemon::setProcName(), and unloadLibraries().
std::string isc::test::LibLoadTest::lib_so_name_ |
full pathname to the library so file under test;
Definition at line 136 of file lib_load_test_fixture.h.
Referenced by invalidDaemonTest(), and validDaemonTest().
isc::hooks::HookLibsCollection isc::test::LibLoadTest::libraries_ |
Libraries.
Definition at line 139 of file lib_load_test_fixture.h.
Referenced by addLibrary(), clearLibraries(), and loadLibraries().
isc::data::ElementPtr isc::test::LibLoadTest::valid_params_ |
Contains a set configuration parameters valid for the library.
Definition at line 142 of file lib_load_test_fixture.h.
Referenced by SetUp().