+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
- 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
[cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> @endverbatim\n
-
+
*/
#include <iostream>
#include <string>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
+#include <unistd.h>
#include <ftw.h>
namespace isc {
/// 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));
}
}
}
- // @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);
}
};