This commit is contained in:
Dan OBoyle
2015-07-03 11:40:49 -04:00
2 changed files with 15 additions and 6 deletions

View File

@@ -66,7 +66,7 @@ Mercurial, suddenly we are less able to share our code with other
people. Communication between subteams of an organization is hurt. people. Communication between subteams of an organization is hurt.
You can't collaborate as well. Either you find yourself emailing You can't collaborate as well. Either you find yourself emailing
individual files around (yuck!), making a special repo with just individual files around (yuck!), making a special repo with just
the files needed by your collaborators (yuck!), or just deciding that the files needed by your collaborators (yuck!!), or just deciding that
collaboration isn't worth all that effort (yuck!!!). collaboration isn't worth all that effort (yuck!!!).
The ability to be open and transparent about our code, with the The ability to be open and transparent about our code, with the

View File

@@ -64,17 +64,26 @@ function assert_file_md5hash() {
function assert_file_group() { function assert_file_group() {
local file="$1" local file="$1"
local wanted="$2" local wanted="$2"
local found
assert_file_exists "$file" assert_file_exists "$file"
case $(uname -s) in case $(uname -s) in
Darwin|FreeBSD )
found=$(stat -f '%Sg' $file)
;;
Linux )
found=$(stat -c '%G' $file)
;;
CYGWIN* ) CYGWIN* )
echo "ASSERT_FILE_GROUP: Running on Cygwin. Not being tested." echo "ASSERT_FILE_GROUP: Running on Cygwin. Not being tested."
return 0 return 0
;; ;;
* )
echo 'ERROR: Unknown OS. Exiting.'
exit 1
;;
esac esac
local found=$(ls -lg "$file" | awk '{ print $3 }')
# NB(tlim): We could do this with 'stat' but it would break on BSD-style OSs.
if [[ "$wanted" != "$found" ]]; then if [[ "$wanted" != "$found" ]]; then
echo "ASSERT FAILED: $file chgrp wanted=$wanted found=$found" echo "ASSERT FAILED: $file chgrp wanted=$wanted found=$found"
exit 1 exit 1
@@ -286,9 +295,9 @@ DEFAULT_GID_NAME=$(id -gn)
# Pick a group that is not the default group: # Pick a group that is not the default group:
TEST_GID_NUM=$(id -G | fmt -1 | tail -n +2 | grep -xv $(id -u) | head -n 1) TEST_GID_NUM=$(id -G | fmt -1 | tail -n +2 | grep -xv $(id -u) | head -n 1)
TEST_GID_NAME=$(python -c 'import grp; print grp.getgrgid('"$TEST_GID_NUM"').gr_name') TEST_GID_NAME=$(python -c 'import grp; print grp.getgrgid('"$TEST_GID_NUM"').gr_name')
echo DEFAULT_GID_NAME=$DEFAULT_GID_NAME echo "DEFAULT_GID_NAME=$DEFAULT_GID_NAME"
echo TEST_GID_NUM=$TEST_GID_NUM echo "TEST_GID_NUM=$TEST_GID_NUM"
echo TEST_GID_NAME=$TEST_GID_NAME echo "TEST_GID_NAME=$TEST_GID_NAME"
PHASE 'Bob postdeploys... default.' PHASE 'Bob postdeploys... default.'
blackbox_postdeploy blackbox_postdeploy