2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 13:07:50 +00:00

[3696] Remove default lease files after unit tests.

This commit is contained in:
Marcin Siodelski 2016-01-12 16:49:00 +01:00
parent 05c79aa706
commit 9497258cf7
5 changed files with 14 additions and 13 deletions

View File

@ -1,4 +1,4 @@
// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@ -38,6 +38,11 @@ BaseServerTest::BaseServerTest()
}
BaseServerTest::~BaseServerTest() {
// Remove default lease file.
std::ostringstream s2;
s2 << CfgMgr::instance().getDataDir() << "/" << "kea-leases4.csv";
static_cast<void>(::remove(s2.str().c_str()));
// Revert to original data directory.
CfgMgr::instance().setDataDir(original_datadir_);
}

View File

@ -1,4 +1,4 @@
// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -60,11 +60,6 @@ public:
LeaseMgrFactory::destroy();
isc::log::setDefaultLoggingOutput();
static_cast<void>(remove(TEST_FILE));
// Remove default lease file.
std::ostringstream s;
s << CfgMgr::instance().getDataDir() << "/kea-leases4.csv";
static_cast<void>(remove(s.str().c_str()));
};
/// @brief writes specified content to a well known file

View File

@ -1,4 +1,4 @@
// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@ -38,6 +38,12 @@ BaseServerTest::~BaseServerTest() {
std::ostringstream s;
s << CfgMgr::instance().getDataDir() << "/" << DUID_FILE;
static_cast<void>(::remove(s.str().c_str()));
// Remove default lease file.
std::ostringstream s2;
s2 << CfgMgr::instance().getDataDir() << "/" << "kea-leases6.csv";
static_cast<void>(::remove(s2.str().c_str()));
// Revert to original data directory.
CfgMgr::instance().setDataDir(original_datadir_);
}

View File

@ -56,11 +56,6 @@ public:
LeaseMgrFactory::destroy();
isc::log::setDefaultLoggingOutput();
static_cast<void>(remove(TEST_FILE));
// Remove default lease file.
std::ostringstream s;
s << CfgMgr::instance().getDataDir() << "/kea-leases6.csv";
static_cast<void>(remove(s.str().c_str()));
};
void writeFile(const std::string& file_name, const std::string& content) {