Revert "kdbus: TEST_CREATE_CONN now does no depend on TEST_CREATE_BUS"
authorKonrad Lipinski <konrad.l@samsung.com>
Thu, 8 Sep 2016 14:47:32 +0000 (16:47 +0200)
committerKonrad Lipinski <konrad.l@samsung.com>
Fri, 9 Sep 2016 11:26:23 +0000 (13:26 +0200)
This reverts commit f539d4d79a080e697fee6f63a4d6e66609892139.

tools/testing/selftests/kdbus/kdbus-test.c
tools/testing/selftests/kdbus/kdbus-util.c

index bf1a69c59365ee06b6bcd1799027522594238b83..a43674ccdeb0029b24a79f34cdbbc2867d05ea75 100644 (file)
@@ -317,27 +317,6 @@ static int test_prepare_env(const struct kdbus_test *t,
        }
 
        if (t->flags & TEST_CREATE_CONN) {
-               if (!env->buspath) {
-                       char *s = NULL;
-                       char *n = NULL;
-                       int ret;
-
-                       if (!args->busname) {
-                               n = unique_name("test-bus");
-                               ASSERT_RETURN(n);
-                       }
-
-                       ret = kdbus_create_bus(-1,
-                                              args->busname ?: n,
-                                              0,
-                                              0, &s);
-                       free(n);
-                       ASSERT_RETURN(ret == 0);
-
-                       asprintf(&env->buspath, "%s/%s/bus", args->root, s);
-                       free(s);
-               }
-               ASSERT_RETURN(env->buspath);
                env->conn = kdbus_hello(env->buspath, 0, NULL, 0);
                ASSERT_RETURN(env->conn);
        }
index 0849f5ef81ff3c6acd130f52c43dbfa1598d973e..4b376ecfdbed0da7b3d68f9b50981267f60c322b 100644 (file)
@@ -141,7 +141,7 @@ int kdbus_create_bus(int control_fd, const char *name,
                        char str[64];
                } name;
        } bus_make;
-       int ret = 0;
+       int ret;
 
        memset(&bus_make, 0, sizeof(bus_make));
        bus_make.bp.size = sizeof(bus_make.bp);
@@ -171,17 +171,13 @@ int kdbus_create_bus(int control_fd, const char *name,
                             bus_make.attach[1].size +
                             bus_make.name.size;
 
-       if (control_fd != -1) {
-               kdbus_printf(
-                       "Creating bus with name >%s< on control fd %d ...\n",
-                       name, control_fd);
+       kdbus_printf("Creating bus with name >%s< on control fd %d ...\n",
+                    name, control_fd);
 
-               ret = kdbus_cmd_bus_make(control_fd, &bus_make.cmd);
-               if (ret < 0) {
-                       kdbus_printf("--- error when making bus: %d (%m)\n",
-                                    ret);
-                       return ret;
-               }
+       ret = kdbus_cmd_bus_make(control_fd, &bus_make.cmd);
+       if (ret < 0) {
+               kdbus_printf("--- error when making bus: %d (%m)\n", ret);
+               return ret;
        }
 
        if (ret == 0 && path)