Since the test suite isn't run as root apk3 needs the --usermode flag for db creating commands.
--usermode