Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Pavel Zhukov
Kea
Commits
fee053c5
Commit
fee053c5
authored
Mar 07, 2019
by
Michal Nowikowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes after review: updated comments and did other small improvements
parent
a45e2f68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
ChangeLog
ChangeLog
+7
-0
doc/devel/unit-tests.dox
doc/devel/unit-tests.dox
+4
-5
src/lib/testutils/sandbox.h
src/lib/testutils/sandbox.h
+9
-8
No files found.
ChangeLog
View file @
fee053c5
1537. [func] godfryd
Improved handling unix sockets in unit tests. Now by default
they are created in temporary folder under /tmp folder. This
fixes the issue with creating sockets with too long path
in the case when source folder is deeply nested.
(Gitlab #357,!258, git a45e2f68d7d1848adb0cf755954a3d76c9dff338)
1536. [build] tomek
Many changes in keactrl, kea-admin, cql_config and sysrepo_config
scripts. ISC is now using shellcheck to verify portability of
...
...
doc/devel/unit-tests.dox
View file @
fee053c5
...
...
@@ -40,10 +40,9 @@ The following environment variable can affect the unit tests:
- KEA_SOCKET_TEST_DIR - if set, it specifies the directory where Unix
sockets are created. There is an operating system limitation on how
long a Unix socket path can be, typically slightly over 100
characters. If you happen to build and run unit-tests in deeply nested
directories, this may become a problem. KEA_SOCKET_TEST_DIR can be
specified to instruct unit-test to use a different directory. It must
not end with slash.
characters. By default unit-tests create sockets in temporary folder
under /tmp folder. KEA_SOCKET_TEST_DIR can be specified to instruct
unit-tests to use a different directory. It must not end with slash.
@section unitTestsDatabaseConfig Databases Configuration for Unit Tests
...
...
@@ -265,5 +264,5 @@ local all postgres trust
[cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> @endverbatim\n
*/
src/lib/testutils/sandbox.h
View file @
fee053c5
...
...
@@ -11,8 +11,9 @@
#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <cstdlib>
#include <cstdio>
#include <unistd.h>
#include <ftw.h>
namespace
isc
{
...
...
@@ -25,14 +26,12 @@ namespace test {
/// in unit test setup phase, and then it is deleted with its content
/// in destructor ie. in unit test tear down phase.
class
Sandbox
{
private:
/// Path to temporary folder
std
::
string
path_
;
/// @brief Method for deleting files and folders, used in nftw traversal function.
static
int
rmFile
(
const
char
*
fpath
,
const
struct
stat
*
sb
,
int
typeflag
,
struct
FTW
*
ftwbuf
)
{
(
void
)
sb
;
(
void
)
typeflag
;
(
void
)
ftwbuf
;
static
int
rmFile
(
const
char
*
fpath
,
const
struct
stat
*
,
int
,
struct
FTW
*
)
{
return
(
remove
(
fpath
));
}
...
...
@@ -51,9 +50,11 @@ public:
}
}
// @brief Join sandbox path with indicated file subpath.
/// @brief Join sandbox path with indicated file subpath.
///
/// @param file A path to file that should be joined to base path of sandbox.
std
::
string
join
(
std
::
string
file
)
{
return
path_
+
"/"
+
file
;
return
(
path_
+
"/"
+
file
)
;
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment