Skip to content

Commit

Permalink
WIP: Complete failing install group perms test (TriBITSPub#314)
Browse files Browse the repository at this point in the history
How this has all of the parts needed to ensure that the group and directory
permissions are set correctly on install that matches the ATDM Trilinos case
reproted in ATDV-241.
  • Loading branch information
bartlettroscoe committed Apr 24, 2020
1 parent 7aff0e0 commit 6de9ac1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
29 changes: 17 additions & 12 deletions test/core/ExamplesUnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1377,31 +1377,36 @@ IF (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
CMND ls ARGS -ld
install_base
install_base/install
install_base/install/bin
install_base/install/include
install_base/install/lib
install_base/install/bin
install_base/install/share/WithSubpackagesC/stuff
PASS_REGULAR_EXPRESSION_ALL
"drwxrwxr-x .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install"
"drwxrwxr-x .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install"
"drwxrwxr-x .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/bin"
"drwxrwxr-x .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/include"
"drwxrwxr-x .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/lib"
"drwxrwxr-x .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/share/WithSubpackagesC/scripts"
"drwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base"
"drwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install"
"drwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/bin"
"drwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/include"
"drwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/lib"
"drwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/share/WithSubpackagesC/stuff"
ALWAYS_FAIL_ON_NONZERO_RETURN

TEST_6
MESSAGE "Check some installed file permissions"
CMND ls ARGS -l
install_base/install
install_base/install/include
install_base/install/include/wsp_c
install_base/install/lib
install_base/install/bin
install_base/install/share/WithSubpackagesC/stuff
PASS_REGULAR_EXPRESSION_ALL
"[-]rwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* hello_world.exe"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* Makefile.export.HelloWorld"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* libhello_world_lib.a"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/share/WithSubpackagesC/scripts/regular_file.txt"
"[-]rwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* install_base/install/share/WithSubpackagesC/scripts/exec_script.sh"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* MixedLang.hpp"
"[d]rwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* wsp_c"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* C.hpp"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* Makefile.export.WithSubpackagesC"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* libpws_c.a"
"[-]rwxrwxr-x.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* exec_script.sh"
"[-]rw-rw-r--.* .* ${TribitsExProj_INSTALL_OWNING_USER} ${TribitsExProj_INSTALL_OWNING_GROUP} .* regular_file.txt"
ALWAYS_FAIL_ON_NONZERO_RETURN

# ToDo: Run an installed script that must have the execute permissions!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ TRIBITS_ADD_LIBRARY(pws_c

TRIBITS_ADD_TEST_DIRECTORIES(tests)

INSTALL( DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/stuff"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${PACKAGE_NAME}"
USE_SOURCE_PERMISSIONS PATTERN "*~" EXCLUDE )
# Above, we must use 'USE_SOURCE_PERMISSIONS' to preserve the executable
# permission on the scripts in that directory. (TriBITS will add commands to
# fix the permissions after the install.)

TRIBITS_SUBPACKAGE_POSTPROCESS()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "exec_script.sh executed and returned this string"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is just a regular non-executable test file we want in the install

0 comments on commit 6de9ac1

Please sign in to comment.