Skip to content

Commit 437606c

Browse files
authored
migration: Fix nfs service issue (autotest#6383)
Update case to make sure the NFS service is started. Signed-off-by: lcheng <lcheng@redhat.com>
1 parent 0aa603c commit 437606c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

libvirt/tests/src/migration/migration_misc/migration_with_special_cpu.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,23 @@ def prepare_env_in_vm(vm, vm_hostname, mount_src, mount_dir, desturi_port):
9696
vm_session.close()
9797

9898

99-
def prepare_nfs_server_in_vm(vm_ip, params):
99+
def prepare_nfs_server_in_vm(vm_ip, vm, params):
100100
"""
101101
Prepare nfs server in vm
102102
103103
:param vm_ip: VM ip
104+
:param vm: VM object
104105
:param params: Dictionary with the test parameters
105106
"""
106107
server_user = params.get("server_user", "root")
107108
server_pwd = params.get("server_pwd")
108109
mount_src = params.get("nfs_mount_src")
109110
mount_dir = params.get("nfs_mount_dir")
110111

112+
vm_session = vm.wait_for_login()
113+
vm_session.cmd("systemctl restart nfs-server; systemctl restart rpcbind")
114+
vm_session.close()
115+
111116
# prepare nfs server in vm
112117
nfs_server_params = {
113118
"nfs_setup": True,
@@ -164,7 +169,7 @@ def prepare_single_vm(vm, vm_xml, vm_hostname, test):
164169
ssh_key.setup_remote_ssh_key(vm2_ip, client_user, client_pwd, vm1_ip, server_user, server_pwd, port=22)
165170

166171
test.log.debug("Prepare nfs server in %s.", vm1_ip)
167-
prepare_nfs_server_in_vm(vm1_ip, params)
172+
prepare_nfs_server_in_vm(vm1_ip, vm1, params)
168173

169174
hosts_dict = {"%s" % vm1_hostname: "%s" % vm1_ip, "%s" % vm2_hostname: "%s" % vm2_ip}
170175
mount_src = vm1_ip + ":" + mount_src

0 commit comments

Comments
 (0)