test: test-kdbus: fix monitor and byebye tests
authorDaniel Mack <zonque@gmail.com>
Thu, 14 Aug 2014 14:14:33 +0000 (16:14 +0200)
committerDaniel Mack <zonque@gmail.com>
Thu, 14 Aug 2014 14:16:30 +0000 (16:16 +0200)
Since commit 7015a1e6 ("prevent special-purpose connections from
owning names or exchanging messages"), ioctl() calls return
-EOPNOTSUPP they are issued to a handle of a inapproprate type.
Follow this change in the test as well.

test/test-kdbus.c

index f0bf7051a7566b6a3657ceba70e1d7dcba497cd5..e4f5df50943521bb68485dd6fb242731c016f77b 100644 (file)
@@ -476,7 +476,7 @@ static int check_byebye(struct kdbus_check_env *env)
 
        /* a 2nd try should result in -EALREADY */
        ret = ioctl(conn->fd, KDBUS_CMD_BYEBYE, 0);
-       ASSERT_RETURN(ret == -1 && errno == EALREADY);
+       ASSERT_RETURN(ret == -1 && errno == EOPNOTSUPP);
 
        free_conn(conn);
 
@@ -506,7 +506,7 @@ static int check_monitor(struct kdbus_check_env *env)
 
        /* check that we can acquire a name */
        ret = ioctl(conn->fd, KDBUS_CMD_NAME_ACQUIRE, cmd_name);
-       ASSERT_RETURN(ret == -1 && errno == EPERM);
+       ASSERT_RETURN(ret == -1 && errno == EOPNOTSUPP);
 
        free_conn(conn);