Files
blackbox/bin/_blackbox_common_test.sh
tlimoncelli@stackexchange.com 5ae47a69ea Clean up after cp_permission test
2015-07-24 13:13:51 +00:00

26 lines
607 B
Bash
Executable File

#!/usr/bin/env bash
#
# _blackbox_common_test.sh -- Unit tests of functions from _blackbox_common.sh
#
set -e
. "${0%/*}/_blackbox_common.sh"
. tools/test_functions.sh
PHASE 'Test cp-permissions: TestA'
touch TestA TestB TestC TestD
chmod 0347 TestA
chmod 0700 TestB
chmod 0070 TestC
chmod 0070 TestD
cp_permissions TestA TestB TestC
# NOTE: cp_permissions is not touching TestD.
assert_file_perm '--wxr--rwx' TestA
assert_file_perm '--wxr--rwx' TestB
assert_file_perm '--wxr--rwx' TestC
assert_file_perm '----rwx---' TestD # TestD doesn't change.
rm -f TestA TestB TestC TestD
echo '========== DONE.'