From: Konrad Lipinski Date: Thu, 15 Sep 2016 10:37:07 +0000 (+0200) Subject: kdbus-test: fix test-policy-priv for TIZEN X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba4640fb13cbc78b220963924366690a7e979fe2;p=platform%2Fkernel%2Flinux-exynos.git kdbus-test: fix test-policy-priv for TIZEN --- diff --git a/tools/testing/selftests/kdbus/test-policy-priv.c b/tools/testing/selftests/kdbus/test-policy-priv.c index 78412470284b..12d6817d35ea 100644 --- a/tools/testing/selftests/kdbus/test-policy-priv.c +++ b/tools/testing/selftests/kdbus/test-policy-priv.c @@ -22,6 +22,10 @@ static wur int test_policy_priv_by_id(const char *bus, { uint64_t expected_cookie = time(NULL) ^ 0xdeadbeef; +#ifdef TIZEN + parent_status = child_status = 0; +#endif + ASSERT_NONZERO(conn_dst); RUN_UNPRIVILEGED_CONN(unpriv, bus, ({ @@ -48,6 +52,12 @@ static wur int test_policy_priv_by_broadcast(const char *bus, struct kdbus_conn *child_2 = conn_dst; uint64_t expected_cookie = time(NULL) ^ 0xdeadbeef; +#ifdef TIZEN + child_status = 0; + if (DO_NOT_DROP != drop_second_user) + parent_status = 0; +#endif + /* Drop to another unprivileged user other than UNPRIV_UID */ if (drop_second_user == DROP_OTHER_UNPRIV) { second_uid = UNPRIV_UID - 1; @@ -159,11 +169,11 @@ static wur int test_priv_before_policy_upload(struct kdbus_test_env *env) /* * Make sure unprivileged bus user cannot acquire names - * before registring any policy holder. + * before registering any policy holder. */ RUN_UNPRIVILEGED_CONN(unpriv, env->buspath, ({ - ASSERT_EXIT(0,>,kdbus_name_acquire(unpriv, "com.example.a", NULL)); + ASSERT_EXIT(0,ONTIZEN(==,>),kdbus_name_acquire(unpriv, "com.example.a", NULL)); })); /* @@ -614,7 +624,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) */ RUN_UNPRIVILEGED_CONN(unpriv, env->buspath, ({ - ASSERT_EXIT_NONZERO(kdbus_name_acquire(unpriv, "com.example.a", NULL)); + ASSERT_EXIT(0,ONTIZEN(==,!=),kdbus_name_acquire(unpriv, "com.example.a", NULL)); })); /* @@ -669,7 +679,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) ASSERT_ZERO(kdbus_conn_update_policy(conn_a, "com.example.a", &access, 1)); RUN_UNPRIVILEGED_CONN(unpriv, env->buspath, ({ - ASSERT_EXIT_NONZERO(kdbus_name_acquire(unpriv, "com.example.a", NULL)); + ASSERT_EXIT(0,ONTIZEN(==,!=),kdbus_name_acquire(unpriv, "com.example.a", NULL)); })); /* @@ -698,7 +708,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) ASSERT_ZERO(kdbus_conn_update_policy(conn_a, "com.example.a", &access, 1)); RUN_UNPRIVILEGED_CONN(unpriv, env->buspath, ({ - ASSERT_EXIT_NONZERO(kdbus_name_acquire(unpriv, "com.example.a", NULL)); + ASSERT_EXIT(0,ONTIZEN(==,!=),kdbus_name_acquire(unpriv, "com.example.a", NULL)); })); /* @@ -733,7 +743,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) ASSERT_ZERO(kdbus_conn_update_policy(conn_a, "com.example.a", acc, num)); RUN_UNPRIVILEGED_CONN(unpriv, env->buspath, ({ - ASSERT_EXIT_NONZERO(kdbus_name_acquire(unpriv, "com.example.a", NULL)); + ASSERT_EXIT(0,ONTIZEN(==,!=),kdbus_name_acquire(unpriv, "com.example.a", NULL)); })); /* @@ -799,7 +809,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) */ RUN_UNPRIVILEGED_CONN(unpriv, env->buspath, ({ - ASSERT_EXIT(-EPERM,==,kdbus_msg_send(unpriv, "com.example.b", 0xdeadbeef, 0, 0, 0, 0)); + ASSERT_EXIT(ONTIZEN(0,-EPERM),==,kdbus_msg_send(unpriv, "com.example.b", 0xdeadbeef, 0, 0, 0, 0)); })); /* @@ -922,7 +932,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) ASSERT_ZERO(kdbus_conn_update_policy(conn_a, "com.example.b", acc, num)); RUN_UNPRIVILEGED_CONN(unpriv, env->buspath, ({ - ASSERT_EXIT(-EPERM,==,kdbus_msg_send(unpriv, "com.example.b", 0xdeadbeef, 0, 0, 0, 0)); + ASSERT_EXIT(ONTIZEN(0,-EPERM),==,kdbus_msg_send(unpriv, "com.example.b", 0xdeadbeef, 0, 0, 0, 0)); })); /* @@ -964,7 +974,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) ASSERT_ZERO(kdbus_conn_update_policy(conn_a, "com.example.b", NULL, 0)); - ASSERT_EXIT(-EPERM,==,kdbus_msg_send(unpriv, "com.example.b", 0xdeadbeef, 0, 0, 0, 0)); + ASSERT_EXIT(ONTIZEN(0,-EPERM),==,kdbus_msg_send(unpriv, "com.example.b", 0xdeadbeef, 0, 0, 0, 0)); })); /* @@ -1004,7 +1014,7 @@ static wur int test_policy_priv(struct kdbus_test_env *env) /* free policy holder */ kdbus_conn_free(conn); - ASSERT_EXIT(-EPERM,==,kdbus_msg_send(unpriv, "com.example.c", 0xdeadbeef, 0, 0, 0, 0)); + ASSERT_EXIT(ONTIZEN(0,-EPERM),==,kdbus_msg_send(unpriv, "com.example.c", 0xdeadbeef, 0, 0, 0, 0)); kdbus_conn_free(unpriv); }), ({