Fix mount of drive for test image
This commit is contained in:
Vishvananda Ishaya
committed by
andy
parent
f8f408c06a
commit
1c9c2ce227
1 changed files with 11 additions and 3 deletions
@@ -386,7 +386,7 @@ class ElasticIPTests(NovaTestCase):
data = {}
ZONE = 'nova'
DEVICE = '/dev/vdb'
DEVICE = 'vdb'
# Test iscsi volumes
class VolumeTests(NovaTestCase):
def test_000_setUp(self):
@@ -418,12 +418,20 @@ class VolumeTests(NovaTestCase):
conn.attach_volume(
volume_id = data['volume_id'],
instance_id = data['instance_id'],
device = DEVICE
device = '/dev/%s' % DEVICE
)
def test_003_me_can_mount_volume(self):
conn = self.connect_ssh(data['private_ip'], test_key)
stdin, stdout, stderr = conn.exec_command('mkdir -p /mnt/vol && mkfs.ext3 %s && mount %s /mnt/vol && echo success' % (DEVICE, DEVICE))
# HACK: the tiny image doesn't create the node properly
# this will make /dev/vd* if it doesn't exist
stdin, stdout, stderr = conn.exec_command('grep %s /proc/partitions | `awk \'{print "mknod /dev/"4ドル" b "1ドル""2ドル}\'`' % DEVICE)
commands = []
commands.append('mkdir -p /mnt/vol')
commands.append('mkfs.ext3 %s' % DEVICE)
commands.append('mount %s /mnt/vol' % DEVICE)
commands.append('echo success')
stdin, stdout, stderr = conn.exec_command(commands.join(' && '))
out = stdout.read()
conn.close()
if not out.strip().endswith('success'):
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.