From: Clark Boylan Date: Wed, 12 Apr 2017 22:46:31 +0000 (-0700) Subject: Fix libvirt group selection in live migration test X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fbab83e573f2bc77af81e5f0be3b2ce92046de08;p=osstest%2Fopenstack-nova.git Fix libvirt group selection in live migration test The custom start scripting for the nova compute service assumed that the libvirt group is "libvirtd". Unforately libvirtd is no longer used by debuntu as they use "libvirt". Add a simple check against /etc/group for an existing libvirtd user otherwise use libvirt. Change-Id: Idbda49587f3b62a0870d10817291205bde0e821e Depends-On: If2dbc53d082fea779448998ea12b821bd037a14e (cherry picked from commit ea8463679c1c25b496ffca1be6bd9bd026c29225) --- diff --git a/nova/tests/live_migration/hooks/ceph.sh b/nova/tests/live_migration/hooks/ceph.sh index 579916236a..6d59eb1384 100755 --- a/nova/tests/live_migration/hooks/ceph.sh +++ b/nova/tests/live_migration/hooks/ceph.sh @@ -115,12 +115,18 @@ function configure_and_start_nova { echo 'check processes after compute stop' $ANSIBLE all --sudo -f 5 -i "$WORKSPACE/inventory" -m shell -a "ps aux | grep compute" + # Determine what the libvirt is. If there is a group called "libvirtd" + # in /etc/groups use that, otherwise default to "libvirt". + # Note, new ubuntu and debian use libvirt, everything else is libvirtd. + local libvirt_group + libvirt_group=$(cut -d ':' -f 1 /etc/group | grep 'libvirtd$' || true) + libvirt_group=${libvirt_group:-libvirt} # restart local nova-compute - sudo -H -u $STACK_USER bash -c "/tmp/start_process.sh n-cpu '/usr/local/bin/nova-compute --config-file /etc/nova/nova.conf' libvirtd" + sudo -H -u $STACK_USER bash -c "/tmp/start_process.sh n-cpu '/usr/local/bin/nova-compute --config-file /etc/nova/nova.conf' $libvirt_group" # restart remote nova-compute for SUBNODE in $SUBNODES ; do - ssh $SUBNODE "sudo -H -u $STACK_USER bash -c '/tmp/start_process.sh n-cpu \"/usr/local/bin/nova-compute --config-file /etc/nova/nova.conf\" libvirtd'" + ssh $SUBNODE "sudo -H -u $STACK_USER bash -c '/tmp/start_process.sh n-cpu \"/usr/local/bin/nova-compute --config-file /etc/nova/nova.conf\" $libvirt_group'" done $ANSIBLE all --sudo -f 5 -i "$WORKSPACE/inventory" -m shell -a "ps aux | grep compute"