Commit 7ebadeb3 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

Always distribute ganeti.utils.io_unittest-runasroot.py



Tests that depend on fakeroot were not distributed in the tarball created
by "make dist" when fakeroot was missing. Now all tests are distributed,
and a warning is printed when a test requires fakeroot but fakeroot is
missing.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent a6d3644b
......@@ -927,6 +927,7 @@ python_tests = \
test/ganeti.utils.filelock_unittest.py \
test/ganeti.utils.hash_unittest.py \
test/ganeti.utils.io_unittest.py \
test/ganeti.utils.io_unittest-runasroot.py \
test/ganeti.utils.log_unittest.py \
test/ganeti.utils.mlock_unittest.py \
test/ganeti.utils.nodesetup_unittest.py \
......@@ -943,9 +944,6 @@ python_tests = \
test/docs_unittest.py \
test/pycurl_reset_unittest.py \
test/tempfile_fork_unittest.py
if HAS_FAKEROOT
python_tests += test/ganeti.utils.io_unittest-runasroot.py
endif
haskell_tests = htest/test
......
......@@ -37,8 +37,8 @@ $COVERAGE erase
for script; do
if [[ "$script" == *-runasroot.py ]]; then
if [[ -z "$FAKEROOT" ]]; then
echo "FAKEROOT variable not set and needed for $script" >&2
exit 1
echo "WARNING: FAKEROOT variable not set: skipping $script" >&2
continue
fi
cmdprefix="$FAKEROOT"
else
......
......@@ -23,16 +23,18 @@ set -e
filename=$1
execasroot() {
local fname=$1
shift
if [[ -z "$FAKEROOT" ]]; then
echo "FAKEROOT variable not set" >&2
exit 1
echo "WARNING: FAKEROOT variable not set, skipping $fname" >&2
else
exec "$FAKEROOT" "$@"
fi
exec "$FAKEROOT" "$@"
}
case "$filename" in
*-runasroot.py) execasroot $PYTHON "$@" ;;
*-runasroot.py) execasroot $filename $PYTHON "$@" ;;
*.py) exec $PYTHON "$@" ;;
*-runasroot) execasroot "$@" ;;
*-runasroot) execasroot $filename "$@" ;;
*) exec "$@" ;;
esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment