t6040 test: stop using global "script" variable