X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcommon%2Ftests_common.cpp;fp=src%2Fcommon%2Ftests_common.cpp;h=d08893ca3cfbc06a2c763091055b1557326abeb0;hb=55859d0ed339ac30ae14780b1d1940bcea986834;hp=e34f40183a6feff8066c750420cdc28b74d4c916;hpb=ff54c892d3d4f4facffebaa6fdb5cdc569ba0ade;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git diff --git a/src/common/tests_common.cpp b/src/common/tests_common.cpp index e34f401..d08893c 100644 --- a/src/common/tests_common.cpp +++ b/src/common/tests_common.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -231,10 +232,17 @@ void removeDir(const std::string &path) RUNNER_ASSERT_ERRNO_MSG(0 == rmdir(path.c_str()), "rmdir for <" << path << "> failed"); } +void waitPid(pid_t pid) +{ + int status; + pid_t ret = waitpid(pid, &status, 0); + RUNNER_ASSERT_MSG((ret != -1) && WIFEXITED(status) && WEXITSTATUS(status) == 0, + "Child process exited abnormally" << + ": ret=" << ret << ", errno=" << errno << ", status=" << status); +} // changes process label void change_label(const char* label) { int ret = smack_set_label_for_self(label); RUNNER_ASSERT_MSG(0 == ret, "Error in smack_set_label_for_self("<