From 6d461a4fe7896faa1aec5a5417888cf179e46b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Mon, 22 Feb 2016 01:12:47 -0300 Subject: Linux-libre 4.4.2-gnu --- tools/testing/selftests/kdbus/test-policy.c | 80 ----------------------------- 1 file changed, 80 deletions(-) delete mode 100644 tools/testing/selftests/kdbus/test-policy.c (limited to 'tools/testing/selftests/kdbus/test-policy.c') diff --git a/tools/testing/selftests/kdbus/test-policy.c b/tools/testing/selftests/kdbus/test-policy.c deleted file mode 100644 index 96d20d5e9..000000000 --- a/tools/testing/selftests/kdbus/test-policy.c +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "kdbus-test.h" -#include "kdbus-util.h" -#include "kdbus-enum.h" - -int kdbus_test_policy(struct kdbus_test_env *env) -{ - struct kdbus_conn *conn_a, *conn_b; - struct kdbus_policy_access access; - int ret; - - /* Invalid name */ - conn_a = kdbus_hello_registrar(env->buspath, ".example.a", - NULL, 0, KDBUS_HELLO_POLICY_HOLDER); - ASSERT_RETURN(conn_a == NULL); - - conn_a = kdbus_hello_registrar(env->buspath, "example", - NULL, 0, KDBUS_HELLO_POLICY_HOLDER); - ASSERT_RETURN(conn_a == NULL); - - conn_a = kdbus_hello_registrar(env->buspath, "com.example.a", - NULL, 0, KDBUS_HELLO_POLICY_HOLDER); - ASSERT_RETURN(conn_a); - - conn_b = kdbus_hello_registrar(env->buspath, "com.example.b", - NULL, 0, KDBUS_HELLO_POLICY_HOLDER); - ASSERT_RETURN(conn_b); - - /* - * Verify there cannot be any duplicate entries, except for specific vs. - * wildcard entries. - */ - - access = (struct kdbus_policy_access){ - .type = KDBUS_POLICY_ACCESS_USER, - .id = geteuid(), - .access = KDBUS_POLICY_SEE, - }; - - ret = kdbus_conn_update_policy(conn_a, "com.example.a", &access, 1); - ASSERT_RETURN(ret == 0); - - ret = kdbus_conn_update_policy(conn_b, "com.example.a", &access, 1); - ASSERT_RETURN(ret == -EEXIST); - - ret = kdbus_conn_update_policy(conn_b, "com.example.a.*", &access, 1); - ASSERT_RETURN(ret == 0); - - ret = kdbus_conn_update_policy(conn_a, "com.example.a.*", &access, 1); - ASSERT_RETURN(ret == -EEXIST); - - ret = kdbus_conn_update_policy(conn_a, "com.example.*", &access, 1); - ASSERT_RETURN(ret == 0); - - ret = kdbus_conn_update_policy(conn_b, "com.example.a", &access, 1); - ASSERT_RETURN(ret == 0); - - ret = kdbus_conn_update_policy(conn_b, "com.example.*", &access, 1); - ASSERT_RETURN(ret == -EEXIST); - - /* Invalid name */ - ret = kdbus_conn_update_policy(conn_b, ".example.*", &access, 1); - ASSERT_RETURN(ret == -EINVAL); - - ret = kdbus_conn_update_policy(conn_b, "example", &access, 1); - ASSERT_RETURN(ret == -EINVAL); - - kdbus_conn_free(conn_b); - kdbus_conn_free(conn_a); - - return TEST_OK; -} -- cgit v1.2.3