FILE *file = NULL;
struct smack_accesses *rules = NULL;
+ //test environment cleaning
+ cleaning_smack_app_files();
+ cleaning_smack_database_files();
+
//test what happens when the label is not correct SMACK label
result = smack_accesses_new(&rules);
- RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in smack_accesses_new. Error: " << result);
+ RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in smack_accesses_new.");
result = add_shared_dir_readers(TEST_OBJ,app_labels_wrong);
RUNNER_ASSERT_MSG(result == PC_ERR_INVALID_PARAM, "add_shared_dir_readers should fail here");
//ok, now the correct list of apps
result = smack_accesses_new(&rules);
- RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in smack_accesses_new. Error: " << result);
+ RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in smack_accesses_new.");
for (i = 0; i < 3; i++) {
- (void)perm_app_uninstall(app_labels[i]);
+
+ result = perm_app_revoke_permissions(app_labels[i]);
+ RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in perm_app_revoke_permissions.");
+ result = perm_app_uninstall(app_labels[i]);
+ RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in perm_app_install.");
result = perm_app_install(app_labels[i]);
RUNNER_ASSERT_MSG(result == PC_OPERATION_SUCCESS, "Error in perm_app_install.");
RUNNER_ASSERT(NULL != fgets(buf, READ_BUF_SIZE, file));
result = strcmp(buf, test_string_01);
- RUNNER_ASSERT_MSG( result != 0, "add_shared_dir_readers ERROR, file not formatted" << path );
+ RUNNER_ASSERT_MSG( result != 0, "add_shared_dir_readers ERROR, file not formatted" << path);
free(path);
fclose(file);
RUNNER_ASSERT(NULL != fgets(buf, READ_BUF_SIZE, file));
result = strcmp(buf, test_string_21);
- RUNNER_ASSERT_MSG( result == 0, "add_shared_dir_readers ERROR, file not formatted" );
+ RUNNER_ASSERT_MSG( result == 0, "add_shared_dir_readers ERROR, file not formatted" << path);
RUNNER_ASSERT(NULL != fgets(buf, READ_BUF_SIZE, file));
result = strcmp(buf, test_string_22);
- RUNNER_ASSERT_MSG( result == 0, "add_shared_dir_readers ERROR, file not formatted" );
+ RUNNER_ASSERT_MSG( result == 0, "add_shared_dir_readers ERROR, file not formatted" << path);
free(path);
fclose(file);