summaryrefslogtreecommitdiffstats
path: root/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake')
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 34b9c82..0c5cca8 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -304,6 +304,30 @@ if(CPackGen MATCHES "RPM")
message(FATAL_ERROR "error: '${check_file}' rpm package content does not match expected value - regex '${check_content_list}'; RPM output: '${check_package_content}'; generated spec file: '${spec_file_content}'")
endif()
+
+ # validate permissions user and group
+ execute_process(COMMAND ${RPM_EXECUTABLE} -pqlv ${check_file}
+ OUTPUT_VARIABLE check_file_content
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(check_file_libraries_match)
+ set(check_file_match_expected_permissions ".*-rwx------.*user.*defgrp.*")
+ elseif(check_file_headers_match)
+ set(check_file_match_expected_permissions ".*-rwxr--r--.*defusr.*defgrp.*")
+ elseif(check_file_applications_match)
+ set(check_file_match_expected_permissions ".*-rwxr--r--.*defusr.*group.*")
+ elseif(check_file_Unspecified_match)
+ set(check_file_match_expected_permissions ".*-rwxr--r--.*defusr.*defgrp.*")
+ else()
+ message(FATAL_ERROR "error: unexpected rpm package '${check_file}'")
+ endif()
+
+ string(REGEX MATCH "${check_file_match_expected_permissions}" check_file_match_permissions "${check_file_content}")
+
+ if(NOT check_file_match_permissions)
+ message(FATAL_ERROR "error: '${check_file}' rpm package permissions do not match expected value - regex '${check_file_match_expected_permissions}'")
+ endif()
endforeach()
#######################