cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}-test
cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}-test.BSL-1.0
-
mkdir -p %{buildroot}%{rw_db_dir}
mkdir -p %{buildroot}%{ro_db_dir}
cp data/scripts/*.sql %{buildroot}%{ro_db_dir}
%postun -n lib%{name}-common -p %{sbin_dir}/ldconfig
%postun -n lib%{name}-client -p %{sbin_dir}/ldconfig
+%post -n %{name}-test
+chsmack -a "_" %{test_dir}/test_dir/dir1
+
%files
%defattr(-,root,root,-)
%manifest %{service_name}.manifest
else if (e.error() == CSR_ERROR_FILE_SYSTEM)
WARN("File type is changed, considered as different file: " <<
d.targetName);
+ else if (e.error() == CSR_ERROR_REMOVE_FAILED)
+ return BinaryQueue::Serialize(CSR_ERROR_REMOVE_FAILED, d).pop();
else
throw;
}
--- /dev/null
+X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
EXCEPTION_GUARD_END
}
+// TODO: below test case needs response from UI. It'll be turned on as default after
+// write code of popup service stub
+#if 0
+BOOST_AUTO_TEST_CASE(remove_failed_returns_detected_handle)
+{
+ EXCEPTION_GUARD_START
+
+ auto start_time = ::time(nullptr);
+
+ auto c = Test::Context<csr_cs_context_h>();
+ auto context = c.get();
+
+ csr_cs_malware_h malware = nullptr;
+
+ ASSERT_SUCCESS(csr_cs_set_ask_user(context, CSR_CS_ASK_USER_YES));
+ ASSERT_IF(csr_cs_scan_file(context, TEST_FILE_UNREMOVABLE, &malware), CSR_ERROR_REMOVE_FAILED);
+ CHECK_IS_NOT_NULL(malware);
+ ASSERT_DETECTED(malware, MALWARE_HIGH_NAME, MALWARE_HIGH_SEVERITY,
+ MALWARE_HIGH_DETAILED_URL);
+ ASSERT_DETECTED_EXT(malware, start_time, TEST_FILE_UNREMOVABLE, false, "");
+
+ EXCEPTION_GUARD_END
+}
+#endif
+
BOOST_AUTO_TEST_SUITE_END()
#define TEST_FILE_TMP_IN_DIR_MALWARES TEST_DIR_MALWARES "/tmp_malware_file"
#define TEST_FILE_TMP TEST_DIR_TMP "/test_malware_file"
#define TEST_FILE_NO_EXIST TEST_DIR_TMP "/not_existing_file"
+#define TEST_FILE_UNREMOVABLE TEST_DIR_MALWARES "/dir1/unremovable_file"
#define TEST_WGT_PKG_ID "hFhcNcbE6K"
#define TEST_WGT_TYPE "wgt"