mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 21:18:02 +00:00
[3696] Remove default lease files after unit tests.
This commit is contained in:
parent
05c79aa706
commit
9497258cf7
@ -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
|
// 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
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@ -38,6 +38,11 @@ BaseServerTest::BaseServerTest()
|
|||||||
}
|
}
|
||||||
|
|
||||||
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.
|
// Revert to original data directory.
|
||||||
CfgMgr::instance().setDataDir(original_datadir_);
|
CfgMgr::instance().setDataDir(original_datadir_);
|
||||||
}
|
}
|
||||||
|
@ -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
|
// 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
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
@ -60,11 +60,6 @@ public:
|
|||||||
LeaseMgrFactory::destroy();
|
LeaseMgrFactory::destroy();
|
||||||
isc::log::setDefaultLoggingOutput();
|
isc::log::setDefaultLoggingOutput();
|
||||||
static_cast<void>(remove(TEST_FILE));
|
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
|
/// @brief writes specified content to a well known 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
|
// 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
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@ -38,6 +38,12 @@ BaseServerTest::~BaseServerTest() {
|
|||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
s << CfgMgr::instance().getDataDir() << "/" << DUID_FILE;
|
s << CfgMgr::instance().getDataDir() << "/" << DUID_FILE;
|
||||||
static_cast<void>(::remove(s.str().c_str()));
|
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.
|
// Revert to original data directory.
|
||||||
CfgMgr::instance().setDataDir(original_datadir_);
|
CfgMgr::instance().setDataDir(original_datadir_);
|
||||||
}
|
}
|
||||||
|
@ -56,11 +56,6 @@ public:
|
|||||||
LeaseMgrFactory::destroy();
|
LeaseMgrFactory::destroy();
|
||||||
isc::log::setDefaultLoggingOutput();
|
isc::log::setDefaultLoggingOutput();
|
||||||
static_cast<void>(remove(TEST_FILE));
|
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) {
|
void writeFile(const std::string& file_name, const std::string& content) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user