From 5e6e219e91f24979e4d2ffe391b16479038e2a78 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 14 Jul 2022 14:51:24 +0900 Subject: [PATCH] Fix run-unittest.sh script For code coverage measurement, the permission of directories and files should be changed for applications. The script sets the smack label as "System::Run" to files. Change-Id: I7c405e0fc8e6548298e3addffcdaeaa2b6a460a0 Signed-off-by: Hwankyu Jhun --- packaging/rpc-port.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packaging/rpc-port.spec b/packaging/rpc-port.spec index e2a6bac..399cc91 100644 --- a/packaging/rpc-port.spec +++ b/packaging/rpc-port.spec @@ -105,17 +105,31 @@ find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';' cat << EOF > run-unittest.sh #!/bin/sh +GCOV_PATH="/tmp/home/abuild/rpmbuild/BUILD" +PAKCAGE="%{name}-%{version}" + +set_perm() { + ## Sets the permission for applications + /usr/bin/find /tmp/home/ -print | /usr/bin/xargs -n1 /usr/bin/chsmack -a "System::Run" &> /dev/null + /usr/bin/find /tmp/home/ -print | /usr/bin/xargs -n1 /usr/bin/chsmack -a "System::Run" -t &> /dev/null + /usr/bin/chmod -R 777 /tmp/home/ +} + setup() { echo "setup start" + /usr/bin/mkdir -p "${GCOV_PATH}/${PACKAGE}" + set_perm } test_main() { echo "test_main start" + export "GCOV_PREFIX=/tmp" /usr/bin/rpc-port_unittests } teardown() { echo "teardown start" + set_perm } main() { -- 2.7.4