test-fd: fix the fd passing test and use KDBUS_MSG_MAX_FDS for normal fds
authorDjalal Harouni <tixxdz@opendz.org>
Mon, 20 Oct 2014 16:57:40 +0000 (17:57 +0100)
committerDjalal Harouni <tixxdz@opendz.org>
Mon, 20 Oct 2014 16:57:40 +0000 (17:57 +0100)
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
test/test-fd.c

index 89117db69a5f4ad01654d5ab9124c9d7880dad9a..84708e824a4565d454dd7ba1c2fa4612b2fd536d 100644 (file)
@@ -225,11 +225,18 @@ static int kdbus_send_multiple_fds(struct kdbus_conn *conn_src,
        kdbus_msg_free(msg);
 
 
-       /* Combine multiple 154 fds and 100 memfds */
+       /* Combine multiple 254 fds and 100 memfds */
        ret = send_fds_memfds(conn_src, conn_dst->id,
-                             fds, 154, memfds, 100);
+                             fds, KDBUS_MSG_MAX_FDS + 1,
+                             memfds, 100);
        ASSERT_RETURN(ret == -EMFILE);
 
+       /* Combine multiple 253 fds and 100 memfds */
+       ret = send_fds_memfds(conn_src, conn_dst->id,
+                             fds, KDBUS_MSG_MAX_FDS,
+                             memfds, KDBUS_MSG_MAX_ITEMS + 1);
+       ASSERT_RETURN(ret == -E2BIG);
+
        ret = send_fds_memfds(conn_src, conn_dst->id,
                              fds, 153, memfds, 100);
        ASSERT_RETURN(ret == 0);