}
getController().reset();
- static_cast<void>(unlink(CFG_TEST_FILE));
+ static_cast<void>(remove(CFG_TEST_FILE));
}
/// @brief Convenience method that destructs and then recreates the
resetConfiguration();
// ... and delete the hooks library marker files if present
- unlink(LOAD_MARKER_FILE);
- unlink(UNLOAD_MARKER_FILE);
+ remove(LOAD_MARKER_FILE);
+ remove(UNLOAD_MARKER_FILE);
};
/// @brief Returns an interface configuration used by the most of the
HooksManager::unloadLibraries();
// Get rid of any marker files.
- static_cast<void>(unlink(LOAD_MARKER_FILE));
- static_cast<void>(unlink(UNLOAD_MARKER_FILE));
+ static_cast<void>(remove(LOAD_MARKER_FILE));
+ static_cast<void>(remove(UNLOAD_MARKER_FILE));
}
};
~JSONFileBackendTest() {
isc::log::setDefaultLoggingOutput();
- static_cast<void>(unlink(TEST_FILE));
+ static_cast<void>(remove(TEST_FILE));
};
/// @brief writes specified content to a well known file
///
/// @param content content to be written to file
void writeFile(const std::string& content) {
- static_cast<void>(unlink(TEST_FILE));
+ static_cast<void>(remove(TEST_FILE));
ofstream out(TEST_FILE, ios::trunc);
EXPECT_TRUE(out.is_open());
resetConfiguration();
// ... and delete the hooks library marker files if present
- unlink(LOAD_MARKER_FILE);
- unlink(UNLOAD_MARKER_FILE);
+ remove(LOAD_MARKER_FILE);
+ remove(UNLOAD_MARKER_FILE);
};
// Checks if config_result (result of DHCP server configuration) has
-// Copyright (C) 2012-2013,2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2013, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
HooksManager::unloadLibraries();
// Get rid of any marker files.
- static_cast<void>(unlink(LOAD_MARKER_FILE));
- static_cast<void>(unlink(UNLOAD_MARKER_FILE));
+ static_cast<void>(remove(LOAD_MARKER_FILE));
+ static_cast<void>(remove(UNLOAD_MARKER_FILE));
}
};
ASSERT_TRUE(expected_duid1 == srv.getServerID()->getData());
// Now test writing to a file
- EXPECT_EQ(0, unlink(DUID_FILE));
+ EXPECT_EQ(0, remove(DUID_FILE));
EXPECT_NO_THROW(srv.writeServerID(DUID_FILE));
fstream file2(DUID_FILE, ios::in);
NakedDhcpv6SrvTest() : rcode_(-1) {
// it's ok if that fails. There should not be such a file anyway
- unlink(DUID_FILE);
+ remove(DUID_FILE);
const isc::dhcp::IfaceMgr::IfaceCollection& ifaces =
isc::dhcp::IfaceMgr::instance().getIfaces();
virtual ~NakedDhcpv6SrvTest() {
// Let's clean up if there is such a file.
- unlink(DUID_FILE);
+ remove(DUID_FILE);
isc::hooks::HooksManager::preCalloutsLibraryHandle()
.deregisterAllCallouts("buffer6_receive");
isc::hooks::HooksManager::preCalloutsLibraryHandle()
~JSONFileBackendTest() {
isc::log::setDefaultLoggingOutput();
- static_cast<void>(unlink(TEST_FILE));
+ static_cast<void>(remove(TEST_FILE));
};
void writeFile(const std::string& file_name, const std::string& content) {
- static_cast<void>(unlink(file_name.c_str()));
+ static_cast<void>(remove(file_name.c_str()));
ofstream out(file_name.c_str(), ios::trunc);
EXPECT_TRUE(out.is_open());
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
/// @param content text to be written to disk
void writeFile(const std::string& content) {
// Write sample content to disk
- unlink(TEMP_FILE);
+ remove(TEMP_FILE);
std::ofstream write_me(TEMP_FILE);
EXPECT_TRUE(write_me.is_open());
write_me << content;
/// destructor
~DataFileTest() {
- static_cast<void>(unlink(TEMP_FILE));
+ static_cast<void>(remove(TEMP_FILE));
}
/// Name of the temporary file
-// Copyright (C) 2009,2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2009, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
~TestDomainSocket() {
socket_.close();
- unlink(BUNDY_TEST_SOCKET_FILE);
+ remove(BUNDY_TEST_SOCKET_FILE);
}
static void acceptHandler(const asio::error_code&) {
protected:
SessionTest() : sess(my_io_service), work(my_io_service) {
// The TestDomainSocket is held as a 'new'-ed pointer,
- // so we can call unlink() first.
- unlink(BUNDY_TEST_SOCKET_FILE);
+ // so we can call remove() first.
+ remove(BUNDY_TEST_SOCKET_FILE);
tds = new TestDomainSocket(my_io_service, BUNDY_TEST_SOCKET_FILE);
}
// Testing socket operation in a portable way is tricky
// without interface detection implemented
- unlink("interfaces.txt");
+ remove("interfaces.txt");
ofstream interfaces("interfaces.txt", ios::ate);
interfaces << "eth0 fe80::21e:8cff:fe9b:7349";
-// Copyright (C) 2013,2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
callout_manager_.reset(new CalloutManager(4));
// Ensure the marker file is not present at the start of a test.
- static_cast<void>(unlink(MARKER_FILE));
+ static_cast<void>(remove(MARKER_FILE));
}
/// @brief Destructor
///
/// Ensures a marker file is removed after each test.
~LibraryManagerTest() {
- static_cast<void>(unlink(MARKER_FILE));
+ static_cast<void>(remove(MARKER_FILE));
}
/// @brief Marker file present
EXPECT_TRUE(locker.unlock());
EXPECT_FALSE(locker.isLocked());
- EXPECT_EQ (0, unlink(TEST_DATA_TOPBUILDDIR "/test_lockfile"));
+ EXPECT_EQ (0, remove(TEST_DATA_TOPBUILDDIR "/test_lockfile"));
}
TEST(InterprocessSyncFileTest, TestMultipleFilesDirect) {
EXPECT_TRUE(locker.unlock());
- EXPECT_EQ (0, unlink(TEST_DATA_TOPBUILDDIR "/test1_lockfile"));
- EXPECT_EQ (0, unlink(TEST_DATA_TOPBUILDDIR "/test2_lockfile"));
+ EXPECT_EQ (0, remove(TEST_DATA_TOPBUILDDIR "/test1_lockfile"));
+ EXPECT_EQ (0, remove(TEST_DATA_TOPBUILDDIR "/test2_lockfile"));
}
TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
EXPECT_EQ(0, locked);
}
- EXPECT_EQ (0, unlink(TEST_DATA_TOPBUILDDIR "/test2_lockfile"));
+ EXPECT_EQ (0, remove(TEST_DATA_TOPBUILDDIR "/test2_lockfile"));
}
EXPECT_TRUE(locker.unlock());
- EXPECT_EQ (0, unlink(TEST_DATA_TOPBUILDDIR "/test1_lockfile"));
+ EXPECT_EQ (0, remove(TEST_DATA_TOPBUILDDIR "/test1_lockfile"));
}
} // unnamed namespace
-// Copyright (C) 2011,2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// Destructor, remove the file. This is only a test, so ignore failures
~SpecificationForFileLogger() {
if (! name_.empty()) {
- static_cast<void>(unlink(name_.c_str()));
+ static_cast<void>(remove(name_.c_str()));
// Depending on the log4cplus version, a lock file may also be
// created.
- static_cast<void>(unlink((name_ + ".lock").c_str()));
+ static_cast<void>(remove((name_ + ".lock").c_str()));
}
}
// For the first test, we want to check that the file is created
// if it does not already exist. So delete the temporary file before
// logging the first message.
- unlink(file_spec.getFileName().c_str());
+ remove(file_spec.getFileName().c_str());
// Set up the file appenders.
LoggerManager manager;
for (int i = 0; i < 3; ++i) {
prev_name.push_back(file_spec.getFileName() + "." +
boost::lexical_cast<string>(i + 1));
- (void) unlink(prev_name[i].c_str());
+ (void) remove(prev_name[i].c_str());
}
// Generate an argument for a message that ensures that the message when
// Tidy up
for (vector<string>::size_type i = 0; i < prev_name.size(); ++i) {
- (void) unlink(prev_name[i].c_str());
+ (void) remove(prev_name[i].c_str());
}
}
// For the first test, we want to check that the file is created
// if it does not already exist. So delete the temporary file before
// logging the first message.
- unlink(file_spec.getFileName().c_str());
+ remove(file_spec.getFileName().c_str());
// Set up the file appenders.
LoggerManager manager;
-// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
large_text_(65535, 'a'),
test_un_len_(2 + strlen(TEST_UNIX_FILE))
{
- unlink(TEST_UNIX_FILE);
+ remove(TEST_UNIX_FILE);
test_un_.sun_family = AF_UNIX;
strncpy(test_un_.sun_path, TEST_UNIX_FILE, sizeof(test_un_.sun_path));
#ifdef HAVE_SA_LEN
if (listen_fd_ != -1) {
close(listen_fd_);
}
- unlink(TEST_UNIX_FILE);
+ remove(TEST_UNIX_FILE);
}
// Start an internal "socket session server".