Wait for server deletion if validation setup fails

Previously, if validation setup failed, the server would get deleted
and the test would immediately proceed with cleanup. This is a problem
if the server was booted with volumes. The volumes would be deleted
without waiting for the server to go away first, and this would fail
since they are still attached. This patch waits for server termination
before proceeding with cleanup.

Change-Id: I57a9c85de30855091e5443692436034a51886e63
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index 9110c4a..f583411 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -204,6 +204,19 @@
                         except Exception:
                             LOG.exception('Deleting server %s failed',
                                           server['id'])
+                    for server in servers:
+                        # NOTE(artom) If the servers were booted with volumes
+                        # and with delete_on_termination=False we need to wait
+                        # for the servers to go away before proceeding with
+                        # cleanup, otherwise we'll attempt to delete the
+                        # volumes while they're still attached to servers that
+                        # are in the process of being deleted.
+                        try:
+                            waiters.wait_for_server_termination(
+                                clients.servers_client, server['id'])
+                        except Exception:
+                            LOG.exception('Server %s failed to delete in time',
+                                          server['id'])
 
     return body, servers