summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-14 00:41:10 +0000
committerGerrit Code Review <review@openstack.org>2012-11-14 00:41:10 +0000
commitaa2bb87a5e28cb19a0e9244807daacb16f59ce03 (patch)
treeef3da171c439e0a8231055bca2e022b315a1cc6f
parentb45ca52108a0b64f18885abb3c42cd4a2ff89ee8 (diff)
parent6443cfeecb9f7f9ac4ab84de27e2e0c4decf71d6 (diff)
downloadnova-aa2bb87a5e28cb19a0e9244807daacb16f59ce03.tar.gz
nova-aa2bb87a5e28cb19a0e9244807daacb16f59ce03.tar.xz
nova-aa2bb87a5e28cb19a0e9244807daacb16f59ce03.zip
Merge "Update vol mount smoketest to wait for volume."
-rw-r--r--smoketests/test_sysadmin.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/smoketests/test_sysadmin.py b/smoketests/test_sysadmin.py
index d6491c9d4..b05f0ac4b 100644
--- a/smoketests/test_sysadmin.py
+++ b/smoketests/test_sysadmin.py
@@ -249,12 +249,24 @@ class VolumeTests(base.UserSmokeTestCase):
self.assertTrue(volume.status.startswith('in-use'))
- # Give instance time to recognize volume.
- time.sleep(5)
-
def test_003_can_mount_volume(self):
ip = self.data['instance'].private_ip_address
conn = self.connect_ssh(ip, TEST_KEY)
+
+ # NOTE(dprince): give some time for volume to show up in partitions
+ stdin, stdout, stderr = conn.exec_command(
+ 'COUNT="0";'
+ 'until cat /proc/partitions | grep "%s\\$"; do '
+ '[ "$COUNT" -eq "60" ] && exit 1;'
+ 'COUNT=$(( $COUNT + 1 ));'
+ 'sleep 1; '
+ 'done'
+ % self.device.rpartition('/')[2])
+ out = stdout.read()
+ if not out.strip().endswith(self.device.rpartition('/')[2]):
+ self.fail('Timeout waiting for volume partition in instance. %s %s'
+ % (out, stderr.read()))
+
# NOTE(vish): this will create a dev for images that don't have
# udev rules
stdin, stdout, stderr = conn.exec_command(