add test class
This commit adds a class for testing that creates a volume on a loopback device.
This commit is contained in:
parent
630cdb7aa4
commit
e67394639e
28
manifests/setup_test_volume.pp
Normal file
28
manifests/setup_test_volume.pp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
class cinder::setup_test_volume(
|
||||||
|
$volume_name = 'cinder-volumes',
|
||||||
|
$size = '4G',
|
||||||
|
$loopback_device = '/dev/loop2'
|
||||||
|
) {
|
||||||
|
|
||||||
|
Exec {
|
||||||
|
cwd => '/tmp/',
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "/bin/dd if=/dev/zero of=${volume_name} bs=1 count=0 seek=${size}":
|
||||||
|
unless => "/sbin/vgdisplay ${volume_name}"
|
||||||
|
} ~>
|
||||||
|
|
||||||
|
exec { "/sbin/losetup ${loopback_device} ${volume_name}":
|
||||||
|
refreshonly => true,
|
||||||
|
} ~>
|
||||||
|
|
||||||
|
exec { "/sbin/pvcreate ${loopback_device}":
|
||||||
|
refreshonly => true,
|
||||||
|
} ~>
|
||||||
|
|
||||||
|
exec { "/sbin/vgcreate ${volume_name} ${loopback_device}":
|
||||||
|
refreshonly => true,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user