aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Hobson-Garcia <dhobsong@igel.co.jp>2021-03-09 13:25:41 +0900
committerDamian Hobson-Garcia <dhobsong@igel.co.jp>2021-03-29 12:14:04 +0900
commit220eb2fad6c21338c32989e69f45646b4e8d5f0f (patch)
treeed0e180644a2f365b34501cfa1c0d3d39f0d73d9
parentf991de200799118355fd75237a740321bda7aaa7 (diff)
lease-server-test: Destroy server on shutdown
libcheck tests normally run each test in a separate process so the server objects will automatically be destroyed after each test. If the test suite is run with CK_FORK=no, for example when debugging the test with gdb, failing to destory the server object will leave the test sockets from the previous test open, which will stop the next test from creating its own sockets. Bug-AGL: SPEC-3816 Change-Id: I42a0976c392bdc19bb60acc78178aac8ee3e14ce Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-rw-r--r--drm-lease-manager/test/lease-server-test.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drm-lease-manager/test/lease-server-test.c b/drm-lease-manager/test/lease-server-test.c
index f8e000e..2672820 100644
--- a/drm-lease-manager/test/lease-server-test.c
+++ b/drm-lease-manager/test/lease-server-test.c
@@ -197,6 +197,7 @@ START_TEST(issue_lease_request_and_release)
get_and_check_request(ls, &test_lease, LS_REQ_GET_LEASE);
test_client_stop(cstate);
get_and_check_request(ls, &test_lease, LS_REQ_RELEASE_LEASE);
+ ls_destroy(ls);
}
END_TEST
@@ -216,6 +217,7 @@ START_TEST(issue_lease_request_and_early_release)
test_client_stop(cstate);
get_and_check_request(ls, &test_lease, LS_REQ_GET_LEASE);
get_and_check_request(ls, &test_lease, LS_REQ_RELEASE_LEASE);
+ ls_destroy(ls);
}
END_TEST
@@ -269,6 +271,7 @@ START_TEST(issue_multiple_lease_requests)
ck_assert_int_eq(accepted_config.connection_completed, true);
for (int i = 0; i < nextra_clients; i++)
ck_assert_int_eq(extra_configs[i].connection_completed, false);
+ ls_destroy(ls);
}
END_TEST
@@ -316,6 +319,7 @@ START_TEST(send_fd_to_client)
ck_assert_int_eq(default_test_config.connection_completed, true);
ck_assert_int_eq(default_test_config.has_data, true);
check_fd_equality(test_fd, default_test_config.received_fd);
+ ls_destroy(ls);
}
END_TEST
@@ -345,6 +349,7 @@ START_TEST(ls_send_fd_is_noop_when_fd_is_invalid)
get_and_check_request(ls, &test_lease, LS_REQ_RELEASE_LEASE);
ck_assert_int_eq(default_test_config.connection_completed, true);
ck_assert_int_eq(default_test_config.has_data, false);
+ ls_destroy(ls);
}
END_TEST