From 4681877db885661f78c3a39d26576992acbf816d Mon Sep 17 00:00:00 2001 From: Michal Vasko Date: Wed, 5 Jun 2024 08:57:17 +0200 Subject: [PATCH] tests UPDATE uninstall modules after terminating the server Prevents it from updating its context just to properly clean up and terminate. --- tests/np2_test.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/np2_test.c b/tests/np2_test.c index ae299438..513967de 100644 --- a/tests/np2_test.c +++ b/tests/np2_test.c @@ -390,18 +390,6 @@ np2_glob_test_teardown(void **state, const char **modules) /* release context */ sr_release_context(st->conn); - /* uninstall modules */ - if (modules && (rc = sr_remove_modules(st->conn, modules, 0))) { - printf("sr_remove_modules() failed (%s)\n", sr_strerror(rc)); - ret = 1; - } - - /* disconnect */ - if ((rc = sr_disconnect(st->conn))) { - printf("sr_disconnect() failed (%s)\n", sr_strerror(rc)); - ret = 1; - } - #ifdef NETOPEER2_LIB if (np2_server_test_stop()) { printf("np2_server_test_stop() failed\n"); @@ -431,6 +419,18 @@ np2_glob_test_teardown(void **state, const char **modules) } #endif + /* uninstall modules */ + if (modules && (rc = sr_remove_modules(st->conn, modules, 0))) { + printf("sr_remove_modules() failed (%s)\n", sr_strerror(rc)); + ret = 1; + } + + /* disconnect */ + if ((rc = sr_disconnect(st->conn))) { + printf("sr_disconnect() failed (%s)\n", sr_strerror(rc)); + ret = 1; + } + /* unset sysrepo environment variables */ if (unsetenv("SYSREPO_REPOSITORY_PATH")) { SETUP_FAIL_LOG;