From eea1e14902a445e51910ad970fdbc42368df68d5 Mon Sep 17 00:00:00 2001 From: Damian Hobson-Garcia Date: Tue, 9 Mar 2021 13:25:41 +0900 Subject: 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 Signed-off-by: Damian Hobson-Garcia Change-Id: I63b86d692490c4cce7107839c7bd558a35855b0a --- drm-lease-manager/test/lease-server-test.c | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit 1.2.3-korg