Skip to content

Commit 72561ba

Browse files
committed
test UPDATE server unix socket param changes
1 parent 341e15c commit 72561ba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/np2_test.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ np2_glob_test_setup_server(void **state, const char *test_name, const char **mod
262262
{
263263
struct np2_test *st;
264264
pid_t pid = 0;
265-
char server_dir[256], sock_path[256], pidfile_path[256];
265+
char server_dir[256], sock_path[256], sock_param[300], pidfile_path[256];
266266
int pipefd[2], buf;
267267
struct ly_ctx *ly_ctx;
268268

@@ -347,6 +347,9 @@ np2_glob_test_setup_server(void **state, const char *test_name, const char **mod
347347
/* generate path to socket */
348348
sprintf(sock_path, "%s/%s/%s", NP_TEST_DIR, test_name, NP_SOCKET_FILE);
349349

350+
/* generate UNIX sock param value for the server */
351+
sprintf(sock_param, "unix-socket:%s", sock_path);
352+
350353
/* generate path to server-files */
351354
sprintf(server_dir, "%s/%s", NP_TEST_DIR, test_name);
352355

@@ -392,10 +395,10 @@ np2_glob_test_setup_server(void **state, const char *test_name, const char **mod
392395
/* exec the server */
393396
if (extdata_path) {
394397
execl(NP_BINARY_DIR "/netopeer2-server", NP_BINARY_DIR "/netopeer2-server", "-d", "-v3", "-t10", "-p",
395-
pidfile_path, "-f", server_dir, "-x", extdata_path, NULL);
398+
pidfile_path, "-f", server_dir, "-U", sock_param, "-x", extdata_path, NULL);
396399
} else {
397400
execl(NP_BINARY_DIR "/netopeer2-server", NP_BINARY_DIR "/netopeer2-server", "-d", "-v3", "-t10", "-p",
398-
pidfile_path, "-f", server_dir, NULL);
401+
pidfile_path, "-f", server_dir, "-U", sock_param, NULL);
399402
}
400403

401404
child_error:
@@ -434,7 +437,7 @@ np2_glob_test_setup_server(void **state, const char *test_name, const char **mod
434437

435438
/* set the default configuration */
436439
if (sr_set_item_str(st->sr_sess, "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='unix-socket']/"
437-
"libnetconf2-netconf-server:unix/path", sock_path, NULL, 0)) {
440+
"libnetconf2-netconf-server:unix/hidden-path", NULL, NULL, 0)) {
438441
SETUP_FAIL_LOG;
439442
return 1;
440443
}

0 commit comments

Comments
 (0)