Move system-tests to main .spec 14/225814/4
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Mon, 24 Feb 2020 14:44:54 +0000 (15:44 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 27 Feb 2020 17:10:34 +0000 (18:10 +0100)
Change-Id: I675555baab83ce3051401757054bde3cf4317271

CMakeLists.txt
packaging/crash-worker.manifest
packaging/crash-worker.spec
packaging/crash-worker_system-tests.manifest [deleted file]
packaging/crash-worker_system-tests.spec [deleted file]
tests/CMakeLists.txt
tests/system/CMakeLists.txt
tests/system/so_info_file/so_info_file.sh.template
tests/system/utils/CMakeLists.txt

index cf0df7b..e7579d2 100644 (file)
@@ -7,7 +7,7 @@ ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1)
 
 # 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)
index 25bee3e..1ed60c3 100644 (file)
@@ -5,5 +5,25 @@
        <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>
index 65afbef..07c2027 100644 (file)
@@ -82,6 +82,19 @@ Summary:        Livedumper allows to dump core of live process
 %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
 
@@ -130,7 +143,8 @@ export CFLAGS+=" -Werror"
           -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} \
@@ -138,6 +152,7 @@ export CFLAGS+=" -Werror"
           -DVERSION=%{version}
 
 make %{?jobs:-j%jobs}
+
 %if %{with doc}
 make doc
 %endif
@@ -206,15 +221,15 @@ mkdir -p %{buildroot}%{crash_temp}
 %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
 
@@ -223,3 +238,39 @@ mkdir -p %{buildroot}%{crash_temp}
 %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
diff --git a/packaging/crash-worker_system-tests.manifest b/packaging/crash-worker_system-tests.manifest
deleted file mode 100644 (file)
index 83fdab3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<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>
diff --git a/packaging/crash-worker_system-tests.spec b/packaging/crash-worker_system-tests.spec
deleted file mode 100644 (file)
index 8e1061e..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-%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/
-
index 6c4d658..2c5baf5 100644 (file)
@@ -1,5 +1,7 @@
 cmake_minimum_required(VERSION 2.8.12)
 
+add_subdirectory(system)
+
 # tests
 INCLUDE(FindPkgConfig)
 
index 90c698e..eace3ef 100644 (file)
@@ -4,7 +4,8 @@ ADD_SUBDIRECTORY(utils)
 
 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)
@@ -39,4 +40,5 @@ configure_test("libcrash-service")
 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)
index d8437ac..23cd7d9 100644 (file)
@@ -35,7 +35,7 @@ popd
 
 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]+"
index 5bd6710..0d2bbe4 100644 (file)
@@ -12,11 +12,10 @@ add_executable(libcrash-servicetest libcrash-servicetest.c)
 
 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)