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 ea8463679c)
This commit is contained in:
Clark Boylan 2017-04-12 15:46:31 -07:00 committed by Matt Riedemann
parent c9620d57c8
commit fbab83e573
1 changed files with 8 additions and 2 deletions

View File

@ -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"