tests/util: Rewrite the scripts in Python