20 #ifndef OPFLEX_TEST_MOCKOPFLEXSERVER_H 21 #define OPFLEX_TEST_MOCKOPFLEXSERVER_H 28 class MockOpflexServerImpl;
44 typedef std::pair<uint8_t, std::string>
peer_t;
97 void enableSSL(
const std::string& caStorePath,
98 const std::string& serverKeyPath,
99 const std::string& serverKeyPass,
100 bool verifyPeers =
true);
124 engine::internal::MockOpflexServerImpl* pimpl;
An opflex server we can use for mocking interactions with a real Opflex server.
Definition: MockOpflexServer.h:39
~MockOpflexServer()
Destroy the opflex server.
std::pair< uint8_t, std::string > peer_t
a pair of a role bitmask and connectivity string
Definition: MockOpflexServer.h:44
std::vector< peer_t > peer_vec_t
A vector of peers.
Definition: MockOpflexServer.h:49
void readPolicy(const std::string &file)
Read policy into the server from the specified file.
uint8_t getRoles() const
Get the roles that this server was configured with.
int getPort() const
Get the port number that this server was configured with.
void enableSSL(const std::string &caStorePath, const std::string &serverKeyPath, const std::string &serverKeyPass, bool verifyPeers=true)
Enable SSL for connections to opflex peers.
Definition: OFLogHandler.h:20
MockOpflexServer(int port, uint8_t roles, peer_vec_t peers, const modb::ModelMetadata &md)
Construct a new mock opflex server.
void start()
Start the server.
const peer_vec_t & getPeers() const
Get the peers that this server was configured with.
void stop()
Stop the server.