These only happen when running in rpmbuild, otherwise the tests
are fine. Of course, on RHBT the choir resoundeth “thou shalt not
run thine rpm build as root” but that’s not really an option
here.
# only if user is root, then also check gid/uid. otherwise do not check it,
# because tarfile can chown in case of being superuser only
- if hasattr(os, "geteuid") and os.geteuid() == 0:
+ #
+ # also, skip the check in rpmbuild since the sources end up with the
+ # uid:gid of the packager while the extracted files are 0:0.
+ if hasattr(os, "geteuid") and os.geteuid() == 0 \
+ and os.getenv ("RPMBUILD_OPTIONS") is None:
keys.append('gid')
keys.append('uid')