def create_memory_dump_for(p, support_path): # procdump -ma 4572 dump_file.dmp #-accepteula -ma command = "{procdump} -accepteula -ma {pid} {folder}/{name}_{pid}.dmp".format(procdump = PROC_DUMP_PATH, pid = p.pid, folder=support_path, name = p.name()) print command try: exec_command(command) except ItBaseException as exc: pass
def simulate_ipaddress_change2(): # netsh interface ip set address name=VMnet1 static 172.16.0.22 ipaddress = "172.16.0.%s" % randint(1, 254) exec_command("netsh interface ip set address name=%s static %s" % (IP_ADDRESS_CHANGE_NIC_NAME, ipaddress)) return ipaddress
def simulate_ipaddress_change(): # wmic path win32_networkadapter where index=14 call enable NIC_ID = IP_ADDRESS_CHANGE_NIC_ID exec_command("wmic path win32_networkadapter where index=%s call disable" % NIC_ID) time.sleep(5); exec_command("wmic path win32_networkadapter where index=%s call enable" % NIC_ID)