test code for connect to host,create host, add host to host_list,disconnect,refactoring