diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c5f98a8..d2142a0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -60,32 +60,31 @@
 endfunction()
 
 # all the tests that don't require SSH and TLS
-libnetconf2_test(NAME test_unix_socket)
+libnetconf2_test(NAME test_client_messages)
 libnetconf2_test(NAME test_client_thread)
 libnetconf2_test(NAME test_fd_comm)
 libnetconf2_test(NAME test_io)
 libnetconf2_test(NAME test_thread_messages)
-libnetconf2_test(NAME test_client_messages)
+libnetconf2_test(NAME test_unix_socket)
 
 # tests depending on SSH/TLS
 if(ENABLE_SSH_TLS)
     libnetconf2_test(NAME test_auth)
-    libnetconf2_test(NAME test_two_channels)
-    libnetconf2_test(NAME test_ks_ts)
+    libnetconf2_test(NAME test_authkeys)
+    libnetconf2_test(NAME test_ch PORT_COUNT 2)
     libnetconf2_test(NAME test_ec)
     libnetconf2_test(NAME test_ed25519)
-    libnetconf2_test(NAME test_replace)
     libnetconf2_test(NAME test_endpt_share_clients PORT_COUNT 4)
-    libnetconf2_test(NAME test_tls)
-    libnetconf2_test(NAME test_ch PORT_COUNT 2)
-    libnetconf2_test(NAME test_runtime_changes PORT_COUNT 2)
-    libnetconf2_test(NAME test_authkeys)
+    libnetconf2_test(NAME test_ks_ts)
     if (LIBPAM_HAVE_CONFDIR)
         libnetconf2_test(NAME test_pam WRAP_FUNCS pam_start)
     endif()
+    libnetconf2_test(NAME test_replace)
+    libnetconf2_test(NAME test_runtime_changes PORT_COUNT 2)
+    libnetconf2_test(NAME test_tls)
+    libnetconf2_test(NAME test_two_channels)
 endif()
 
-
 include_directories(${CMAKE_SOURCE_DIR}/src ${PROJECT_BINARY_DIR})
 configure_file("${PROJECT_SOURCE_DIR}/tests/config.h.in" "${PROJECT_BINARY_DIR}/tests/config.h" ESCAPE_QUOTES @ONLY)
 
diff --git a/tests/test_auth.c b/tests/test_auth.c
index 67f182a..b48b566 100644
--- a/tests/test_auth.c
+++ b/tests/test_auth.c
@@ -1,10 +1,10 @@
 /**
  * @file test_auth.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 SSH authentication methods test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,52 +26,10 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
 
 int TEST_PORT = 10050;
 const char *TEST_PORT_STR = "10050";
 
-static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    (void) arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
 static char *
 auth_password(const char *username, const char *hostname, void *priv)
 {
@@ -91,7 +49,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -108,7 +66,7 @@
     nc_client_ssh_set_auth_pref(NC_SSH_AUTH_PASSWORD, 1);
     nc_client_ssh_set_auth_pref(NC_SSH_AUTH_INTERACTIVE, -1);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
 
@@ -126,7 +84,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread_password, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -139,7 +97,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -157,7 +115,7 @@
     ret = nc_client_ssh_add_keypair(TESTS_DIR "/data/key_rsa.pub", TESTS_DIR "/data/key_rsa");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
 
@@ -175,7 +133,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread_pubkey, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -188,7 +146,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -199,7 +157,7 @@
     ret = nc_client_ssh_set_username("test_none");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
 
@@ -217,7 +175,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread_none, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -230,41 +188,26 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
+    *state = test_ctx;
 
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init_ctx(&ctx);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_load_modules(&ctx);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "endpt", "test_pk", "pubkey", TESTS_DIR "/data/key_rsa.pub", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
+    ret = nc_server_config_add_ssh_user_password(test_ctx->ctx, "endpt", "test_pw", "testpw", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_hostkey(ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "endpt", "test_pk", "pubkey", TESTS_DIR "/data/key_rsa.pub", &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_password(ctx, "endpt", "test_pw", "testpw", &tree);
-    assert_int_equal(ret, 0);
-
-    ret = lyd_new_path(tree, ctx, "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='endpt']/ssh/"
+    ret = lyd_new_path(tree, test_ctx->ctx, "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='endpt']/ssh/"
             "ssh-server-parameters/client-authentication/users/user[name='test_none']/none", NULL, 0, NULL);
     assert_int_equal(ret, 0);
 
@@ -272,45 +215,18 @@
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_auth_pubkey, setup_f, teardown_f),
-        cmocka_unit_test_setup_teardown(test_nc_auth_password, setup_f, teardown_f),
-        cmocka_unit_test_setup_teardown(test_nc_auth_none, setup_f, teardown_f)
+        cmocka_unit_test_setup_teardown(test_nc_auth_pubkey, setup_f, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_auth_password, setup_f, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_auth_none, setup_f, ln2_glob_test_teardown)
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_authkeys.c b/tests/test_authkeys.c
index 04eb0c6..25b8862 100644
--- a/tests/test_authkeys.c
+++ b/tests/test_authkeys.c
@@ -1,6 +1,6 @@
 /**
  * @file test_authkeys.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 SSH authentication using mocked system authorized_keys
  *
  * @copyright
@@ -26,15 +26,8 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
 
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
+struct test_authkey_data {
     const char *pubkey_path;
     const char *privkey_path;
     int expect_ok;
@@ -50,17 +43,18 @@
     NC_MSG_TYPE msgtype;
     struct nc_session *session;
     struct nc_pollsession *ps;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
+    struct test_authkey_data *test_data = test_ctx->test_data;
 
     ps = nc_ps_new();
     assert_non_null(ps);
 
     /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
+    pthread_barrier_wait(&test_ctx->barrier);
+    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, test_ctx->ctx, &session);
 
     /* only continue if we expect to authenticate successfully */
