]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
Fix libvirt group selection in live migration test
authorClark Boylan <clark.boylan@gmail.com>
Wed, 12 Apr 2017 22:46:31 +0000 (15:46 -0700)
committerMatt Riedemann <mriedem.os@gmail.com>
Fri, 21 Apr 2017 13:28:18 +0000 (13:28 +0000)
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)

nova/tests/live_migration/hooks/ceph.sh

index 579916236a7ec316eeb38d6289d4cd66e769e7cd..6d59eb1384668b77095576000936c4e5822e7543 100755 (executable)
@@ -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"