Commit 16986882 authored by Michael Pöhn's avatar Michael Pöhn

fix vbox support for stretch; fix tests

parent 00f48a8c
......@@ -283,7 +283,8 @@ def vbox_package_box(params, dry_run=False):
logging.info('(dry run) Skip packaging box file.')
def main(provider='virtualbox', debver='jessie64', verbose=False, dry_run=False):
def main(provider='virtualbox', debver='jessie64',
verbose=False, dry_run=False):
if not os.geteuid() == 0:
raise BaseboxException('This script requires super user privileges. '
......@@ -354,7 +355,7 @@ if __name__ == '__main__':
parser.add_argument('-t', '--target', default="jessie64",
help="target debian version. "
"defaults to 'jessie64'. "
"(supported: " +
"(supported: " +
', '.join(SUPPORTED_DEBVERS) + ')')
parser.add_argument('-p', '--provider', default='virtualbox',
help="target vagrant provider. "
......
<?xml version="1.0" encoding="UTF-8"?>
<ovf:Envelope ovf:version="1.0" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vbox="http://www.virtualbox.org/ovf/machine" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData">
<References>
<File ovf:href="box-disk1.vmdk" ovf:id="stretch0" ovf:size="{size_bytes}" ovf:description="F-Droid basebox"></File>
</References>
<NetworkSection>
<Info>List of networks</Info>
<Network ovf:name="NAT">
<Description>NAT network used by this VM</Description>
</Network>
</NetworkSection>
<DiskSection>
<Info>List of Virtual Disks</Info>
<Disk ovf:diskId="vmdisk0" ovf:capacity="{size_bytes}" ovf:fileRef="stretch0" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:disk-type="System" ovf:boot="True" vbox:uuid="7663ddcf-3b99-4aab-a54b-594ad29b7c9f"></Disk>
</DiskSection>
<VirtualSystem ovf:id="stretch">
<Info>debian linux x86_64</Info>
<Name>stretch</Name>
<OperatingSystemSection ovf:id="96" ovf:required="false">
<Info>The kind of operating system contained in this VM</Info>
<Description>debian</Description>
</OperatingSystemSection>
<VirtualHardwareSection>
<Info>{vm_cpu} CPU, {vm_ram} Memory</Info>
<Item>
<rasd:Caption>{vm_cpu} virtual cpu</rasd:Caption>
<rasd:Description>Number of virtual CPU</rasd:Description>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>{vm_cpu}</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
<rasd:Caption>{vm_ram} MB of memory</rasd:Caption>
<rasd:Description>Memory Size</rasd:Description>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceType>4</rasd:ResourceType>
<rasd:VirtualQuantity>{vm_ram}</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Caption>sataController0</rasd:Caption>
<rasd:Description>SATA Controller</rasd:Description>
<rasd:ElementName>sataController0</rasd:ElementName>
<rasd:InstanceID>3</rasd:InstanceID>
<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
<rasd:ResourceType>20</rasd:ResourceType>
</Item>
<Item>
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
<rasd:Caption>Ethernet adapter on 'NAT'</rasd:Caption>
<rasd:Connection>NAT</rasd:Connection>
<rasd:ElementName>Ethernet Adapter on 'NAT'</rasd:ElementName>
<rasd:InstanceID>4</rasd:InstanceID>
<rasd:ResourceSubType>E1000</rasd:ResourceSubType>
<rasd:ResourceType>10</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:ElementName>Drive 0</rasd:ElementName>
<rasd:HostResource>ovf:/disk/vmdisk0</rasd:HostResource>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</Item>
</VirtualHardwareSection>
<vbox:Machine ovf:required="false" version="1.16-linux" uuid="{{21ccb128-b9af-4f94-98b2-a28e09c9f5d1}}" name="stretch">
<ovf:Info>Extra Virtual Machine Configuration in VirtualBoxFormat</ovf:Info>
<Hardware>
<CPU count="{vm_cpu}"></CPU>
<BIOS></BIOS>
<Memory RAMSize="{vm_ram}" />
<Network>
<Adapter slot="0" enabled="true" type="82540EM">
<NAT />
</Adapter>
<Adapter slot="1" type="82540EM" />
<Adapter slot="2" type="82540EM" />
<Adapter slot="3" type="82540EM" />
<Adapter slot="4" type="82540EM" />
<Adapter slot="5" type="82540EM" />
<Adapter slot="6" type="82540EM" />
<Adapter slot="7" type="82540EM" />
</Network>
</Hardware>
<StorageControllers>
<StorageController name="SATA Controller" type="AHCI" PortCount="1">
<AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
<Image uuid="{{7663ddcf-3b99-4aab-a54b-594ad29b7c9f}}" />
</AttachedDevice>
</StorageController>
<StorageController name="Floppy Controller Controller" type="I82078" PortCount="1" />
</StorageControllers>
</vbox:Machine>
</VirtualSystem>
</ovf:Envelope>
......@@ -34,7 +34,7 @@ class MkBsBoxTest(unittest.TestCase):
with tempfile.TemporaryDirectory() as tmpdir:
path = os.path.join(tmpdir, 'script.sh')
makebuildserver_basebox.write_bootstrap_script(
path, 'theUsersName')
path, 'http://deb.debian.org/debian', 'jessie', 'theUsersName')
self.assertTrue(os.path.isfile(path))
self.assertTrue(os.access(path, os.X_OK))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment