# Sub modules
ADD_SUBDIRECTORY(include)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/crash-service)
ADD_SUBDIRECTORY(src/crash-manager)
ADD_SUBDIRECTORY(src/crash-stack)
<assign>
<filesystem path="/usr/bin/dump_systemstate" label="System" exec_label="System"/>
<filesystem path="/usr/bin/crash-manager" label="System" exec_label="System"/>
+
+ <filesystem path="/usr/lib/crash-worker/system-tests/full_core/full_core.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/check_minicore_mem/check_minicore_mem.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/check_minicore_mem/cp.sh" label="User::Shell" exec_label="System"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/cmp_backtraces/cmp_backtraces.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/cmp_backtraces/cp.sh" label="User::Shell" exec_label="System"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/critical_process/critical_process.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/time_test/time_test.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/time_test/cp.sh" label="User::Shell" exec_label="System"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/wait_for_opt_usr/wait_for_opt_usr.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/info_file/info_file.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/log_file/log_file.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/so_info_file/so_info_file.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/report_type_info/report_type_info.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/without_core/without_core.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/crash_root_path/crash_root_path.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/utils/btee" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/utils/kenny" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/lib/crash-worker/system-tests/utils/minicore-utils.sh" label="User::Shell" exec_label="User::Shell"/>
+ <filesystem path="/usr/bin/crash-worker-system-tests-run.sh" label="User::Shell" exec_label="User::Shell"/>
</assign>
</manifest>
%description livedumper
%endif
+%package system-tests
+Summary: System tests for crash-worker components
+Requires: diff
+Requires: gdb
+Requires: coreutils
+Requires: tlm
+Requires: /bin/bash
+Requires: /usr/bin/unzip
+Requires: /usr/bin/mcookie
+Requires: %{_sbindir}/minicoredumper
+Requires: %{name}-system-tests-debuginfo = %{version}-%{release}
+%description system-tests
+
%prep
%setup -q
-DCRASH_STACK_BIN_PATH=%{_libexecdir}/crash-stack \
-DCRASH_POPUP_BIN_PATH=%{_libexecdir}/crash-popup-launch \
-DCRASH_NOTIFY_BIN_PATH=%{_libexecdir}/crash-notify-send \
- -DCRASH_TESTS_PATH=%{_libdir}/crash-worker-tests \
+ -DCRASH_TESTS_PATH=%{_libdir}/crash-worker/tests \
+ -DCRASH_SYSTEM_TESTS_PATH=%{_libdir}/crash-worker/system-tests \
-DLIVEDUMPER=%{on_off livedumper} \
-DCRASH_SERVICE=%{on_off crashservice} \
-DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
-DVERSION=%{version}
make %{?jobs:-j%jobs}
+
%if %{with doc}
make doc
%endif
%files tests
%manifest %{name}.manifest
%defattr(-,root,root)
-%{_libdir}/crash-worker-tests/test1-default-crash
-%{_libdir}/crash-worker-tests/test1-default-sleep
-%{_libdir}/crash-worker-tests/test1-default-ill
-%{_libdir}/crash-worker-tests/test1-custom-crash
-%{_libdir}/crash-worker-tests/test1-custom-sleep
-%{_libdir}/crash-worker-tests/test1-custom-ill
-%{_libdir}/crash-worker-tests/run_tests.sh
-%{_libdir}/crash-worker-tests/tests_common.sh
-%{_libdir}/crash-worker-tests/crash_common.sh
+%{_libdir}/crash-worker/tests/test1-default-crash
+%{_libdir}/crash-worker/tests/test1-default-sleep
+%{_libdir}/crash-worker/tests/test1-default-ill
+%{_libdir}/crash-worker/tests/test1-custom-crash
+%{_libdir}/crash-worker/tests/test1-custom-sleep
+%{_libdir}/crash-worker/tests/test1-custom-ill
+%{_libdir}/crash-worker/tests/run_tests.sh
+%{_libdir}/crash-worker/tests/tests_common.sh
+%{_libdir}/crash-worker/tests/crash_common.sh
%endif
%manifest %{name}.manifest
%{_bindir}/livedumper
%endif
+
+%files system-tests
+%manifest %{name}.manifest
+%{_bindir}/crash-worker-system-tests-run
+
+%{_libdir}/crash-worker/system-tests/check_minicore_mem/check_minicore_mem.sh
+%{_libdir}/crash-worker/system-tests/check_minicore_mem/cp.sh
+%{_libdir}/crash-worker/system-tests/cmp_backtraces/cmp_backtraces.sh
+%{_libdir}/crash-worker/system-tests/cmp_backtraces/cp.sh
+%{_libdir}/crash-worker/system-tests/crash_root_path/crash_root_path.sh
+%{_libdir}/crash-worker/system-tests/critical_process/critical_process.sh
+%{_libdir}/crash-worker/system-tests/dbus_notify/dbus_notify.sh
+%{_libdir}/crash-worker/system-tests/dbus_notify_legacy/dbus_notify_legacy.sh
+%{_libdir}/crash-worker/system-tests/dump_systemstate_extras/dump_systemstate_extras.sh
+%{_libdir}/crash-worker/system-tests/exclude_paths/exclude_paths.sh
+%{_libdir}/crash-worker/system-tests/extra_script/extra_script.sh
+%{_libdir}/crash-worker/system-tests/full_core/full_core.sh
+%{_libdir}/crash-worker/system-tests/info_file/info_file.sh
+%{_libdir}/crash-worker/system-tests/libcrash-service/libcrash-service.sh
+%{_libdir}/crash-worker/system-tests/log_file/log_file.sh
+%{_libdir}/crash-worker/system-tests/output_param/output_param.sh
+%{_libdir}/crash-worker/system-tests/report_basic/report_basic.sh
+%{_libdir}/crash-worker/system-tests/report_type_info/report_type_info.sh
+%{_libdir}/crash-worker/system-tests/so_info_file/so_info_file.sh
+%{_libdir}/crash-worker/system-tests/time_test/cp.sh
+%{_libdir}/crash-worker/system-tests/time_test/time_test.sh
+%{_libdir}/crash-worker/system-tests/utils/btee
+%{_libdir}/crash-worker/system-tests/utils/kenny
+%{_libdir}/crash-worker/system-tests/utils/libcrash-servicetest
+%{_libdir}/crash-worker/system-tests/utils/minicore-utils.sh
+%{_libdir}/crash-worker/system-tests/wait_for_opt_usr/wait_for_opt_usr.sh
+%{_libdir}/crash-worker/system-tests/without_core/without_core.sh
+
+%if %{with livedumper}
+%{_libdir}/crash-worker/system-tests/livedumper/livedumper.sh
+%endif
+++ /dev/null
-<manifest>
- <request>
- <domain name="_"/>
- </request>
- <assign>
- <filesystem path="/usr/lib/crash-worker_system-tests/full_core/full_core.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/check_minicore_mem/check_minicore_mem.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/check_minicore_mem/cp.sh" label="User::Shell" exec_label="System"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/cmp_backtraces/cmp_backtraces.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/cmp_backtraces/cp.sh" label="User::Shell" exec_label="System"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/critical_process/critical_process.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/time_test/time_test.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/time_test/cp.sh" label="User::Shell" exec_label="System"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/wait_for_opt_usr/wait_for_opt_usr.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/info_file/info_file.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/log_file/log_file.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/so_info_file/so_info_file.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/report_type_info/report_type_info.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/without_core/without_core.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/crash_root_path/crash_root_path.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/utils/btee" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/utils/kenny" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/utils/minicore-utils.sh" label="User::Shell" exec_label="User::Shell"/>
- <filesystem path="/usr/lib/crash-worker_system-tests/run.sh" label="User::Shell" exec_label="User::Shell"/>
- </assign>
-</manifest>
+++ /dev/null
-%global __debug_package 1
-# because of this is debug package, there are source files (kenny.cpp and
-# btee.c) that will be copied to the destination directory, but we don't want
-# them in the rpm package so this flag is to avoid RPM build error:
-%define _unpackaged_files_terminate_build 0
-%define _with_livedumper on
-%bcond_with livedumper
-
-Name: crash-worker_system-tests
-Summary: Package with binaries and scripts for crash-worker system tests
-Version: 6.0.11
-Release: 1
-Group: Framework/system
-License: Apache-2.0 and BSD
-Source0: %{name}-%{version}.tar.gz
-Source1001: crash-worker_system-tests.manifest
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(rpm)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(crash-service)
-BuildRequires: cmake
-
-Requires: diff
-Requires: gdb
-Requires: coreutils
-Requires: tlm
-Requires: /bin/bash
-Requires: /usr/bin/unzip
-Requires: /usr/bin/mcookie
-Requires: crash-worker
-Requires: libcrash-service
-Requires: %{_sbindir}/minicoredumper
-
-%description
-This package contains installable tests in Bash.
-
-%prep
-%setup -q
-
-
-%build
-cp %{SOURCE1001} .
-
-export CFLAGS+=" -Werror"
-
-cd tests/system
-%cmake . -DCRASH_SYSTEM_TESTS_PATH=%{_libdir}/crash-worker_system-tests
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-cd tests/system
-%make_install
-
-%files -f debugfiles.list
-%manifest %{name}.manifest
-%defattr(0750,system_fw,system_fw)
-%{_libdir}/crash-worker_system-tests/full_core/full_core.sh
-%{_libdir}/crash-worker_system-tests/check_minicore_mem/check_minicore_mem.sh
-%{_libdir}/crash-worker_system-tests/check_minicore_mem/cp.sh
-%{_libdir}/crash-worker_system-tests/cmp_backtraces/cmp_backtraces.sh
-%{_libdir}/crash-worker_system-tests/cmp_backtraces/cp.sh
-%{_libdir}/crash-worker_system-tests/crash_root_path/crash_root_path.sh
-%{_libdir}/crash-worker_system-tests/critical_process/critical_process.sh
-%{_libdir}/crash-worker_system-tests/dbus_notify/dbus_notify.sh
-%{_libdir}/crash-worker_system-tests/dbus_notify_legacy/dbus_notify_legacy.sh
-%{_libdir}/crash-worker_system-tests/dump_systemstate_extras/dump_systemstate_extras.sh
-%{_libdir}/crash-worker_system-tests/exclude_paths/exclude_paths.sh
-%{_libdir}/crash-worker_system-tests/extra_script/extra_script.sh
-%{_libdir}/crash-worker_system-tests/info_file/info_file.sh
-%{_libdir}/crash-worker_system-tests/log_file/log_file.sh
-%{_libdir}/crash-worker_system-tests/report_basic/report_basic.sh
-%{_libdir}/crash-worker_system-tests/report_type_info/report_type_info.sh
-%{_libdir}/crash-worker_system-tests/run.sh
-%{_libdir}/crash-worker_system-tests/so_info_file/so_info_file.sh
-%{_libdir}/crash-worker_system-tests/time_test/cp.sh
-%{_libdir}/crash-worker_system-tests/time_test/time_test.sh
-%{_libdir}/crash-worker_system-tests/utils/btee
-%{_libdir}/crash-worker_system-tests/utils/kenny
-%{_libdir}/crash-worker_system-tests/utils/libcrash-servicetest
-%{_libdir}/crash-worker_system-tests/utils/minicore-utils.sh
-%{_libdir}/crash-worker_system-tests/wait_for_opt_usr/wait_for_opt_usr.sh
-%{_libdir}/crash-worker_system-tests/without_core/without_core.sh
-%{_libdir}/crash-worker_system-tests/output_param/output_param.sh
-%{_libdir}/crash-worker_system-tests/libcrash-service/libcrash-service.sh
-%if %{with livedumper}
-%{_libdir}/crash-worker_system-tests/livedumper/livedumper.sh
-%endif
-%defattr(-,root,root)
-
-# %post
-# /usr/bin/chsmack -a "_" -e "SSSystem::Privileged" -r %{_libdir}/crash-worker_system-tests/
-
cmake_minimum_required(VERSION 2.8.12)
+add_subdirectory(system)
+
# tests
INCLUDE(FindPkgConfig)
macro(CONFIGURE_TEST_FILE dir_name file_name)
configure_file("${dir_name}/${file_name}.sh.template" "${dir_name}/${file_name}.sh" @ONLY)
- INSTALL(DIRECTORY ${dir_name}/ DESTINATION ${CRASH_SYSTEM_TESTS_PATH}/${dir_name} FILES_MATCHING PATTERN "*sh")
+ INSTALL(DIRECTORY ${dir_name}/ DESTINATION ${CRASH_SYSTEM_TESTS_PATH}/${dir_name} FILES_MATCHING PATTERN "*sh"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endmacro()
macro(CONFIGURE_TEST test_name)
configure_test("full_core")
configure_file("run.sh.template" "run.sh" @ONLY)
-INSTALL(FILES run.sh DESTINATION ${CRASH_SYSTEM_TESTS_PATH})
+INSTALL(FILES "run.sh" DESTINATION bin RENAME crash-worker-system-tests-run
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
RESULT=$(cat ${CRASH_DUMP_PATH}/${REPORT_DIR}/${REPORT_DIR}.so_info)
-check "utils/kenny [a-z0-9]+ crash-worker_system-tests;[^;]+;[^;]+;[a-z0-9]+"
+check "utils/kenny [a-z0-9]+ crash-worker-system-tests;[^;]+;[^;]+;[a-z0-9]+"
check "/usr/lib/libm[^ ]+ [a-z0-9]+ glibc;[^;]+;[^;]+;[a-z0-9]+"
check "/usr/lib/libc[^ ]+ [a-z0-9]+ glibc;[^;]+;[^;]+;[a-z0-9]+"
check "/usr/lib/libgcc_s[^ ]+ [a-z0-9]+ libgcc;[^;]+;[^;]+;[a-z0-9]+"
INCLUDE(FindPkgConfig)
pkg_check_modules(helper_pkgs REQUIRED
- crash-service
gio-2.0
dlog)
-TARGET_LINK_LIBRARIES(libcrash-servicetest crash-service ${helper_pkgs_LDFLAGS})
+TARGET_LINK_LIBRARIES(libcrash-servicetest libcrash-service ${helper_pkgs_LDFLAGS})
install(TARGETS kenny DESTINATION ${CRASH_SYSTEM_TESTS_PATH}/utils)
install(TARGETS btee DESTINATION ${CRASH_SYSTEM_TESTS_PATH}/utils)