it may be better for test purposes to monkey-patch mktemp()
kind of inelegant but does work without modifying the non-root tests themselves