Server automation using pexpect