36 static int rmFile(
const char *fpath,
const struct stat *,
int ,
struct FTW *) {
37 return(
remove(fpath));
43 char tmpl[] = {P_tmpdir
"/kea-XXXXXX"};
44 path_ = mkdtemp(tmpl);
50 if (nftw(path_.c_str(), Sandbox::rmFile, 10, FTW_DEPTH | FTW_MOUNT | FTW_PHYS) < 0) {
51 auto msg =
"Some error occurred while deleting unit test sandbox " + path_;
52 std::perror(msg.c_str());
60 std::string
join(std::string file) {
61 return (path_ +
"/" + file);
~Sandbox()
Destructor, it deletes temporary folder with its content.
Sandbox()
Sandbox constructor.
std::string join(std::string file)
Join sandbox path with indicated file subpath.
Defines the logger used by the top-level component of kea-dhcp-ddns.
A Sandbox class that provides access to unit test unique temporary folder.