2014-08-31 13:45:35 +02:00
|
|
|
import tools
|
2014-11-25 22:45:03 +01:00
|
|
|
from manifests import partials
|
2014-11-30 14:09:21 +01:00
|
|
|
from bootstrapvz.base.manifest import Manifest
|
2014-08-31 13:45:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_virtualbox_unpartitioned_extlinux():
|
2014-11-25 22:45:03 +01:00
|
|
|
import yaml
|
2014-11-30 14:09:21 +01:00
|
|
|
manifest_data = yaml.load("""
|
2014-11-25 22:45:03 +01:00
|
|
|
provider:
|
|
|
|
name: virtualbox
|
|
|
|
system:
|
|
|
|
bootloader: extlinux
|
|
|
|
volume:
|
|
|
|
backing: vdi
|
|
|
|
partitions:
|
|
|
|
type: msdos
|
2014-11-30 00:33:42 +01:00
|
|
|
""")
|
2014-11-30 14:09:21 +01:00
|
|
|
manifest_data = tools.merge_dicts(partials['base'], partials['stable64'],
|
|
|
|
partials['unpartitioned'], manifest_data)
|
2014-08-31 13:45:35 +02:00
|
|
|
|
2014-11-30 15:42:38 +01:00
|
|
|
manifest = Manifest(data=manifest_data)
|
|
|
|
build_server = tools.pick_build_server(manifest)
|
2014-11-30 14:09:21 +01:00
|
|
|
manifest_data['provider']['guest_additions'] = build_server.build_settings['guest_additions']
|
|
|
|
manifest = Manifest(data=manifest_data)
|
2014-08-31 13:45:35 +02:00
|
|
|
|
2014-11-30 00:33:42 +01:00
|
|
|
bootstrap_info = tools.bootstrap(manifest, build_server)
|
2014-08-31 13:45:35 +02:00
|
|
|
|
2014-11-30 00:33:42 +01:00
|
|
|
if isinstance(build_server, tools.build_servers.LocalBuildServer):
|
|
|
|
image_path = bootstrap_info.volume.image_path
|
|
|
|
else:
|
|
|
|
import tempfile
|
|
|
|
handle, image_path = tempfile.mkstemp()
|
|
|
|
handle.close()
|
|
|
|
build_server.download(bootstrap_info.volume.image_path, image_path)
|
|
|
|
build_server.delete(bootstrap_info.volume.image_path)
|
|
|
|
|
|
|
|
try:
|
|
|
|
image = tools.images.VirtualBoxImage(manifest, image_path)
|
|
|
|
|
|
|
|
instance = tools.instances.VirtualBoxInstance(image)
|
|
|
|
instance.create()
|
|
|
|
instance.boot()
|
|
|
|
|
|
|
|
tools.test(instance)
|
|
|
|
finally:
|
|
|
|
if 'instance' in locals():
|
|
|
|
instance.destroy()
|
|
|
|
if 'image' in locals():
|
|
|
|
image.destroy()
|