Index: uspace/lib/dispcfg/test/dispcfg.c
===================================================================
--- uspace/lib/dispcfg/test/dispcfg.c	(revision 5b19d806b26e4a267739e5ac28bbe9194259b766)
+++ uspace/lib/dispcfg/test/dispcfg.c	(revision 46a47c0ecde5eec9824d8b22b70d9238a2b3a58e)
@@ -50,4 +50,6 @@
 static errno_t test_seat_create(void *, const char *, sysarg_t *);
 static errno_t test_seat_delete(void *, sysarg_t);
+static errno_t test_dev_assign(void *, sysarg_t, sysarg_t);
+static errno_t test_dev_unassign(void *, sysarg_t);
 static errno_t test_get_event(void *, dispcfg_ev_t *);
 
@@ -60,4 +62,6 @@
 	.seat_create = test_seat_create,
 	.seat_delete = test_seat_delete,
+	.dev_assign = test_dev_assign,
+	.dev_unassign = test_dev_unassign,
 	.get_event = test_get_event
 };
@@ -91,4 +95,11 @@
 	bool seat_delete_called;
 	sysarg_t seat_delete_seat_id;
+
+	bool dev_assign_called;
+	sysarg_t dev_assign_svc_id;
+	sysarg_t dev_assign_seat_id;
+
+	bool dev_unassign_called;
+	sysarg_t dev_unassign_svc_id;
 
 	bool get_event_called;
@@ -443,4 +454,154 @@
 }
 
+/** dispcfg_dev_assign() with server returning error response works */
+PCUT_TEST(dev_assign_failure)
+{
+	errno_t rc;
+	service_id_t sid;
+	dispcfg_t *dispcfg = NULL;
+	sysarg_t svc_id;
+	sysarg_t seat_id;
+	test_response_t resp;
+
+	async_set_fallback_port_handler(test_dispcfg_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_dispcfg_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_dispcfg_svc, &sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = dispcfg_open(test_dispcfg_svc, NULL, NULL, &dispcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(dispcfg);
+
+	svc_id = 12;
+	seat_id = 13;
+	resp.rc = ENOMEM;
+	resp.dev_assign_called = false;
+
+	rc = dispcfg_dev_assign(dispcfg, svc_id, seat_id);
+	PCUT_ASSERT_TRUE(resp.dev_assign_called);
+	PCUT_ASSERT_INT_EQUALS(svc_id, resp.dev_assign_svc_id);
+	PCUT_ASSERT_INT_EQUALS(seat_id, resp.dev_assign_seat_id);
+	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
+
+	dispcfg_close(dispcfg);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** dispcfg_dev_assign() with server returning success response works */
+PCUT_TEST(dev_assign_success)
+{
+	errno_t rc;
+	service_id_t sid;
+	dispcfg_t *dispcfg = NULL;
+	sysarg_t svc_id;
+	sysarg_t seat_id;
+	test_response_t resp;
+
+	async_set_fallback_port_handler(test_dispcfg_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_dispcfg_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_dispcfg_svc, &sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = dispcfg_open(test_dispcfg_svc, NULL, NULL, &dispcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(dispcfg);
+
+	svc_id = 12;
+	seat_id = 13;
+	resp.rc = EOK;
+	resp.dev_assign_called = false;
+
+	rc = dispcfg_dev_assign(dispcfg, svc_id, seat_id);
+	PCUT_ASSERT_TRUE(resp.dev_assign_called);
+	PCUT_ASSERT_INT_EQUALS(svc_id, resp.dev_assign_svc_id);
+	PCUT_ASSERT_INT_EQUALS(seat_id, resp.dev_assign_seat_id);
+	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
+
+	dispcfg_close(dispcfg);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** dispcfg_dev_unassign() with server returning error response works */
+PCUT_TEST(dev_unassign_failure)
+{
+	errno_t rc;
+	service_id_t sid;
+	dispcfg_t *dispcfg = NULL;
+	sysarg_t svc_id;
+	test_response_t resp;
+
+	async_set_fallback_port_handler(test_dispcfg_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_dispcfg_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_dispcfg_svc, &sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = dispcfg_open(test_dispcfg_svc, NULL, NULL, &dispcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(dispcfg);
+
+	svc_id = 12;
+	resp.rc = ENOMEM;
+	resp.dev_unassign_called = false;
+
+	rc = dispcfg_dev_unassign(dispcfg, svc_id);
+	PCUT_ASSERT_TRUE(resp.dev_unassign_called);
+	PCUT_ASSERT_INT_EQUALS(svc_id, resp.dev_unassign_svc_id);
+	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
+
+	dispcfg_close(dispcfg);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** dispcfg_dev_unassign() with server returning success response works */
+PCUT_TEST(dev_unassign_success)
+{
+	errno_t rc;
+	service_id_t sid;
+	dispcfg_t *dispcfg = NULL;
+	sysarg_t svc_id;
+	test_response_t resp;
+
+	async_set_fallback_port_handler(test_dispcfg_conn, &resp);
+
+	// FIXME This causes this test to be non-reentrant!
+	rc = loc_server_register(test_dispcfg_server);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = loc_service_register(test_dispcfg_svc, &sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = dispcfg_open(test_dispcfg_svc, NULL, NULL, &dispcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(dispcfg);
+
+	svc_id = 12;
+	resp.rc = EOK;
+	resp.dev_unassign_called = false;
+
+	rc = dispcfg_dev_unassign(dispcfg, svc_id);
+	PCUT_ASSERT_TRUE(resp.dev_unassign_called);
+	PCUT_ASSERT_INT_EQUALS(svc_id, resp.dev_unassign_svc_id);
+	PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
+
+	dispcfg_close(dispcfg);
+	rc = loc_service_unregister(sid);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
 /** Window added event can be delivered from server to client callback function */
 PCUT_TEST(seat_added_deliver)
@@ -628,4 +789,23 @@
 }
 
+static errno_t test_dev_assign(void *arg, sysarg_t svc_id, sysarg_t seat_id)
+{
+	test_response_t *resp = (test_response_t *) arg;
+
+	resp->dev_assign_called = true;
+	resp->dev_assign_svc_id = svc_id;
+	resp->dev_assign_seat_id = seat_id;
+	return resp->rc;
+}
+
+static errno_t test_dev_unassign(void *arg, sysarg_t svc_id)
+{
+	test_response_t *resp = (test_response_t *) arg;
+
+	resp->dev_unassign_called = true;
+	resp->dev_unassign_svc_id = svc_id;
+	return resp->rc;
+}
+
 static errno_t test_get_event(void *arg, dispcfg_ev_t *event)
 {
