def function_test_environment_prepare(self): ''' 测试私有环境准备,只在该文件中有效,在下个文件中,就无效了! ''' # 获取到image模块的公共句柄 image_ctrl = image_module(self.config_para.server_addr, self.environment.get_root_session()) image_ctrl.check_and_upload_img(self.config_para.server_addr, self.config_para.test_root_user, self.config_para.test_root_passwd, self.config_para.test_image) self.image_ctrl = image_ctrl # HC进程运行控制句柄 self.ssh_tecs_run_ctl = tecs_run_ctl(self.config_para) # 虚拟机的SSH检测句柄 self.ssh_vm_check_ctrl = ssh_vm_check(self.config_para) # 虚拟机的db检测句柄 self.db_vm_check_ctrl = tecs_vm_info_from_db(self.config_para) # 获取到虚拟机的公共句柄 self.vm_ctrl = vm_module(self.config_para.server_addr, self.environment.get_root_session()) # 配置虚拟机的基本配置 self.vm_ctrl.add_base("vm1", 1, 1, 256, image_ctrl.get_img_id(), self.environment.get_root_user_project(), self.config_para.storage_loacal_postion) self.vm_ctrl.add_disk(256, "scsi", "sda", 1, "ext4") self.vm_ctrl.add_context("test", "aaaaa")
def class_test_environment_prepare(self): # 上传映像上去,首次调用是上传 image_ctrl = image_module(self.config_para.server_addr, self.environment.get_root_session()) image_ctrl.check_and_upload_img(self.config_para.server_addr, self.config_para.test_root_user, self.config_para.test_root_passwd, self.config_para.test_image)