result = test_have_any_accesses(rules_wgt_platform);
RUNNER_ASSERT_MSG(result==0, "Not all permisions revoked.");
- //// File exists?
FILE *pFile = fopen(SMACK_RULES_DIR APP_ID, "rb");
- if(pFile!=NULL){
+ RUNNER_ASSERT_MSG(pFile != NULL,
+ "SMACK file removed!. Errno: " << errno);
+ //// Is it empty?
+ fseek(pFile, 0L, SEEK_END);
+ int smack_file_length = ftell(pFile);
+ RUNNER_ASSERT_MSG(smack_file_length==0,
+ "SMACK file not empty.. Errno: " << errno);
+ if (pFile != NULL)
fclose(pFile);
- RUNNER_ASSERT_MSG(false,
- "SMACK file exists after revoke!");
- }
- fd = open(SMACK_RULES_DIR WGT_APP_ID, O_RDONLY);
- RUNNER_ASSERT_MSG(fd >= 0, "SMACK file deleted after app_revoke_permissions");
- RUNNER_ASSERT_MSG(lseek(fd, 0, SEEK_END) == 0, "SMACK file not empty after app_revoke_permissions");
- close(fd);
-
- fd = open(SMACK_RULES_DIR WGT_PARTNER_APP_ID, O_RDONLY);
- RUNNER_ASSERT_MSG(fd >= 0, "SMACK file deleted after app_revoke_permissions");
- RUNNER_ASSERT_MSG(lseek(fd, 0, SEEK_END) == 0, "SMACK file not empty after app_revoke_permissions");
- close(fd);
+ pFile = fopen(SMACK_RULES_DIR WGT_APP_ID, "rb");
+ RUNNER_ASSERT_MSG(pFile != NULL,
+ "SMACK file removed!. Errno: " << errno);
+ //// Is it empty?
+ fseek(pFile, 0L, SEEK_END);
+ smack_file_length = ftell(pFile);
+ RUNNER_ASSERT_MSG(smack_file_length==0,
+ "SMACK file not empty.. Errno: " << errno);
+ if (pFile != NULL)
+ fclose(pFile);
- fd = open(SMACK_RULES_DIR WGT_PLATFORM_APP_ID, O_RDONLY);
- RUNNER_ASSERT_MSG(fd >= 0, "SMACK file deleted after app_revoke_permissions");
- RUNNER_ASSERT_MSG(lseek(fd, 0, SEEK_END) == 0, "SMACK file not empty after app_revoke_permissions");
- close(fd);
+ pFile = fopen(SMACK_RULES_DIR WGT_PARTNER_APP_ID, "rb");
+ RUNNER_ASSERT_MSG(pFile != NULL,
+ "SMACK file removed!. Errno: " << errno);
+ //// Is it empty?
+ fseek(pFile, 0L, SEEK_END);
+ smack_file_length = ftell(pFile);
+ RUNNER_ASSERT_MSG(smack_file_length==0,
+ "SMACK file not empty.. Errno: " << errno);
+ if (pFile != NULL)
+ fclose(pFile);
+ pFile = fopen(SMACK_RULES_DIR WGT_PLATFORM_APP_ID, "rb");
+ RUNNER_ASSERT_MSG(pFile != NULL,
+ "SMACK file removed!. Errno: " << errno);
+ //// Is it empty?
+ fseek(pFile, 0L, SEEK_END);
+ smack_file_length = ftell(pFile);
+ RUNNER_ASSERT_MSG(smack_file_length==0,
+ "SMACK file not empty.. Errno: " << errno);
+ if (pFile != NULL)
+ fclose(pFile);
}
static void read_gids(std::set<unsigned> &set, const char* file_path)