#!/usr/bin/env bash
. ./wvtest-bup.sh || exit $?
+. t/lib.sh || exit $?
-if [ $(t/root-status) != root ]; then
+root_status="$(t/root-status)" || exit $?
+
+if [ "$root_status" != root ]; then
echo 'Not root: skipping restore --map-* tests.'
exit 0 # FIXME: add WVSKIP.
fi
WVPASS grep -qE "^group: $other_group\$" foo-xstat
WVPASS grep -qE "^gid: $other_gid\$" foo-xstat
-has_uid_gid_0=$(WVPASS python -c "
+has_uid_gid_0=$(WVPASS bup-python -c "
import grp, pwd
try:
pwd.getpwuid(0)
grp.getgrgid(0)
- print 'yes'
-except KeyError, ex:
+ print('yes')
+except KeyError as ex:
pass
-" 2>/dev/null) || exit $?
+") || exit $?
if [ "$has_uid_gid_0" == yes ]
then
WVSTART "restore --map-user/group/uid/gid (zero uid/gid trumps all)"