Switch from pexpect to subprocess for agent testing.