Commit 10966aa7 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[5078] Use KEA_SOCKET_TEST_DIR env variable to work around max path limit.

parent d3927be0
......@@ -20,6 +20,7 @@
#include <boost/bind.hpp>
#include <boost/pointer_cast.hpp>
#include <gtest/gtest.h>
#include <cstdlib>
using namespace isc::agent;
using namespace isc::asiolink;
......@@ -83,9 +84,20 @@ public:
}
/// @brief Returns socket file path.
///
/// If the KEA_SOCKET_TEST_DIR environment variable is specified, the
/// socket file is created in the location pointed to by this variable.
/// Otherwise, it is created in the build directory.
static std::string unixSocketFilePath() {
std::ostringstream s;
s << TEST_DATA_BUILDDIR << "/" << TEST_SOCKET;
const char* env = getenv("KEA_SOCKET_TEST_DIR");
if (env) {
s << std::string(env);
} else {
s << TEST_DATA_BUILDDIR;
}
s << "/" << TEST_SOCKET;
return (s.str());
}
......
......@@ -12,6 +12,7 @@
#include <gtest/gtest.h>
#include <array>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <string>
......@@ -46,9 +47,20 @@ public:
}
/// @brief Returns socket file path.
///
/// If the KEA_SOCKET_TEST_DIR environment variable is specified, the
/// socket file is created in the location pointed to by this variable.
/// Otherwise, it is created in the build directory.
static std::string unixSocketFilePath() {
std::ostringstream s;
s << TEST_DATA_BUILDDIR << "/" << TEST_SOCKET;
const char* env = getenv("KEA_SOCKET_TEST_DIR");
if (env) {
s << std::string(env);
} else {
s << TEST_DATA_BUILDDIR;
}
s << "/" << TEST_SOCKET;
return (s.str());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment