From 92575baa6b010ec09fea3e715030da8be61c0c64 Mon Sep 17 00:00:00 2001
From: Matt Riedemann <mriedem@us.ibm.com>
Date: Wed, 21 Sep 2016 16:15:31 -0400
Subject: [PATCH] tempest: configure compute-feature-enabled.swap_volume if
 libvirt

The only virt driver in nova that supports the swap volume API is
libvirt so enable testing that in Tempest only if using libvirt.

Depends on two changes:

1. The Tempest change that adds the new config option and test.

Depends-On: I2d4779de8d21aa84533f4f92d347e932db2de58e

2. A nova fix for correctly waiting for the block copy job in the guest
   to complete.

Depends-On: I0c52917a5555a70c4973f37dea1aebf878dd73b4

Change-Id: Ibb6b309574d2c6a06fcecb0626ea21527fb7f412
---
 lib/tempest | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/tempest b/lib/tempest
index aa3877b4ab..2f2721311e 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -508,13 +508,17 @@ function configure_tempest {
         iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
     fi
 
-    # Libvirt-LXC
-    if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
-        iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
-        iniset $TEMPEST_CONFIG compute-feature-enabled resize False
-        iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
-        iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
-        iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
+    # Libvirt
+    if [ "$VIRT_DRIVER" = "libvirt" ]; then
+        # Libvirt-LXC
+        if [ "$LIBVIRT_TYPE" = "lxc" ]; then
+            iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
+            iniset $TEMPEST_CONFIG compute-feature-enabled resize False
+            iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
+            iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
+            iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
+        fi
+        iniset $TEMPEST_CONFIG compute-feature-enabled swap_volume True
     fi
 
     # ``service_available``