Reorganize tests

* Split out test helper functions into tools/test_functions.sh
  * bin/_blackbox_common_test.sh: Unit-tests for functions.
  * blackbox_postdeploy: Use cp_permissions instead of chmod --reference
This commit is contained in:
tlimoncelli@stackexchange.com
2015-07-24 09:01:00 -04:00
parent 8956be47a3
commit aee22fc99d
5 changed files with 180 additions and 109 deletions

View File

@@ -380,6 +380,23 @@ function md5sum_file() {
esac
}
function cp_permissions() {
# Copy the perms of $1 onto $2 .. end.
case $(uname -s) in
Darwin )
chmod $( stat -f '%p' "$1" ) "${@:2}"
;;
Linux | CYGWIN* )
chmod --reference "$1" "${@:2}"
;;
* )
echo 'ERROR: Unknown OS. Exiting.'
exit 1
;;
esac
}
#
# Abstract the difference between git and hg:
#