Skip to content

Commit

Permalink
tests UPDATE uninstall modules after terminating the server
Browse files Browse the repository at this point in the history
Prevents it from updating its context just to
properly clean up and terminate.
  • Loading branch information
michalvasko committed Jun 5, 2024
1 parent 8ab79d8 commit 4681877
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/np2_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4681877

Please sign in to comment.