-    if (state->expect_ok) {
+    if (test_data->expect_ok) {
         assert_int_equal(msgtype, NC_MSG_HELLO);
     } else {
         assert_int_equal(msgtype, NC_MSG_ERROR);
@@ -86,7 +80,8 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
+    struct test_authkey_data *test_data = test_ctx->test_data;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -96,17 +91,17 @@
     assert_int_equal(ret, 0);
 
     /* add client's key pair */
-    ret = nc_client_ssh_add_keypair(state->pubkey_path, state->privkey_path);
+    ret = nc_client_ssh_add_keypair(test_data->pubkey_path, test_data->privkey_path);
     assert_int_equal(ret, 0);
 
     /* set ssh username */
     ret = nc_client_ssh_set_username("test");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     /* connect */
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
-    if (state->expect_ok) {
+    if (test_data->expect_ok) {
         assert_non_null(session);
     } else {
         assert_null(session);
@@ -121,29 +116,27 @@
 {
     int ret, i;
     pthread_t tids[2];
-    struct test_state *state;
+    struct test_authkey_data *test_data;
 
-    assert_non_null(arg);
-
-    state = *(struct test_state **)arg;
+    test_data = (*(struct ln2_test_ctx **)arg)->test_data;
 
     /* set the path to the test's authorized_keys file */
     ret = nc_server_ssh_set_authkey_path_format(TESTS_DIR "/data/authorized_keys");
     assert_int_equal(ret, 0);
 
     /* set pubkey and privkey path, the pubkey matches the one in authorized keys */
-    state->pubkey_path = TESTS_DIR "/data/id_ed25519.pub";
-    state->privkey_path = TESTS_DIR "/data/id_ed25519";
+    test_data->pubkey_path = TESTS_DIR "/data/id_ed25519.pub";
+    test_data->privkey_path = TESTS_DIR "/data/id_ed25519";
 
     /* expect ok result */
-    state->expect_ok = 1;
+    test_data->expect_ok = 1;
 
     /* client */
-    ret = pthread_create(&tids[0], NULL, client_thread, state);
+    ret = pthread_create(&tids[0], NULL, client_thread, *arg);
     assert_int_equal(ret, 0);
 
     /* server */
-    ret = pthread_create(&tids[1], NULL, server_thread, state);
+    ret = pthread_create(&tids[1], NULL, server_thread, *arg);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -156,29 +149,27 @@
 {
     int ret, i;
     pthread_t tids[2];
-    struct test_state *state;
+    struct test_authkey_data *test_data;
 
-    assert_non_null(arg);
-
-    state = *(struct test_state **)arg;
+    test_data = (*(struct ln2_test_ctx **)arg)->test_data;
 
     /* set the path to the test's authorized_keys file */
     ret = nc_server_ssh_set_authkey_path_format(TESTS_DIR "/data/authorized_keys");
     assert_int_equal(ret, 0);
 
     /* set pubkey and privkey path, the pubkey doesn't match the one in authorized keys */
-    state->pubkey_path = TESTS_DIR "/data/id_ecdsa521.pub";
-    state->privkey_path = TESTS_DIR "/data/id_ecdsa521";
+    test_data->pubkey_path = TESTS_DIR "/data/id_ecdsa521.pub";
+    test_data->privkey_path = TESTS_DIR "/data/id_ecdsa521";
 
     /* expect fail */
-    state->expect_ok = 0;
+    test_data->expect_ok = 0;
 
     /* client */
-    ret = pthread_create(&tids[0], NULL, client_thread, state);
+    ret = pthread_create(&tids[0], NULL, client_thread, *arg);
     assert_int_equal(ret, 0);
 
     /* server */
-    ret = pthread_create(&tids[1], NULL, server_thread, state);
+    ret = pthread_create(&tids[1], NULL, server_thread, *arg);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -191,29 +182,30 @@
 {
     int ret, i;
     pthread_t tids[2];
-    struct test_state *state;
+    struct ln2_test_ctx *test_ctx;
+    struct test_authkey_data *test_data;
 
     assert_non_null(arg);
-
-    state = *(struct test_state **)arg;
+    test_ctx = *arg;
+    test_data = test_ctx->test_data;
 
     /* set the path to the test's authorized_keys file */
     ret = nc_server_ssh_set_authkey_path_format(TESTS_DIR "/some/bad/path");
     assert_int_equal(ret, 0);
 
     /* set pubkey and privkey path, the pubkey doesn't match the one in authorized keys */
-    state->pubkey_path = TESTS_DIR "/data/id_ed25519.pub";
-    state->privkey_path = TESTS_DIR "/data/id_ed25519";
+    test_data->pubkey_path = TESTS_DIR "/data/id_ed25519.pub";
+    test_data->privkey_path = TESTS_DIR "/data/id_ed25519";
 
     /* expect fail */
-    state->expect_ok = 0;
+    test_data->expect_ok = 0;
 
     /* client */
-    ret = pthread_create(&tids[0], NULL, client_thread, state);
+    ret = pthread_create(&tids[0], NULL, client_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     /* server */
-    ret = pthread_create(&tids[1], NULL, server_thread, state);
+    ret = pthread_create(&tids[1], NULL, server_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -226,84 +218,44 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
+    struct test_authkey_data *test_data;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
+    test_data = calloc(1, sizeof *test_data);
+    assert_non_null(test_data);
 
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    test_ctx->test_data = test_data;
+    test_ctx->free_test_data = ln2_glob_test_free_test_data;
+    *state = test_ctx;
+
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "endpt", "hostkey", TESTS_DIR "/data/server.key", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_hostkey(ctx, "endpt", "hostkey", TESTS_DIR "/data/server.key", NULL, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_authkey(ctx, "endpt", "test", &tree);
+    ret = nc_server_config_add_ssh_user_authkey(test_ctx->ctx, "endpt", "test", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the data */
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    /* initialize server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_authkey_ok, setup_f, teardown_f),
-        cmocka_unit_test_setup_teardown(test_nc_authkey_bad_key, setup_f, teardown_f),
-        cmocka_unit_test_setup_teardown(test_nc_authkey_bad_path, setup_f, teardown_f),
+        cmocka_unit_test_setup_teardown(test_nc_authkey_ok, setup_f, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_authkey_bad_key, setup_f, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_authkey_bad_path, setup_f, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_ch.c b/tests/test_ch.c
index 076c2d9..def7da9 100644
--- a/tests/test_ch.c
+++ b/tests/test_ch.c
@@ -1,10 +1,10 @@
 /**
  * @file test_ch.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 Call-home test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,18 +26,9 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
 
-#define NC_PS_POLL_TIMEOUT 2000
-
-#define NC_ACCEPT_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-    struct lyd_node *ssh_tree;
-    struct lyd_node *tls_tree;
+struct test_ch_data {
+    struct lyd_node *tree;
 };
 
 char buffer[512];
@@ -63,8 +54,7 @@
 const struct ly_ctx *
 ch_session_acquire_ctx_cb(void *cb_data)
 {
-    (void) cb_data;
-    return ctx;
+    return ((struct ln2_test_ctx *)cb_data)->ctx;
 }
 
 /* release ctx cb for dispatch */
@@ -93,8 +83,9 @@
 server_thread_ssh(void *arg)
 {
     int ret;
-    struct test_state *state = arg;
     struct nc_pollsession *ps;
+    struct ln2_test_ctx *test_ctx = arg;
+    struct test_ch_data *test_data = test_ctx->test_data;
 
     /* set print clb so we get access to messages */
     nc_set_print_clb_session(test_msg_callback);
@@ -102,17 +93,17 @@
     strcpy(expected, "reconnecting in");
 
     /* prepare data for deleting the call-home client */
-    ret = nc_server_config_del_ch_client("ch_ssh", &state->ssh_tree);
+    ret = nc_server_config_del_ch_client("ch_ssh", &test_data->tree);
     assert_int_equal(ret, 0);
 
     /* new poll session */
     ps = nc_ps_new();
     assert_non_null(ps);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     /* create the call-home client thread */
     ret = nc_connect_ch_client_dispatch("ch_ssh", ch_session_acquire_ctx_cb,
-            ch_session_release_ctx_cb, NULL, ch_new_session_cb, ps);
+            ch_session_release_ctx_cb, test_ctx, ch_new_session_cb, ps);
     assert_int_equal(ret, 0);
 
     /* poll */
@@ -124,12 +115,12 @@
     } while (!strlen(buffer));
 
     /* delete the call-home client, the thread should end */
-    ret = nc_server_config_setup_data(state->ssh_tree);
+    ret = nc_server_config_setup_data(test_data->tree);
     assert_int_equal(ret, 0);
 
     nc_ps_clear(ps, 1, NULL);
     nc_ps_free(ps);
-    nc_server_destroy();
+
     return NULL;
 }
 
@@ -138,7 +129,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -159,7 +150,7 @@
     ret = nc_client_ssh_ch_add_bind_listen("127.0.0.1", TEST_PORT);
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     /* connect */
     ret = nc_accept_callhome(NC_ACCEPT_TIMEOUT, NULL, &session);
     assert_int_equal(ret, 1);
@@ -171,89 +162,59 @@
     return NULL;
 }
 
+static void
+test_nc_ch_free_test_data(void *test_data)
+{
+    struct test_ch_data *test_ch_data;
+
+    test_ch_data = test_data;
+    lyd_free_tree(test_ch_data->tree);
+    free(test_ch_data);
+}
+
 static int
 setup_ssh(void **state)
 {
     int ret;
-    struct test_state *test_state;
+    struct lyd_node *tree = NULL;
+    struct ln2_test_ctx *test_ctx;
+    struct test_ch_data *test_data;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    test_state->ssh_tree = NULL;
-    *state = test_state;
+    test_data = calloc(1, sizeof *test_data);
+    assert_non_null(test_data);
 
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
-    assert_int_equal(ret, 0);
-
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
-    assert_int_equal(ret, 0);
-
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
+    test_ctx->test_data = test_data;
+    test_ctx->free_test_data = test_nc_ch_free_test_data;
+    *state = test_ctx;
 
     /* set call-home address and port */
-    ret = nc_server_config_add_ch_address_port(ctx, "ch_ssh", "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT_STR, &test_state->ssh_tree);
+    ret = nc_server_config_add_ch_address_port(test_ctx->ctx, "ch_ssh", "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT_STR, &tree);
     assert_int_equal(ret, 0);
 
     /* set connection type to persistent */
-    ret = nc_server_config_add_ch_persistent(ctx, "ch_ssh", &test_state->ssh_tree);
+    ret = nc_server_config_add_ch_persistent(test_ctx->ctx, "ch_ssh", &tree);
     assert_int_equal(ret, 0);
 
     /* set the period of the periodic connection type, this should remove the persistent connection type */
-    ret = nc_server_config_add_ch_period(ctx, "ch_ssh", 3, &test_state->ssh_tree);
+    ret = nc_server_config_add_ch_period(test_ctx->ctx, "ch_ssh", 3, &tree);
     assert_int_equal(ret, 0);
 
     /* set call-home server hostkey */
-    ret = nc_server_config_add_ch_ssh_hostkey(ctx, "ch_ssh", "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &test_state->ssh_tree);
+    ret = nc_server_config_add_ch_ssh_hostkey(test_ctx->ctx, "ch_ssh", "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
     /* set call-home client's pubkey */
-    ret = nc_server_config_add_ch_ssh_user_pubkey(ctx, "ch_ssh", "endpt", "test_ch_ssh", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &test_state->ssh_tree);
+    ret = nc_server_config_add_ch_ssh_user_pubkey(test_ctx->ctx, "ch_ssh", "endpt", "test_ch_ssh", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the data */
-    ret = nc_server_config_setup_data(test_state->ssh_tree);
+    ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    /* initialize server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
-    return 0;
-}
-
-static int
-teardown_ssh(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    lyd_free_tree(test_state->ssh_tree);
-
-    free(*state);
-    nc_client_destroy();
-    ly_ctx_destroy(ctx);
-
+    test_data->tree = tree;
     return 0;
 }
 
@@ -282,21 +243,22 @@
 server_thread_tls(void *arg)
 {
     int ret;
-    struct test_state *state = arg;
     struct nc_pollsession *ps;
+    struct ln2_test_ctx *test_ctx = arg;
+    struct test_ch_data *test_data = test_ctx->test_data;
 
     /* prepare data for deleting the call-home client */
-    ret = nc_server_config_del_ch_client("ch_tls", &state->tls_tree);
+    ret = nc_server_config_del_ch_client("ch_tls", &test_data->tree);
     assert_int_equal(ret, 0);
 
     /* new poll session */
     ps = nc_ps_new();
     assert_non_null(ps);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     /* create the call-home client thread */
     ret = nc_connect_ch_client_dispatch("ch_tls", ch_session_acquire_ctx_cb,
-            ch_session_release_ctx_cb, NULL, ch_new_session_cb, ps);
+            ch_session_release_ctx_cb, test_ctx, ch_new_session_cb, ps);
     assert_int_equal(ret, 0);
 
     /* poll */
@@ -308,12 +270,11 @@
     } while (!(ret & NC_PSPOLL_SESSION_TERM));
 
     /* delete the call-home client, the thread should end */
-    ret = nc_server_config_setup_data(state->tls_tree);
+    ret = nc_server_config_setup_data(test_data->tree);
     assert_int_equal(ret, 0);
 
     nc_ps_clear(ps, 1, NULL);
     nc_ps_free(ps);
-    nc_server_destroy();
     return NULL;
 }
 
@@ -322,7 +283,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* set directory where to search for modules */
     ret = nc_client_set_schema_searchpath(MODULES_DIR);
@@ -340,7 +301,7 @@
     ret = nc_client_tls_ch_add_bind_listen("127.0.0.1", TEST_PORT_2);
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     /* connect */
     ret = nc_accept_callhome(NC_ACCEPT_TIMEOUT, NULL, &session);
     assert_int_equal(ret, 1);
@@ -377,87 +338,47 @@
 setup_tls(void **state)
 {
     int ret;
-    struct test_state *test_state;
+    struct lyd_node *tree = NULL;
+    struct ln2_test_ctx *test_ctx;
+    struct test_ch_data *test_data;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    test_state->tls_tree = NULL;
-    *state = test_state;
+    test_data = calloc(1, sizeof *test_data);
+    assert_non_null(test_data);
 
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
-    assert_int_equal(ret, 0);
-
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
-    assert_int_equal(ret, 0);
-
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
+    test_ctx->test_data = test_data;
+    test_ctx->free_test_data = test_nc_ch_free_test_data;
+    *state = test_ctx;
 
     /* set call-home address and port */
-    ret = nc_server_config_add_ch_address_port(ctx, "ch_tls", "endpt", NC_TI_TLS, "127.0.0.1", TEST_PORT_2_STR, &test_state->tls_tree);
+    ret = nc_server_config_add_ch_address_port(test_ctx->ctx, "ch_tls", "endpt", NC_TI_TLS, "127.0.0.1", TEST_PORT_2_STR, &tree);
     assert_int_equal(ret, 0);
 
     /* set call-home server certificate */
-    ret = nc_server_config_add_ch_tls_server_cert(ctx, "ch_tls", "endpt", TESTS_DIR "/data/server.key", NULL, TESTS_DIR "/data/server.crt", &test_state->tls_tree);
+    ret = nc_server_config_add_ch_tls_server_cert(test_ctx->ctx, "ch_tls", "endpt", TESTS_DIR "/data/server.key", NULL, TESTS_DIR "/data/server.crt", &tree);
     assert_int_equal(ret, 0);
 
     /* set call-home client end entity certificate */
-    ret = nc_server_config_add_ch_tls_client_cert(ctx, "ch_tls", "endpt", "ee-cert", TESTS_DIR "/data/client.crt", &test_state->tls_tree);
+    ret = nc_server_config_add_ch_tls_client_cert(test_ctx->ctx, "ch_tls", "endpt", "ee-cert", TESTS_DIR "/data/client.crt", &tree);
     assert_int_equal(ret, 0);
 
     /* set call-home client certificate authority certificate */
-    ret = nc_server_config_add_ch_tls_ca_cert(ctx, "ch_tls", "endpt", "ca-cert", TESTS_DIR "/data/serverca.pem", &test_state->tls_tree);
+    ret = nc_server_config_add_ch_tls_ca_cert(test_ctx->ctx, "ch_tls", "endpt", "ca-cert", TESTS_DIR "/data/serverca.pem", &tree);
     assert_int_equal(ret, 0);
 
     /* set call-home CTN */
-    ret = nc_server_config_add_ch_tls_ctn(ctx, "ch_tls", "endpt", 1,
+    ret = nc_server_config_add_ch_tls_ctn(test_ctx->ctx, "ch_tls", "endpt", 1,
             "04:85:6B:75:D1:1A:86:E0:D8:FE:5B:BD:72:F5:73:1D:07:EA:32:BF:09:11:21:6A:6E:23:78:8E:B6:D5:73:C3:2D",
-            NC_TLS_CTN_SPECIFIED, "ch_client_tls", &test_state->tls_tree);
+            NC_TLS_CTN_SPECIFIED, "ch_client_tls", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the data */
-    ret = nc_server_config_setup_data(test_state->tls_tree);
+    ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    /* initialize server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
-    return 0;
-}
-
-static int
-teardown_tls(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    lyd_free_tree(test_state->tls_tree);
-
-    free(*state);
-    nc_client_destroy();
-    ly_ctx_destroy(ctx);
-
+    test_data->tree = tree;
     return 0;
 }
 
@@ -465,8 +386,8 @@
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_ch_ssh, setup_ssh, teardown_ssh),
-        cmocka_unit_test_setup_teardown(test_nc_ch_tls, setup_tls, teardown_tls),
+        cmocka_unit_test_setup_teardown(test_nc_ch_ssh, setup_ssh, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_ch_tls, setup_tls, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_client_messages.c b/tests/test_client_messages.c
index 989c325..d5ae2f7 100644
--- a/tests/test_client_messages.c
+++ b/tests/test_client_messages.c
@@ -23,12 +23,9 @@
 #include <sys/types.h>
 
 #include <cmocka.h>
-#include <config.h>
-#include <libyang/libyang.h>
-#include <log.h>
 #include <messages_p.h>
-#include <session_client.h>
-#include "tests/config.h"
+
+#include "ln2_test.h"
 
 static int
 setup_f(void **state)
diff --git a/tests/test_client_thread.c b/tests/test_client_thread.c
index bede794..9853785 100644
--- a/tests/test_client_thread.c
+++ b/tests/test_client_thread.c
@@ -24,8 +24,7 @@
 
 #include <libyang/libyang.h>
 
-#include <session_client.h>
-#include "tests/config.h"
+#include "ln2_test.h"
 
 #define nc_assert(cond) if (!(cond)) { fprintf(stderr, "assert failed (%s:%d)\n", __FILE__, __LINE__); exit(1); }
 
diff --git a/tests/test_ec.c b/tests/test_ec.c
index 7a8c944..ba29d76 100644
--- a/tests/test_ec.c
+++ b/tests/test_ec.c
@@ -1,10 +1,10 @@
 /**
  * @file test_ec.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 EC keys authentication test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,15 +26,8 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
 
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
+struct test_ec_data {
     const char *client_username;
     const char *client_privkey;
     const char *client_pubkey;
@@ -44,43 +37,12 @@
 const char *TEST_PORT_STR = "10050";
 
 static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    (void) arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
-static void *
 client_thread(void *arg)
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
+    struct test_ec_data *test_data = test_ctx->test_data;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -90,14 +52,14 @@
     assert_int_equal(ret, 0);
 
     /* set ssh username */
-    ret = nc_client_ssh_set_username(state->client_username);
+    ret = nc_client_ssh_set_username(test_data->client_username);
     assert_int_equal(ret, 0);
 
     /* add client's key pair */
-    ret = nc_client_ssh_add_keypair(state->client_pubkey, state->client_privkey);
+    ret = nc_client_ssh_add_keypair(test_data->client_pubkey, test_data->client_privkey);
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     /* connect */
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
@@ -111,21 +73,23 @@
 {
     int ret, i;
     pthread_t tids[2];
-    struct test_state *client;
+    struct ln2_test_ctx *test_ctx;
+    struct test_ec_data *test_data;
 
     /* set specific data for the client */
     assert_non_null(state);
-    client = *state;
+    test_ctx = *state;
+    test_data = test_ctx->test_data;
 
     /* client */
-    client->client_username = "test_ec256";
-    client->client_pubkey = TESTS_DIR "/data/id_ecdsa256.pub";
-    client->client_privkey = TESTS_DIR "/data/id_ecdsa256";
-    ret = pthread_create(&tids[0], NULL, client_thread, client);
+    test_data->client_username = "test_ec256";
+    test_data->client_pubkey = TESTS_DIR "/data/id_ecdsa256.pub";
+    test_data->client_privkey = TESTS_DIR "/data/id_ecdsa256";
+    ret = pthread_create(&tids[0], NULL, client_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     /* server */
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -138,21 +102,23 @@
 {
     int ret, i;
     pthread_t tids[2];
-    struct test_state *client;
+    struct ln2_test_ctx *test_ctx;
+    struct test_ec_data *test_data;
 
     /* set specific data for the client */
     assert_non_null(state);
-    client = *state;
+    test_ctx = *state;
+    test_data = test_ctx->test_data;
 
     /* client */
-    client->client_username = "test_ec384";
-    client->client_pubkey = TESTS_DIR "/data/id_ecdsa384.pub";
-    client->client_privkey = TESTS_DIR "/data/id_ecdsa384";
-    ret = pthread_create(&tids[0], NULL, client_thread, client);
+    test_data->client_username = "test_ec384";
+    test_data->client_pubkey = TESTS_DIR "/data/id_ecdsa384.pub";
+    test_data->client_privkey = TESTS_DIR "/data/id_ecdsa384";
+    ret = pthread_create(&tids[0], NULL, client_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     /* server */
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -165,21 +131,23 @@
 {
     int ret, i;
     pthread_t tids[2];
-    struct test_state *client;
+    struct ln2_test_ctx *test_ctx;
+    struct test_ec_data *test_data;
 
     /* set specific data for the client */
     assert_non_null(state);
-    client = *state;
+    test_ctx = *state;
+    test_data = test_ctx->test_data;
 
     /* client */
-    client->client_username = "test_ec521";
-    client->client_pubkey = TESTS_DIR "/data/id_ecdsa521.pub";
-    client->client_privkey = TESTS_DIR "/data/id_ecdsa521";
-    ret = pthread_create(&tids[0], NULL, client_thread, client);
+    test_data->client_username = "test_ec521";
+    test_data->client_pubkey = TESTS_DIR "/data/id_ecdsa521.pub";
+    test_data->client_privkey = TESTS_DIR "/data/id_ecdsa521";
+    ret = pthread_create(&tids[0], NULL, client_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     /* server */
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, test_ctx);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -192,90 +160,50 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
+    struct test_ec_data *test_data;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
+    test_data = calloc(1, sizeof *test_data);
+    assert_non_null(test_data);
 
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    test_ctx->test_data = test_data;
+    test_ctx->free_test_data = ln2_glob_test_free_test_data;
+    *state = test_ctx;
+
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "endpt", "test_ec256", "pubkey", TESTS_DIR "/data/id_ecdsa256.pub", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_hostkey(ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "endpt", "test_ec384", "pubkey", TESTS_DIR "/data/id_ecdsa384.pub", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "endpt", "test_ec256", "pubkey", TESTS_DIR "/data/id_ecdsa256.pub", &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "endpt", "test_ec384", "pubkey", TESTS_DIR "/data/id_ecdsa384.pub", &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "endpt", "test_ec521", "pubkey", TESTS_DIR "/data/id_ecdsa521.pub", &tree);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "endpt", "test_ec521", "pubkey", TESTS_DIR "/data/id_ecdsa521.pub", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the data */
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    /* initialize server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_ec256, setup_f, teardown_f),
-        cmocka_unit_test_setup_teardown(test_nc_ec384, setup_f, teardown_f),
-        cmocka_unit_test_setup_teardown(test_nc_ec521, setup_f, teardown_f),
+        cmocka_unit_test_setup_teardown(test_nc_ec256, setup_f, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_ec384, setup_f, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_ec521, setup_f, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_ed25519.c b/tests/test_ed25519.c
index cc260a2..24d0ade 100644
--- a/tests/test_ed25519.c
+++ b/tests/test_ed25519.c
@@ -1,10 +1,10 @@
 /**
  * @file test_ed25519.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 ED25519 key authentication test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,58 +26,16 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
 
 int TEST_PORT = 10050;
 const char *TEST_PORT_STR = "10050";
 
 static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    (void) arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
-static void *
 client_thread(void *arg)
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -94,7 +52,7 @@
     ret = nc_client_ssh_add_keypair(TESTS_DIR "/data/id_ed25519.pub", TESTS_DIR "/data/id_ed25519");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     /* connect */
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
@@ -116,7 +74,7 @@
     assert_int_equal(ret, 0);
 
     /* server */
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -129,82 +87,36 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
+    *state = test_ctx;
 
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "endpt", "hostkey", TESTS_DIR "/data/server.key", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_hostkey(ctx, "endpt", "hostkey", TESTS_DIR "/data/server.key", NULL, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "endpt", "test_ed25519", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &tree);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "endpt", "test_ed25519", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the data */
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    /* initialize server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_ed25519, setup_f, teardown_f),
+        cmocka_unit_test_setup_teardown(test_nc_ed25519, setup_f, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_endpt_share_clients.c b/tests/test_endpt_share_clients.c
index 0cbccff..ec22496 100644
--- a/tests/test_endpt_share_clients.c
+++ b/tests/test_endpt_share_clients.c
@@ -1,10 +1,10 @@
 /**
  * @file test_endpt_share_clients.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 Sharing clients between endpoints test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,56 +26,16 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
 
 int TEST_PORT = 10050, TEST_PORT_2 = 10051, TEST_PORT_3 = 10052, TEST_PORT_4 = 10053;
 const char *TEST_PORT_STR = "10050", *TEST_PORT_2_STR = "10051", *TEST_PORT_3_STR = "10052", *TEST_PORT_4_STR = "10053";
 
 static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
-static void *
 client_thread_ssh(void *arg)
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -93,7 +53,7 @@
     assert_int_equal(ret, 0);
 
     /* wait for the server to reach polling */
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
 
     /* connect */
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
@@ -113,7 +73,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread_ssh, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -126,7 +86,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* set directory where to search for modules */
     ret = nc_client_set_schema_searchpath(MODULES_DIR);
@@ -140,7 +100,7 @@
     ret = nc_client_tls_set_trusted_ca_paths(NULL, TESTS_DIR "/data");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_tls("127.0.0.1", TEST_PORT_4, NULL);
     assert_non_null(session);
 
@@ -158,7 +118,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread_tls, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -171,63 +131,37 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
-
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
-    assert_int_equal(ret, 0);
-
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
-    assert_int_equal(ret, 0);
-
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
+    *state = test_ctx;
 
     /* create the first SSH endpoint with a client reference to the second endpoint */
-    ret = nc_server_config_add_ssh_hostkey(ctx, "SSH_endpt_1", "hostkey", TESTS_DIR "/data/key_rsa", NULL, &tree);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "SSH_endpt_1", "hostkey", TESTS_DIR "/data/key_rsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "SSH_endpt_1", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "SSH_endpt_1", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_endpoint_client_ref(ctx, "SSH_endpt_1", "SSH_endpt_2", &tree);
+    ret = nc_server_config_add_ssh_endpoint_client_ref(test_ctx->ctx, "SSH_endpt_1", "SSH_endpt_2", &tree);
     assert_int_equal(ret, 0);
 
     /* create the second SSH endpoint with a single client */
-    ret = nc_server_config_add_ssh_hostkey(ctx, "SSH_endpt_2", "hostkey", TESTS_DIR "/data/key_rsa", NULL, &tree);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "SSH_endpt_2", "hostkey", TESTS_DIR "/data/key_rsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "SSH_endpt_2", NC_TI_SSH, "127.0.0.1", TEST_PORT_2, &tree);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "SSH_endpt_2", NC_TI_SSH, "127.0.0.1", TEST_PORT_2, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "SSH_endpt_2", "client", "pubkey", TESTS_DIR "/data/key_rsa.pub", &tree);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "SSH_endpt_2", "client", "pubkey", TESTS_DIR "/data/key_rsa.pub", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the yang data */
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    /* initialize the server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
@@ -238,103 +172,57 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
-
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
-    assert_int_equal(ret, 0);
-
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
-    assert_int_equal(ret, 0);
-
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
+    *state = test_ctx;
 
     /* create the first TLS endpoint with a single end entity client cert and a CTN entry */
-    ret = nc_server_config_add_tls_server_cert(ctx, "TLS_endpt_1", TESTS_DIR "/data/server.key", NULL, TESTS_DIR "/data/server.crt", &tree);
+    ret = nc_server_config_add_tls_server_cert(test_ctx->ctx, "TLS_endpt_1", TESTS_DIR "/data/server.key", NULL, TESTS_DIR "/data/server.crt", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "TLS_endpt_1", NC_TI_TLS, "127.0.0.1", TEST_PORT_3, &tree);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "TLS_endpt_1", NC_TI_TLS, "127.0.0.1", TEST_PORT_3, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_tls_client_cert(ctx, "TLS_endpt_1", "cert_client", TESTS_DIR "/data/client.crt", &tree);
+    ret = nc_server_config_add_tls_client_cert(test_ctx->ctx, "TLS_endpt_1", "cert_client", TESTS_DIR "/data/client.crt", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_tls_ca_cert(ctx, "TLS_endpt_1", "cert_ca", TESTS_DIR "/data/serverca.pem", &tree);
+    ret = nc_server_config_add_tls_ca_cert(test_ctx->ctx, "TLS_endpt_1", "cert_ca", TESTS_DIR "/data/serverca.pem", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_tls_ctn(ctx, "TLS_endpt_1", 1,
+    ret = nc_server_config_add_tls_ctn(test_ctx->ctx, "TLS_endpt_1", 1,
             "04:85:6B:75:D1:1A:86:E0:D8:FE:5B:BD:72:F5:73:1D:07:EA:32:BF:09:11:21:6A:6E:23:78:8E:B6:D5:73:C3:2D",
             NC_TLS_CTN_SPECIFIED, "client", &tree);
     assert_int_equal(ret, 0);
 
     /* create the second TLS endpoint with a reference to the first endpoint */
-    ret = nc_server_config_add_tls_server_cert(ctx, "TLS_endpt_2",
+    ret = nc_server_config_add_tls_server_cert(test_ctx->ctx, "TLS_endpt_2",
             TESTS_DIR "/data/server.key", NULL, TESTS_DIR "/data/server.crt", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "TLS_endpt_2", NC_TI_TLS, "127.0.0.1", TEST_PORT_4, &tree);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "TLS_endpt_2", NC_TI_TLS, "127.0.0.1", TEST_PORT_4, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_tls_endpoint_client_ref(ctx, "TLS_endpt_2", "TLS_endpt_1", &tree);
+    ret = nc_server_config_add_tls_endpoint_client_ref(test_ctx->ctx, "TLS_endpt_2", "TLS_endpt_1", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the yang data */
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    /* initialize the server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(nc_test_endpt_share_clients_ssh, setup_ssh, teardown_f),
-        cmocka_unit_test_setup_teardown(nc_test_endpt_share_clients_tls, setup_tls, teardown_f),
+        cmocka_unit_test_setup_teardown(nc_test_endpt_share_clients_ssh, setup_ssh, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(nc_test_endpt_share_clients_tls, setup_tls, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_fd_comm.c b/tests/test_fd_comm.c
index c2eb746..31e3293 100644
--- a/tests/test_fd_comm.c
+++ b/tests/test_fd_comm.c
@@ -32,10 +32,9 @@
 #include <libyang/libyang.h>
 
 #include <messages_p.h>
-#include <session_client.h>
 #include <session_p.h>
-#include <session_server.h>
-#include "tests/config.h"
+
+#include "ln2_test.h"
 
 struct nc_session *server_session;
 struct nc_session *client_session;
diff --git a/tests/test_io.c b/tests/test_io.c
index a8de474..8e059c3 100644
--- a/tests/test_io.c
+++ b/tests/test_io.c
@@ -30,9 +30,9 @@
 #include <libyang/libyang.h>
 
 #include <messages_p.h>
-#include <session_client.h>
 #include <session_p.h>
-#include "tests/config.h"
+
+#include "ln2_test.h"
 
 struct wr {
     struct nc_session *session;
diff --git a/tests/test_ks_ts.c b/tests/test_ks_ts.c
index 4c9bebe..8c6aa79 100644
--- a/tests/test_ks_ts.c
+++ b/tests/test_ks_ts.c
@@ -1,10 +1,10 @@
 /**
  * @file test_ks_ts.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 Keystore and trustore usage test.
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,56 +26,16 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
 
 int TEST_PORT = 10050;
 const char *TEST_PORT_STR = "10050";
 
 static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
-static void *
 client_thread_ssh(void *arg)
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -89,7 +49,7 @@
     ret = nc_client_ssh_add_keypair(TESTS_DIR "/data/id_ed25519.pub", TESTS_DIR "/data/id_ed25519");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
 
@@ -107,7 +67,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread_ssh, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -120,54 +80,32 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
+    *state = test_ctx;
 
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init_ctx(&ctx);
+    ret = nc_server_config_add_ssh_keystore_ref(test_ctx->ctx, "endpt", "hostkey", "test_keystore", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_load_modules(&ctx);
+    ret = nc_server_config_add_ssh_truststore_ref(test_ctx->ctx, "endpt", "client", "test_truststore", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
+    ret = nc_server_config_add_keystore_asym_key(test_ctx->ctx, NC_TI_SSH, "test_keystore", TESTS_DIR "/data/key_rsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_keystore_ref(ctx, "endpt", "hostkey", "test_keystore", &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_truststore_ref(ctx, "endpt", "client", "test_truststore", &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_keystore_asym_key(ctx, NC_TI_SSH, "test_keystore", TESTS_DIR "/data/key_rsa", NULL, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_truststore_pubkey(ctx, "test_truststore", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &tree);
+    ret = nc_server_config_add_truststore_pubkey(test_ctx->ctx, "test_truststore", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the data */
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
@@ -178,7 +116,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     ret = nc_client_set_schema_searchpath(MODULES_DIR);
     assert_int_equal(ret, 0);
@@ -191,7 +129,7 @@
     ret = nc_client_tls_set_trusted_ca_paths(NULL, TESTS_DIR "/data");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_tls("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
 
@@ -209,7 +147,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread_tls, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -222,65 +160,47 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
-
-    /* new ctx */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
-    assert_int_equal(ret, 0);
-
-    /* init ctx */
-    ret = nc_server_init_ctx(&ctx);
-    assert_int_equal(ret, 0);
-
-    /* load ietf netconf server module and its requisities */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
+    *state = test_ctx;
 
     /* new tls bind */
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_TLS, "127.0.0.1", TEST_PORT, &tree);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_TLS, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
     /* new keystore asym key pair */
-    ret = nc_server_config_add_keystore_asym_key(ctx, NC_TI_TLS, "server_key", TESTS_DIR "/data/server.key", NULL, &tree);
+    ret = nc_server_config_add_keystore_asym_key(test_ctx->ctx, NC_TI_TLS, "server_key", TESTS_DIR "/data/server.key", NULL, &tree);
     assert_int_equal(ret, 0);
 
     /* new keystore cert belonging to the key pair */
-    ret = nc_server_config_add_keystore_cert(ctx, "server_key", "server_cert", TESTS_DIR "/data/server.crt", &tree);
+    ret = nc_server_config_add_keystore_cert(test_ctx->ctx, "server_key", "server_cert", TESTS_DIR "/data/server.crt", &tree);
     assert_int_equal(ret, 0);
 
     /* new truststore client cert */
-    ret = nc_server_config_add_truststore_cert(ctx, "ee_cert_bag", "ee_cert", TESTS_DIR "/data/client.crt", &tree);
+    ret = nc_server_config_add_truststore_cert(test_ctx->ctx, "ee_cert_bag", "ee_cert", TESTS_DIR "/data/client.crt", &tree);
     assert_int_equal(ret, 0);
 
     /* new truststore client CA cert */
-    ret = nc_server_config_add_truststore_cert(ctx, "ca_cert_bag", "ca_cert", TESTS_DIR "/data/serverca.pem", &tree);
+    ret = nc_server_config_add_truststore_cert(test_ctx->ctx, "ca_cert_bag", "ca_cert", TESTS_DIR "/data/serverca.pem", &tree);
     assert_int_equal(ret, 0);
 
     /* new keystore ref for the TLS server cert */
-    ret = nc_server_config_add_tls_keystore_ref(ctx, "endpt", "server_key", "server_cert", &tree);
+    ret = nc_server_config_add_tls_keystore_ref(test_ctx->ctx, "endpt", "server_key", "server_cert", &tree);
     assert_int_equal(ret, 0);
 
     /* new truststore ref for the client cert */
-    ret = nc_server_config_add_tls_client_cert_truststore_ref(ctx, "endpt", "ee_cert_bag", &tree);
+    ret = nc_server_config_add_tls_client_cert_truststore_ref(test_ctx->ctx, "endpt", "ee_cert_bag", &tree);
     assert_int_equal(ret, 0);
 
     /* new truststore ref for the client CA cert */
-    ret = nc_server_config_add_tls_ca_cert_truststore_ref(ctx, "endpt", "ca_cert_bag", &tree);
+    ret = nc_server_config_add_tls_ca_cert_truststore_ref(test_ctx->ctx, "endpt", "ca_cert_bag", &tree);
     assert_int_equal(ret, 0);
 
     /* new cert-to-name */
-    ret = nc_server_config_add_tls_ctn(ctx, "endpt", 1,
+    ret = nc_server_config_add_tls_ctn(test_ctx->ctx, "endpt", 1,
             "04:85:6B:75:D1:1A:86:E0:D8:FE:5B:BD:72:F5:73:1D:07:EA:32:BF:09:11:21:6A:6E:23:78:8E:B6:D5:73:C3:2D",
             NC_TLS_CTN_SPECIFIED, "client", &tree);
     assert_int_equal(ret, 0);
@@ -289,44 +209,17 @@
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_ks_ts_ssh, setup_ssh, teardown_f),
-        cmocka_unit_test_setup_teardown(test_nc_ks_ts_tls, setup_tls, teardown_f),
+        cmocka_unit_test_setup_teardown(test_nc_ks_ts_ssh, setup_ssh, ln2_glob_test_teardown),
+        cmocka_unit_test_setup_teardown(test_nc_ks_ts_tls, setup_tls, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_pam.c b/tests/test_pam.c
index bb90604..a867c10 100644
--- a/tests/test_pam.c
+++ b/tests/test_pam.c
@@ -1,10 +1,10 @@
 /**
  * @file test_pam.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 SSH Keyboard Interactive auth using PAM test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -28,16 +28,6 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
 
 int TEST_PORT = 10050;
 const char *TEST_PORT_STR = "10050";
@@ -50,36 +40,6 @@
     return pam_start_confdir(service_name, user, pam_conversation, BUILD_DIR "/tests", pamh);
 }
 
-static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
 static char *
 auth_interactive(const char *UNUSED(auth_name), const char *UNUSED(instruction),
         const char *prompt, int UNUSED(echo), void *UNUSED(priv))
@@ -99,7 +59,7 @@
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -113,7 +73,7 @@
     /* set keyboard-interactive authentication callback */
     nc_client_ssh_set_auth_interactive_clb(auth_interactive, NULL);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
 
@@ -131,7 +91,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -144,35 +104,20 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
+    *state = test_ctx;
 
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init_ctx(&ctx);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_hostkey(ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_interactive(ctx, "endpt", "test", &tree);
+    ret = nc_server_config_add_ssh_user_interactive(test_ctx->ctx, "endpt", "test", &tree);
     assert_int_equal(ret, 0);
 
     ret = nc_server_ssh_set_pam_conf_filename("netconf.conf");
@@ -182,43 +127,16 @@
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_pam, setup_f, teardown_f)
+        cmocka_unit_test_setup_teardown(test_nc_pam, setup_f, ln2_glob_test_teardown)
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_replace.c b/tests/test_replace.c
index 246d3e8..43edd2f 100644
--- a/tests/test_replace.c
+++ b/tests/test_replace.c
@@ -1,10 +1,10 @@
 /**
  * @file test_replace.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 Non-diff YANG data configuration test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,56 +26,16 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
 
 int TEST_PORT = 10050;
 const char *TEST_PORT_STR = "10050";
 
 static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
-static void *
 client_thread(void *arg)
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
@@ -93,7 +53,7 @@
     assert_int_equal(ret, 0);
 
     /* wait for the server to reach polling */
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
 
     /* connect */
     session = nc_connect_ssh("127.0.0.1", TEST_PORT, NULL);
@@ -113,7 +73,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -126,51 +86,33 @@
 {
     int ret;
     struct lyd_node *old_tree = NULL, *new_tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
+    *state = test_ctx;
 
-    /* create new context */
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "old", NC_TI_SSH, "127.0.0.1", TEST_PORT, &old_tree);
     assert_int_equal(ret, 0);
 
-    /* load default modules into context */
-    ret = nc_server_init_ctx(&ctx);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "old", "old_key", TESTS_DIR "/data/key_rsa", NULL, &old_tree);
     assert_int_equal(ret, 0);
 
-    /* load ietf-netconf-server module and it's imports into context */
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_address_port(ctx, "old", NC_TI_SSH, "127.0.0.1", TEST_PORT, &old_tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_hostkey(ctx, "old", "old_key", TESTS_DIR "/data/key_rsa", NULL, &old_tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_password(ctx, "old", "old_client", "passwd", &old_tree);
+    ret = nc_server_config_add_ssh_user_password(test_ctx->ctx, "old", "old_client", "passwd", &old_tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the yang data, treat them as if every node had replace operation */
     ret = nc_server_config_setup_data(old_tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "new", NC_TI_SSH, "127.0.0.1", TEST_PORT, &new_tree);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "new", NC_TI_SSH, "127.0.0.1", TEST_PORT, &new_tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_hostkey(ctx, "new", "new_key", TESTS_DIR "/data/key_rsa", NULL, &new_tree);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "new", "new_key", TESTS_DIR "/data/key_rsa", NULL, &new_tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "new", "new_client", "pubkey", TESTS_DIR "/data/key_rsa.pub", &new_tree);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "new", "new_client", "pubkey", TESTS_DIR "/data/key_rsa.pub", &new_tree);
     assert_int_equal(ret, 0);
 
     /* configure the server based on the yang data, meaning
@@ -179,45 +121,17 @@
     ret = nc_server_config_setup_data(new_tree);
     assert_int_equal(ret, 0);
 
-    /* initialize the server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(old_tree);
     lyd_free_all(new_tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(nc_test_replace, setup_f, teardown_f),
+        cmocka_unit_test_setup_teardown(nc_test_replace, setup_f, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_runtime_changes.c b/tests/test_runtime_changes.c
index 9f24773..fc59ed2 100644
--- a/tests/test_runtime_changes.c
+++ b/tests/test_runtime_changes.c
@@ -4,7 +4,7 @@
  * @brief libnetconf2 Runtime changes test.
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -24,10 +24,6 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
 
 struct test_state {
     pthread_barrier_t start_barrier;
diff --git a/tests/test_thread_messages.c b/tests/test_thread_messages.c
index 89eaa02..0930cc6 100644
--- a/tests/test_thread_messages.c
+++ b/tests/test_thread_messages.c
@@ -25,17 +25,8 @@
 
 #include <libyang/libyang.h>
 
-#include <log.h>
-#include <messages_p.h>
-#include <messages_server.h>
-#include <session_client.h>
-#include <session_server.h>
-#include "tests/config.h"
+#include "ln2_test.h"
 
-/* millisec */
-#define NC_ACCEPT_TIMEOUT 5000
-/* millisec */
-#define NC_PS_POLL_TIMEOUT 5000
 /* sec */
 #define CLIENT_SSH_AUTH_TIMEOUT 10
 
diff --git a/tests/test_tls.c b/tests/test_tls.c
index c39da50..c6d7c5e 100644
--- a/tests/test_tls.c
+++ b/tests/test_tls.c
@@ -4,7 +4,7 @@
  * @brief libnetconf2 TLS authentication test
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -24,58 +24,16 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
 
 int TEST_PORT = 10050;
 const char *TEST_PORT_STR = "10050";
 
 static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    (void) arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
-
-static void *
 client_thread(void *arg)
 {
     int ret;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     ret = nc_client_set_schema_searchpath(MODULES_DIR);
     assert_int_equal(ret, 0);
@@ -88,7 +46,7 @@
     ret = nc_client_tls_set_trusted_ca_paths(NULL, TESTS_DIR "/data");
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_tls("127.0.0.1", TEST_PORT, NULL);
     assert_non_null(session);
 
@@ -106,7 +64,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -119,46 +77,31 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
-
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_init_ctx(&ctx);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_load_modules(&ctx);
-    assert_int_equal(ret, 0);
+    *state = test_ctx;
 
     /* create new address and port data */
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_TLS, "127.0.0.1", TEST_PORT, &tree);
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_TLS, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
     /* create new server certificate data */
-    ret = nc_server_config_add_tls_server_cert(ctx, "endpt", TESTS_DIR "/data/server.key", NULL, TESTS_DIR "/data/server.crt", &tree);
+    ret = nc_server_config_add_tls_server_cert(test_ctx->ctx, "endpt", TESTS_DIR "/data/server.key", NULL, TESTS_DIR "/data/server.crt", &tree);
     assert_int_equal(ret, 0);
 
     /* create new end entity client cert data */
-    ret = nc_server_config_add_tls_client_cert(ctx, "endpt", "client_cert", TESTS_DIR "/data/client.crt", &tree);
+    ret = nc_server_config_add_tls_client_cert(test_ctx->ctx, "endpt", "client_cert", TESTS_DIR "/data/client.crt", &tree);
     assert_int_equal(ret, 0);
 
     /* create new client ca data */
-    ret = nc_server_config_add_tls_ca_cert(ctx, "endpt", "client_ca", TESTS_DIR "/data/serverca.pem", &tree);
+    ret = nc_server_config_add_tls_ca_cert(test_ctx->ctx, "endpt", "client_ca", TESTS_DIR "/data/serverca.pem", &tree);
     assert_int_equal(ret, 0);
 
     /* create new cert-to-name */
-    ret = nc_server_config_add_tls_ctn(ctx, "endpt", 1,
+    ret = nc_server_config_add_tls_ctn(test_ctx->ctx, "endpt", 1,
             "04:85:6B:75:D1:1A:86:E0:D8:FE:5B:BD:72:F5:73:1D:07:EA:32:BF:09:11:21:6A:6E:23:78:8E:B6:D5:73:C3:2D",
             NC_TLS_CTN_SPECIFIED, "client", &tree);
     assert_int_equal(ret, 0);
@@ -167,43 +110,16 @@
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_tls, setup_f, teardown_f),
+        cmocka_unit_test_setup_teardown(test_nc_tls, setup_f, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_two_channels.c b/tests/test_two_channels.c
index ebe6198..9d9e97d 100644
--- a/tests/test_two_channels.c
+++ b/tests/test_two_channels.c
@@ -1,10 +1,10 @@
 /**
  * @file test_two_channels.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 Openning a new session on an established SSH channel test.
  *
  * @copyright
- * Copyright (c) 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2023 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -26,14 +26,9 @@
 #include <cmocka.h>
 
 #include "ln2_test.h"
-#include "tests/config.h"
 
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
 #define BACKOFF_TIMEOUT_USECS 100
 
-struct ly_ctx *ctx;
-
 int TEST_PORT = 10050;
 const char *TEST_PORT_STR = "10050";
 
@@ -44,14 +39,13 @@
     NC_MSG_TYPE msgtype;
     struct nc_session *session, *new_session;
     struct nc_pollsession *ps;
-
-    (void) arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     ps = nc_ps_new();
     assert_non_null(ps);
 
     while (del_session_count < 2) {
-        msgtype = nc_accept(0, ctx, &new_session);
+        msgtype = nc_accept(0, test_ctx->ctx, &new_session);
 
         if (msgtype == NC_MSG_HELLO) {
             ret = nc_ps_add_session(ps, new_session);
@@ -84,10 +78,11 @@
 static void *
 client_thread(void *arg)
 {
-    (void) arg;
     int ret;
     struct nc_session *session_cl1, *session_cl2;
 
+    (void) arg;
+
     /* skip all hostkey and known_hosts checks */
     nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
 
@@ -115,7 +110,6 @@
     session_cl2 = nc_connect_ssh_channel(session_cl1, NULL);
     assert_non_null(session_cl2);
 
-    nc_client_destroy();
     nc_session_free(session_cl1, NULL);
     nc_session_free(session_cl2, NULL);
     return NULL;
@@ -127,11 +121,9 @@
     int ret, i;
     pthread_t tids[2];
 
-    (void) state;
-
-    ret = pthread_create(&tids[0], NULL, client_thread, NULL);
+    ret = pthread_create(&tids[0], NULL, client_thread, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, NULL);
+    ret = pthread_create(&tids[1], NULL, server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -144,63 +136,38 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
+    struct ln2_test_ctx *test_ctx;
 
-    (void) state;
-
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init_ctx(&ctx);
+    *state = test_ctx;
+
+    ret = nc_server_config_add_address_port(test_ctx->ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_load_modules(&ctx);
+    ret = nc_server_config_add_ssh_hostkey(test_ctx->ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_address_port(ctx, "endpt", NC_TI_SSH, "127.0.0.1", TEST_PORT, &tree);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "endpt", "client_1", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_config_add_ssh_hostkey(ctx, "endpt", "hostkey", TESTS_DIR "/data/key_ecdsa", NULL, &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "endpt", "client_1", "pubkey", TESTS_DIR "/data/id_ed25519.pub", &tree);
-    assert_int_equal(ret, 0);
-
-    ret = nc_server_config_add_ssh_user_pubkey(ctx, "endpt", "client_2", "pubkey", TESTS_DIR "/data/id_ecdsa521.pub", &tree);
+    ret = nc_server_config_add_ssh_user_pubkey(test_ctx->ctx, "endpt", "client_2", "pubkey", TESTS_DIR "/data/id_ecdsa521.pub", &tree);
     assert_int_equal(ret, 0);
 
     ret = nc_server_config_setup_data(tree);
     assert_int_equal(ret, 0);
 
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
 
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    (void) state;
-
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_two_channels, setup_f, teardown_f),
+        cmocka_unit_test_setup_teardown(test_nc_two_channels, setup_f, ln2_glob_test_teardown),
     };
 
     /* try to get ports from the environment, otherwise use the default */
diff --git a/tests/test_unix_socket.c b/tests/test_unix_socket.c
index a6c81d7..75ccff9 100644
--- a/tests/test_unix_socket.c
+++ b/tests/test_unix_socket.c
@@ -1,10 +1,10 @@
 /**
  * @file test_unix_socket.c
- * @author Roman Janota <xjanot04@fit.vutbr.cz>
+ * @author Roman Janota <janota@cesnet.cz>
  * @brief libnetconf2 UNIX socket test
  *
  * @copyright
- * Copyright (c) 2022 CESNET, z.s.p.o.
+ * Copyright (c) 2022 - 2024 CESNET, z.s.p.o.
  *
  * This source code is licensed under BSD 3-Clause License (the "License").
  * You may not use this file except in compliance with the License.
@@ -25,58 +25,19 @@
 
 #include <cmocka.h>
 
-#include "tests/config.h"
-
-#define NC_ACCEPT_TIMEOUT 2000
-#define NC_PS_POLL_TIMEOUT 2000
-
-struct ly_ctx *ctx;
-
-struct test_state {
-    pthread_barrier_t barrier;
-};
-
-static void *
-server_thread(void *arg)
-{
-    int ret;
-    NC_MSG_TYPE msgtype;
-    struct nc_session *session;
-    struct nc_pollsession *ps;
-    struct test_state *state = arg;
-
-    ps = nc_ps_new();
-    assert_non_null(ps);
-
-    /* accept a session and add it to the poll session structure */
-    pthread_barrier_wait(&state->barrier);
-    msgtype = nc_accept(NC_ACCEPT_TIMEOUT, ctx, &session);
-    assert_int_equal(msgtype, NC_MSG_HELLO);
-
-    ret = nc_ps_add_session(ps, session);
-    assert_int_equal(ret, 0);
-
-    do {
-        ret = nc_ps_poll(ps, NC_PS_POLL_TIMEOUT, NULL);
-        assert_int_equal(ret & NC_PSPOLL_RPC, NC_PSPOLL_RPC);
-    } while (!(ret & NC_PSPOLL_SESSION_TERM));
-
-    nc_ps_clear(ps, 1, NULL);
-    nc_ps_free(ps);
-    return NULL;
-}
+#include "ln2_test.h"
 
 static void *
 client_thread(void *arg)
 {
     int ret = 0;
     struct nc_session *session = NULL;
-    struct test_state *state = arg;
+    struct ln2_test_ctx *test_ctx = arg;
 
     ret = nc_client_set_schema_searchpath(MODULES_DIR);
     assert_int_equal(ret, 0);
 
-    pthread_barrier_wait(&state->barrier);
+    pthread_barrier_wait(&test_ctx->barrier);
     session = nc_connect_unix("/tmp/nc2_test_unix_sock", NULL);
     assert_non_null(session);
 
@@ -94,7 +55,7 @@
 
     ret = pthread_create(&tids[0], NULL, client_thread, *state);
     assert_int_equal(ret, 0);
-    ret = pthread_create(&tids[1], NULL, server_thread, *state);
+    ret = pthread_create(&tids[1], NULL, ln2_glob_test_server_thread, *state);
     assert_int_equal(ret, 0);
 
     for (i = 0; i < 2; i++) {
@@ -107,67 +68,26 @@
 {
     int ret;
     struct lyd_node *tree = NULL;
-    struct test_state *test_state;
+    struct ln2_test_ctx *test_ctx;
 
-    nc_verbosity(NC_VERB_VERBOSE);
-
-    /* init barrier */
-    test_state = malloc(sizeof *test_state);
-    assert_non_null(test_state);
-
-    ret = pthread_barrier_init(&test_state->barrier, NULL, 2);
+    ret = ln2_glob_test_setup(&test_ctx);
     assert_int_equal(ret, 0);
 
-    *state = test_state;
-
-    ret = ly_ctx_new(MODULES_DIR, 0, &ctx);
-    assert_int_equal(ret, 0);
-
-    /* initialize context */
-    ret = nc_server_init_ctx(&ctx);
-    assert_int_equal(ret, 0);
+    *state = test_ctx;
 
     /* create the UNIX socket */
     ret = nc_server_add_endpt_unix_socket_listen("unix", "/tmp/nc2_test_unix_sock", 0700, -1, -1);
     assert_int_equal(ret, 0);
 
-    /* initialize server */
-    ret = nc_server_init();
-    assert_int_equal(ret, 0);
-
-    /* initialize client */
-    ret = nc_client_init();
-    assert_int_equal(ret, 0);
-
     lyd_free_all(tree);
     return 0;
 }
 
-static int
-teardown_f(void **state)
-{
-    int ret = 0;
-    struct test_state *test_state;
-
-    assert_non_null(state);
-    test_state = *state;
-
-    ret = pthread_barrier_destroy(&test_state->barrier);
-    assert_int_equal(ret, 0);
-
-    free(*state);
-    nc_client_destroy();
-    nc_server_destroy();
-    ly_ctx_destroy(ctx);
-
-    return 0;
-}
-
 int
 main(void)
 {
     const struct CMUnitTest tests[] = {
-        cmocka_unit_test_setup_teardown(test_nc_connect_unix_socket, setup_f, teardown_f),
+        cmocka_unit_test_setup_teardown(test_nc_connect_unix_socket, setup_f, ln2_glob_test_teardown),
     };
 
     setenv("CMOCKA_TEST_ABORT", "1", 1);
