-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start up redis server, and initialize Sonic DB for tests
Signed-off-by: Saikrishna Arcot <[email protected]>
- Loading branch information
1 parent
008b45d
commit 0902ada
Showing
5 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "gtest/gtest.h" | ||
#include <swss/dbconnector.h> | ||
#include <string> | ||
|
||
std::string database_config = "./test/database_config.json"; | ||
|
||
class DhcpRelayEnvironment : public ::testing::Environment { | ||
public: | ||
// Override this to define how to set up the environment. | ||
void SetUp() override { | ||
// by default , init should be false | ||
EXPECT_FALSE(swss::SonicDBConfig::isInit()); | ||
|
||
// load local config file, init should be true | ||
swss::SonicDBConfig::initialize(database_config); | ||
EXPECT_TRUE(swss::SonicDBConfig::isInit()); | ||
} | ||
}; | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
testing::InitGoogleTest(&argc, argv); | ||
// Registers a global test environment, and verifies that the | ||
// registration function returns its argument. | ||
DhcpRelayEnvironment* env = new DhcpRelayEnvironment; | ||
testing::AddGlobalTestEnvironment(env); | ||
return RUN_ALL_TESTS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
TEST_SRCS += \ | ||
test/mock_send.cpp \ | ||
test/main.cpp \ | ||
src/relay.cpp \ | ||
src/configInterface.cpp \ | ||
test/MockRelay.cpp |