Error messages stated that function failed instead of saying
that access should not have been granted.
Change-Id: Ifcd1bca4f5b6b12c5d907b0301afdc727e73739a
int ret = security_server_check_privilege(cookie.data(), 0);
RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
int ret = security_server_check_privilege(cookie.data(), 0);
RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
- "Error in security_server_check_privilege(): " << ret);
+ "security_server_check_privilege() should return access denied: " << ret);
}
//privileges drop and added smack rule
}
//privileges drop and added smack rule
int ret = security_server_get_cookie_pid(cookie.data());
RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
int ret = security_server_get_cookie_pid(cookie.data());
RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
- "Error in security_server_get_cookie_pid(): " << ret);
+ "security_server_get_cookie_pid() should return access denied: " << ret);
}
//privileges drop and added smack rule
}
//privileges drop and added smack rule
Cookie cookie = getCookieFromSS();
int ret = security_server_check_privilege(cookie.data(), DB_ALARM_GID);
Cookie cookie = getCookieFromSS();
int ret = security_server_check_privilege(cookie.data(), DB_ALARM_GID);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_check_privilege should return access denied, "
+ "ret: " << ret);
ret = security_server_get_gid(ROOT_USER);
ret = security_server_get_gid(ROOT_USER);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_get_gid should return access denied, "
+ "ret: " << ret);
ret = security_server_get_cookie_pid(cookie.data());
ret = security_server_get_cookie_pid(cookie.data());
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_get_cookie_pid should return access denied, "
+ "ret: " << ret);
UniquePtrCstring ss_label(security_server_get_smacklabel_cookie(cookie.data()), free);
UniquePtrCstring ss_label(security_server_get_smacklabel_cookie(cookie.data()), free);
- RUNNER_ASSERT_MSG_BT(ss_label.get() == NULL, "ss_label: " << ss_label.get());
+ RUNNER_ASSERT_MSG_BT(ss_label.get() == NULL,
+ "access should be denied so label should be NULL: " << ss_label.get());
ret = security_server_check_privilege_by_pid(getpid(), "_", "rx");
ret = security_server_check_privilege_by_pid(getpid(), "_", "rx");
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_check_privilege_by_pid should return access denied, "
+ "ret: " << ret);
}
// NOSMACK version of the test above
}
// NOSMACK version of the test above
RUNNER_ASSERT_MSG_BT(drop_root_privileges() == 0, "uid = " << getuid());
RUNNER_ASSERT_MSG_BT(drop_root_privileges() == 0, "uid = " << getuid());
- RUNNER_ASSERT_BT(SECURITY_SERVER_API_ERROR_ACCESS_DENIED == security_server_app_give_access(subject, getpid()));
+ RUNNER_ASSERT_BT(SECURITY_SERVER_API_ERROR_ACCESS_DENIED ==
+ security_server_app_give_access(subject, getpid()));
RUNNER_ASSERT_BT(0 == smack_have_access(subject, object, "r"));
}
RUNNER_ASSERT_BT(0 == smack_have_access(subject, object, "r"));
}
*/
ret = security_server_set_pwd_validity(10);
*/
ret = security_server_set_pwd_validity(10);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_set_pwd_validity should return access denied,"
+ " ret: " << ret);
ret = security_server_set_pwd_max_challenge(5);
ret = security_server_set_pwd_max_challenge(5);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_set_pwd_max_challenge should return access denied,"
+ " ret: " << ret);
ret = security_server_is_pwd_valid(&attempt, &max_attempt, &expire_sec);
ret = security_server_is_pwd_valid(&attempt, &max_attempt, &expire_sec);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_is_pwd_valid should return access denied,"
+ " ret: " << ret);
usleep(PASSWORD_RETRY_TIMEOUT_US);
ret = security_server_set_pwd("12345", "12346", 0, 0);
usleep(PASSWORD_RETRY_TIMEOUT_US);
ret = security_server_set_pwd("12345", "12346", 0, 0);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_set_pwd should return access denied,"
+ " ret: " << ret);
ret = security_server_reset_pwd("12346",0, 0);
ret = security_server_reset_pwd("12346",0, 0);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
-
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_reset_pwd should return access denied,"
+ " ret: " << ret);
usleep(PASSWORD_RETRY_TIMEOUT_US);
ret = security_server_chk_pwd("12346", &attempt, &max_attempt, &expire_sec);
usleep(PASSWORD_RETRY_TIMEOUT_US);
ret = security_server_chk_pwd("12346", &attempt, &max_attempt, &expire_sec);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_chk_pwd should return access denied,"
+ " ret: " << ret);
ret = security_server_set_pwd_history(10);
ret = security_server_set_pwd_history(10);
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_set_pwd_history should return access denied,"
+ " ret: " << ret);
}
RUNNER_CHILD_TEST_SMACK(tc07_check_API_data_share_allow)
}
RUNNER_CHILD_TEST_SMACK(tc07_check_API_data_share_allow)
provider.applyAndSwithToUser(APP_UID, APP_GID);
int ret = security_server_app_give_access(TEST08_SUBJECT, getpid());
provider.applyAndSwithToUser(APP_UID, APP_GID);
int ret = security_server_app_give_access(TEST08_SUBJECT, getpid());
- RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED, "ret: " << ret);
+ RUNNER_ASSERT_MSG_BT(ret == SECURITY_SERVER_API_ERROR_ACCESS_DENIED,
+ "security_server_app_give_access should return access denied,"
+ " ret: " << ret);
}
//////////////////////////////////////////
}
//////////////////////////////////////////