velir_virtualbox 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/.yardopts +3 -0
- data/Gemfile +16 -0
- data/LICENSE +19 -0
- data/Rakefile +37 -0
- data/Readme.md +70 -0
- data/docs/GettingStarted.md +196 -0
- data/docs/WhatsNew.md +12 -0
- data/features/README.md +33 -0
- data/features/global.feature +19 -0
- data/features/global_extra_data.feature +27 -0
- data/features/step_definitions/abstract_model_steps.rb +39 -0
- data/features/step_definitions/extra_data_steps.rb +36 -0
- data/features/step_definitions/global_steps.rb +29 -0
- data/features/step_definitions/nat_engine_steps.rb +76 -0
- data/features/step_definitions/network_adapter_steps.rb +38 -0
- data/features/step_definitions/shared_folder_steps.rb +76 -0
- data/features/step_definitions/snapshot_steps.rb +74 -0
- data/features/step_definitions/storage_controller_steps.rb +16 -0
- data/features/step_definitions/virtualbox_steps.rb +17 -0
- data/features/step_definitions/vm_steps.rb +50 -0
- data/features/support/env.rb +61 -0
- data/features/support/helpers.rb +38 -0
- data/features/support/hooks.rb +30 -0
- data/features/support/ordered_hash.rb +49 -0
- data/features/support/vboxmanage.rb +191 -0
- data/features/version.feature +16 -0
- data/features/vm.feature +13 -0
- data/features/vm_bios.feature +29 -0
- data/features/vm_cpu.feature +29 -0
- data/features/vm_extra_data.feature +35 -0
- data/features/vm_hw_virt.feature +29 -0
- data/features/vm_nat_engine.feature +57 -0
- data/features/vm_network_adapters.feature +27 -0
- data/features/vm_shared_folders.feature +42 -0
- data/features/vm_snapshots.feature +29 -0
- data/features/vm_storage_controllers.feature +11 -0
- data/lib/virtualbox.rb +11 -0
- data/lib/virtualbox/abstract_model.rb +281 -0
- data/lib/virtualbox/abstract_model/attributable.rb +290 -0
- data/lib/virtualbox/abstract_model/dirty.rb +177 -0
- data/lib/virtualbox/abstract_model/interface_attributes.rb +98 -0
- data/lib/virtualbox/abstract_model/relatable.rb +332 -0
- data/lib/virtualbox/abstract_model/validatable.rb +167 -0
- data/lib/virtualbox/abstract_model/version_matcher.rb +35 -0
- data/lib/virtualbox/appliance.rb +62 -0
- data/lib/virtualbox/audio_adapter.rb +52 -0
- data/lib/virtualbox/bios.rb +50 -0
- data/lib/virtualbox/com.rb +23 -0
- data/lib/virtualbox/com/abstract_enum.rb +43 -0
- data/lib/virtualbox/com/abstract_implementer.rb +45 -0
- data/lib/virtualbox/com/abstract_interface.rb +167 -0
- data/lib/virtualbox/com/base_interface.rb +38 -0
- data/lib/virtualbox/com/ffi/interface.rb +150 -0
- data/lib/virtualbox/com/ffi/interfaces.rb +63 -0
- data/lib/virtualbox/com/ffi/util.rb +121 -0
- data/lib/virtualbox/com/ffi/vboxxpcomc.rb +31 -0
- data/lib/virtualbox/com/ffi_interface.rb +96 -0
- data/lib/virtualbox/com/implementer/base.rb +59 -0
- data/lib/virtualbox/com/implementer/ffi.rb +381 -0
- data/lib/virtualbox/com/implementer/mscom.rb +189 -0
- data/lib/virtualbox/com/implementer/nil.rb +10 -0
- data/lib/virtualbox/com/interface/3.1.x/access_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/appliance.rb +22 -0
- data/lib/virtualbox/com/interface/3.1.x/audio_adapter.rb +15 -0
- data/lib/virtualbox/com/interface/3.1.x/audio_controller_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/audio_driver_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/bios_boot_menu_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/bios_settings.rb +21 -0
- data/lib/virtualbox/com/interface/3.1.x/clipboard_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/console.rb +50 -0
- data/lib/virtualbox/com/interface/3.1.x/cpu_property_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/device_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/dhcp_server.rb +22 -0
- data/lib/virtualbox/com/interface/3.1.x/firmware_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/guest_os_type.rb +23 -0
- data/lib/virtualbox/com/interface/3.1.x/host.rb +42 -0
- data/lib/virtualbox/com/interface/3.1.x/host_network_interface.rb +30 -0
- data/lib/virtualbox/com/interface/3.1.x/host_network_interface_medium_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/host_network_interface_status.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/host_network_interface_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/host_usb_device.rb +13 -0
- data/lib/virtualbox/com/interface/3.1.x/host_usb_device_filter.rb +13 -0
- data/lib/virtualbox/com/interface/3.1.x/hw_virt_ex_property_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/machine.rb +105 -0
- data/lib/virtualbox/com/interface/3.1.x/machine_state.rb +14 -0
- data/lib/virtualbox/com/interface/3.1.x/medium.rb +50 -0
- data/lib/virtualbox/com/interface/3.1.x/medium_attachment.rb +18 -0
- data/lib/virtualbox/com/interface/3.1.x/medium_format.rb +18 -0
- data/lib/virtualbox/com/interface/3.1.x/medium_state.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/medium_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/medium_variant.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/network_adapter.rb +30 -0
- data/lib/virtualbox/com/interface/3.1.x/network_adapter_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/network_attachment_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/nsiexception.rb +23 -0
- data/lib/virtualbox/com/interface/3.1.x/nsisupports.rb +15 -0
- data/lib/virtualbox/com/interface/3.1.x/parallel_port.rb +17 -0
- data/lib/virtualbox/com/interface/3.1.x/port_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/progress.rb +63 -0
- data/lib/virtualbox/com/interface/3.1.x/serial_port.rb +19 -0
- data/lib/virtualbox/com/interface/3.1.x/session.rb +18 -0
- data/lib/virtualbox/com/interface/3.1.x/session_state.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/session_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/shared_folder.rb +17 -0
- data/lib/virtualbox/com/interface/3.1.x/snapshot.rb +20 -0
- data/lib/virtualbox/com/interface/3.1.x/storage_bus.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/storage_controller.rb +23 -0
- data/lib/virtualbox/com/interface/3.1.x/storage_controller_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/system_properties.rb +37 -0
- data/lib/virtualbox/com/interface/3.1.x/usb_controller.rb +20 -0
- data/lib/virtualbox/com/interface/3.1.x/usb_device.rb +24 -0
- data/lib/virtualbox/com/interface/3.1.x/usb_device_filter.rb +23 -0
- data/lib/virtualbox/com/interface/3.1.x/usb_device_filter_action.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/usb_device_state.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/virtual_box_error_info.rb +17 -0
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description.rb +19 -0
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description_type.rb +14 -0
- data/lib/virtualbox/com/interface/3.1.x/virtual_system_description_value_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/virtualbox.rb +67 -0
- data/lib/virtualbox/com/interface/3.1.x/vrdp_auth_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.1.x/vrdp_server.rb +19 -0
- data/lib/virtualbox/com/interface/3.2.x/access_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/appliance.rb +22 -0
- data/lib/virtualbox/com/interface/3.2.x/audio_adapter.rb +15 -0
- data/lib/virtualbox/com/interface/3.2.x/audio_controller_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/audio_driver_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/bios_boot_menu_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/bios_settings.rb +21 -0
- data/lib/virtualbox/com/interface/3.2.x/clipboard_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/console.rb +50 -0
- data/lib/virtualbox/com/interface/3.2.x/cpu_property_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/device_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/dhcp_server.rb +22 -0
- data/lib/virtualbox/com/interface/3.2.x/firmware_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/guest.rb +13 -0
- data/lib/virtualbox/com/interface/3.2.x/guest_os_type.rb +33 -0
- data/lib/virtualbox/com/interface/3.2.x/host.rb +43 -0
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface.rb +30 -0
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface_medium_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface_status.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/host_network_interface_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/host_usb_device.rb +13 -0
- data/lib/virtualbox/com/interface/3.2.x/host_usb_device_filter.rb +13 -0
- data/lib/virtualbox/com/interface/3.2.x/hw_virt_ex_property_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/keyboard_hid_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/machine.rb +118 -0
- data/lib/virtualbox/com/interface/3.2.x/machine_state.rb +14 -0
- data/lib/virtualbox/com/interface/3.2.x/medium.rb +51 -0
- data/lib/virtualbox/com/interface/3.2.x/medium_attachment.rb +18 -0
- data/lib/virtualbox/com/interface/3.2.x/medium_format.rb +18 -0
- data/lib/virtualbox/com/interface/3.2.x/medium_state.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/medium_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/medium_variant.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/nat_alias_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/nat_engine.rb +27 -0
- data/lib/virtualbox/com/interface/3.2.x/nat_protocol.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/network_adapter.rb +34 -0
- data/lib/virtualbox/com/interface/3.2.x/network_adapter_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/network_attachment_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/nsiexception.rb +23 -0
- data/lib/virtualbox/com/interface/3.2.x/nsisupports.rb +15 -0
- data/lib/virtualbox/com/interface/3.2.x/parallel_port.rb +17 -0
- data/lib/virtualbox/com/interface/3.2.x/pointing_hid_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/port_mode.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/progress.rb +63 -0
- data/lib/virtualbox/com/interface/3.2.x/serial_port.rb +19 -0
- data/lib/virtualbox/com/interface/3.2.x/session.rb +18 -0
- data/lib/virtualbox/com/interface/3.2.x/session_state.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/session_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/shared_folder.rb +17 -0
- data/lib/virtualbox/com/interface/3.2.x/snapshot.rb +20 -0
- data/lib/virtualbox/com/interface/3.2.x/storage_bus.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/storage_controller.rb +24 -0
- data/lib/virtualbox/com/interface/3.2.x/storage_controller_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/system_properties.rb +42 -0
- data/lib/virtualbox/com/interface/3.2.x/usb_controller.rb +21 -0
- data/lib/virtualbox/com/interface/3.2.x/usb_device.rb +24 -0
- data/lib/virtualbox/com/interface/3.2.x/usb_device_filter.rb +23 -0
- data/lib/virtualbox/com/interface/3.2.x/usb_device_filter_action.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/usb_device_state.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/virtual_box_error_info.rb +17 -0
- data/lib/virtualbox/com/interface/3.2.x/virtual_system_description.rb +19 -0
- data/lib/virtualbox/com/interface/3.2.x/virtual_system_description_type.rb +14 -0
- data/lib/virtualbox/com/interface/3.2.x/virtual_system_description_value_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/virtualbox.rb +67 -0
- data/lib/virtualbox/com/interface/3.2.x/vrdp_auth_type.rb +11 -0
- data/lib/virtualbox/com/interface/3.2.x/vrdp_server.rb +21 -0
- data/lib/virtualbox/com/interface/4.0.x/access_mode.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/appliance.rb +23 -0
- data/lib/virtualbox/com/interface/4.0.x/audio_adapter.rb +15 -0
- data/lib/virtualbox/com/interface/4.0.x/audio_controller_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/audio_driver_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/auth_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/bios_boot_menu_mode.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/bios_settings.rb +21 -0
- data/lib/virtualbox/com/interface/4.0.x/cleanup_mode.rb +12 -0
- data/lib/virtualbox/com/interface/4.0.x/clipboard_mode.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/console.rb +50 -0
- data/lib/virtualbox/com/interface/4.0.x/cpu_property_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/device_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/dhcp_server.rb +22 -0
- data/lib/virtualbox/com/interface/4.0.x/event_source.rb +13 -0
- data/lib/virtualbox/com/interface/4.0.x/fault_tolerance_state.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/firmware_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/guest.rb +13 -0
- data/lib/virtualbox/com/interface/4.0.x/guest_os_type.rb +33 -0
- data/lib/virtualbox/com/interface/4.0.x/host.rb +43 -0
- data/lib/virtualbox/com/interface/4.0.x/host_network_interface.rb +30 -0
- data/lib/virtualbox/com/interface/4.0.x/host_network_interface_medium_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/host_network_interface_status.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/host_network_interface_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/host_usb_device.rb +13 -0
- data/lib/virtualbox/com/interface/4.0.x/host_usb_device_filter.rb +13 -0
- data/lib/virtualbox/com/interface/4.0.x/hw_virt_ex_property_type.rb +12 -0
- data/lib/virtualbox/com/interface/4.0.x/keyboard_hid_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/lock_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/machine.rb +132 -0
- data/lib/virtualbox/com/interface/4.0.x/machine_state.rb +14 -0
- data/lib/virtualbox/com/interface/4.0.x/medium.rb +53 -0
- data/lib/virtualbox/com/interface/4.0.x/medium_attachment.rb +18 -0
- data/lib/virtualbox/com/interface/4.0.x/medium_format.rb +18 -0
- data/lib/virtualbox/com/interface/4.0.x/medium_state.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/medium_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/medium_variant.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/nat_alias_mode.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/nat_engine.rb +27 -0
- data/lib/virtualbox/com/interface/4.0.x/nat_protocol.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/network_adapter.rb +35 -0
- data/lib/virtualbox/com/interface/4.0.x/network_adapter_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/network_attachment_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/nsiexception.rb +23 -0
- data/lib/virtualbox/com/interface/4.0.x/nsisupports.rb +15 -0
- data/lib/virtualbox/com/interface/4.0.x/parallel_port.rb +17 -0
- data/lib/virtualbox/com/interface/4.0.x/pointing_hid_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/port_mode.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/progress.rb +64 -0
- data/lib/virtualbox/com/interface/4.0.x/serial_port.rb +19 -0
- data/lib/virtualbox/com/interface/4.0.x/session.rb +18 -0
- data/lib/virtualbox/com/interface/4.0.x/session_state.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/session_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/shared_folder.rb +17 -0
- data/lib/virtualbox/com/interface/4.0.x/snapshot.rb +20 -0
- data/lib/virtualbox/com/interface/4.0.x/storage_bus.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/storage_controller.rb +24 -0
- data/lib/virtualbox/com/interface/4.0.x/storage_controller_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/system_properties.rb +42 -0
- data/lib/virtualbox/com/interface/4.0.x/usb_controller.rb +21 -0
- data/lib/virtualbox/com/interface/4.0.x/usb_device.rb +24 -0
- data/lib/virtualbox/com/interface/4.0.x/usb_device_filter.rb +23 -0
- data/lib/virtualbox/com/interface/4.0.x/usb_device_filter_action.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/usb_device_state.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/virtual_box_error_info.rb +17 -0
- data/lib/virtualbox/com/interface/4.0.x/virtual_system_description.rb +19 -0
- data/lib/virtualbox/com/interface/4.0.x/virtual_system_description_type.rb +14 -0
- data/lib/virtualbox/com/interface/4.0.x/virtual_system_description_value_type.rb +11 -0
- data/lib/virtualbox/com/interface/4.0.x/virtualbox.rb +50 -0
- data/lib/virtualbox/com/interface/4.0.x/vrde_server.rb +23 -0
- data/lib/virtualbox/com/mscom_interface.rb +44 -0
- data/lib/virtualbox/com/nil_interface.rb +7 -0
- data/lib/virtualbox/com/util.rb +32 -0
- data/lib/virtualbox/cpu.rb +61 -0
- data/lib/virtualbox/dhcp_server.rb +89 -0
- data/lib/virtualbox/dvd.rb +27 -0
- data/lib/virtualbox/exceptions.rb +39 -0
- data/lib/virtualbox/ext/byte_normalizer.rb +17 -0
- data/lib/virtualbox/ext/glob_loader.rb +35 -0
- data/lib/virtualbox/ext/logger.rb +38 -0
- data/lib/virtualbox/ext/platform.rb +31 -0
- data/lib/virtualbox/ext/subclass_listing.rb +24 -0
- data/lib/virtualbox/extra_data.rb +127 -0
- data/lib/virtualbox/forwarded_port.rb +222 -0
- data/lib/virtualbox/global.rb +96 -0
- data/lib/virtualbox/hard_drive.rb +246 -0
- data/lib/virtualbox/host.rb +71 -0
- data/lib/virtualbox/host_network_interface.rb +137 -0
- data/lib/virtualbox/hw_virtualization.rb +64 -0
- data/lib/virtualbox/lib.rb +84 -0
- data/lib/virtualbox/media.rb +20 -0
- data/lib/virtualbox/medium.rb +145 -0
- data/lib/virtualbox/medium_attachment.rb +61 -0
- data/lib/virtualbox/nat_engine.rb +71 -0
- data/lib/virtualbox/nat_forwarded_port.rb +171 -0
- data/lib/virtualbox/network_adapter.rb +166 -0
- data/lib/virtualbox/proxies/collection.rb +57 -0
- data/lib/virtualbox/shared_folder.rb +220 -0
- data/lib/virtualbox/snapshot.rb +185 -0
- data/lib/virtualbox/storage_controller.rb +160 -0
- data/lib/virtualbox/system_properties.rb +73 -0
- data/lib/virtualbox/usb_controller.rb +59 -0
- data/lib/virtualbox/usb_device_filter.rb +74 -0
- data/lib/virtualbox/version.rb +36 -0
- data/lib/virtualbox/virtual_system_description.rb +47 -0
- data/lib/virtualbox/vm.rb +649 -0
- data/lib/virtualbox/vrde_server.rb +57 -0
- data/test/test_helper.rb +18 -0
- data/test/virtualbox/abstract_model/attributable_test.rb +269 -0
- data/test/virtualbox/abstract_model/dirty_test.rb +83 -0
- data/test/virtualbox/abstract_model/interface_attributes_test.rb +194 -0
- data/test/virtualbox/abstract_model/relatable_test.rb +348 -0
- data/test/virtualbox/abstract_model/validatable_test.rb +308 -0
- data/test/virtualbox/abstract_model/version_matcher_test.rb +41 -0
- data/test/virtualbox/abstract_model_test.rb +462 -0
- data/test/virtualbox/appliance_test.rb +159 -0
- data/test/virtualbox/audio_adapter_test.rb +83 -0
- data/test/virtualbox/bios_test.rb +83 -0
- data/test/virtualbox/com/abstract_enum_test.rb +49 -0
- data/test/virtualbox/com/abstract_implementer_test.rb +40 -0
- data/test/virtualbox/com/abstract_interface_test.rb +140 -0
- data/test/virtualbox/com/ffi/interface_test.rb +249 -0
- data/test/virtualbox/com/ffi/util_test.rb +108 -0
- data/test/virtualbox/com/ffi_interface_test.rb +42 -0
- data/test/virtualbox/com/implementer/base_test.rb +38 -0
- data/test/virtualbox/com/implementer/ffi_test.rb +527 -0
- data/test/virtualbox/com/implementer/mscom_test.rb +247 -0
- data/test/virtualbox/com/mscom_interface_test.rb +17 -0
- data/test/virtualbox/com/util_test.rb +17 -0
- data/test/virtualbox/cpu_test.rb +103 -0
- data/test/virtualbox/dhcp_server_test.rb +165 -0
- data/test/virtualbox/dvd_test.rb +28 -0
- data/test/virtualbox/ext/byte_normalizer_test.rb +34 -0
- data/test/virtualbox/ext/platform_test.rb +50 -0
- data/test/virtualbox/ext/subclass_listing_test.rb +25 -0
- data/test/virtualbox/extra_data_test.rb +155 -0
- data/test/virtualbox/forwarded_port_test.rb +286 -0
- data/test/virtualbox/global_test.rb +46 -0
- data/test/virtualbox/hard_drive_test.rb +141 -0
- data/test/virtualbox/host_network_interface_test.rb +255 -0
- data/test/virtualbox/host_test.rb +94 -0
- data/test/virtualbox/hw_virtualization_test.rb +103 -0
- data/test/virtualbox/lib_test.rb +93 -0
- data/test/virtualbox/medium_attachment_test.rb +147 -0
- data/test/virtualbox/medium_test.rb +192 -0
- data/test/virtualbox/nat_engine_test.rb +106 -0
- data/test/virtualbox/nat_forwarded_port_test.rb +222 -0
- data/test/virtualbox/network_adapter_test.rb +191 -0
- data/test/virtualbox/proxies/collection_test.rb +102 -0
- data/test/virtualbox/shared_folder_test.rb +219 -0
- data/test/virtualbox/snapshot_test.rb +231 -0
- data/test/virtualbox/storage_controller_test.rb +197 -0
- data/test/virtualbox/system_properties_test.rb +87 -0
- data/test/virtualbox/usb_controller_test.rb +112 -0
- data/test/virtualbox/usb_device_filter_test.rb +93 -0
- data/test/virtualbox/version_test.rb +59 -0
- data/test/virtualbox/virtual_system_description_test.rb +61 -0
- data/test/virtualbox/vm_test.rb +633 -0
- data/test/virtualbox/vrde_server_test.rb +83 -0
- data/test/virtualbox_test.rb +11 -0
- data/virtualbox.gemspec +24 -0
- metadata +464 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
Given /the "(.+?)" relationship$/ do |relationship|
|
2
|
+
@relationship = @model.send(relationship)
|
3
|
+
end
|
4
|
+
|
5
|
+
Given /the "(.+?)" relationship on collection item "(.+?)"/ do |key, index|
|
6
|
+
@relationship = @relationship[index.to_i - 1].send(key)
|
7
|
+
end
|
8
|
+
|
9
|
+
Given /I reload the model/ do
|
10
|
+
@model.reload
|
11
|
+
end
|
12
|
+
|
13
|
+
When /I read the "(.+?)"/ do |property|
|
14
|
+
@value = @model.send(property)
|
15
|
+
end
|
16
|
+
|
17
|
+
When /I set the property "(.+?)" to "(.+?)"/ do |key, value|
|
18
|
+
value = value == "true" if %W[true false].include?(value)
|
19
|
+
@model.send("#{key}=", value)
|
20
|
+
end
|
21
|
+
|
22
|
+
When /I set the relationship property "(.+?)" to "(.+?)"/ do |key, value|
|
23
|
+
old = @model
|
24
|
+
@model = @relationship
|
25
|
+
When %Q[I set the property "#{key}" to "#{value}"]
|
26
|
+
@model = old
|
27
|
+
end
|
28
|
+
|
29
|
+
When /I add the new record to the relationship/ do
|
30
|
+
@relationship << @new_record
|
31
|
+
end
|
32
|
+
|
33
|
+
When /I save the relationship/ do
|
34
|
+
@relationship.save
|
35
|
+
end
|
36
|
+
|
37
|
+
When /I save the model/ do
|
38
|
+
@model.save
|
39
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Given /I set the "(.+?)" extra data "(.+?)" to "(.*?)"/ do |name, key, value|
|
2
|
+
name = @name if name == "VM"
|
3
|
+
VBoxManage.execute("setextradata", name, key, value)
|
4
|
+
end
|
5
|
+
|
6
|
+
Given /I delete the "(.+?)" extra data "(.+?)"/ do |name, key|
|
7
|
+
# Same as setting to empty
|
8
|
+
Given %Q[I set the "#{name}" extra data "#{key}" to ""]
|
9
|
+
end
|
10
|
+
|
11
|
+
When /I get the extra data of "(.+?)"/ do |name|
|
12
|
+
@extra_data = VBoxManage.extra_data(name)
|
13
|
+
end
|
14
|
+
|
15
|
+
When /I set the extra data "(.+?)" to "(.+?)"/ do |key, value|
|
16
|
+
@relationship[key] = value
|
17
|
+
end
|
18
|
+
|
19
|
+
When /I delete the extra data "(.+?)"/ do |key|
|
20
|
+
@relationship.delete(key)
|
21
|
+
end
|
22
|
+
|
23
|
+
Then /all the extra data should match/ do
|
24
|
+
@relationship.length.should == @extra_data.length
|
25
|
+
@extra_data.each do |k,v|
|
26
|
+
@relationship[k].should == v
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Then /the extra data should include "(.+?)" as "(.+?)"/ do |key, value|
|
31
|
+
@extra_data[key].should == value
|
32
|
+
end
|
33
|
+
|
34
|
+
Then /the extra data should not include "(.+?)"/ do |key|
|
35
|
+
@extra_data.should_not have_key(key)
|
36
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Given /the global object/ do
|
2
|
+
@model = VirtualBox::Global.global(true)
|
3
|
+
end
|
4
|
+
|
5
|
+
When /I read the media "(.+?)"/ do |property|
|
6
|
+
@media = property.gsub(" ", "_").to_sym
|
7
|
+
@value = @model.media.send(@media)
|
8
|
+
end
|
9
|
+
|
10
|
+
Then /I should get a matching length for "vms"/ do
|
11
|
+
output = VBoxManage.execute("list", "vms")
|
12
|
+
@value.length.should == output.split("\n").length
|
13
|
+
end
|
14
|
+
|
15
|
+
Then /I should get a matching length of media items/ do
|
16
|
+
mapping = {
|
17
|
+
:hard_drives => "hdds",
|
18
|
+
:dvds => "dvds",
|
19
|
+
:floppies => "floppies"
|
20
|
+
}
|
21
|
+
|
22
|
+
output = VBoxManage.execute("list", mapping[@media])
|
23
|
+
count = output.split("\n").inject(0) do |acc, line|
|
24
|
+
acc += 1 if line =~ /^UUID:/
|
25
|
+
acc
|
26
|
+
end
|
27
|
+
|
28
|
+
@value.length.should == count
|
29
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Given /the forwarded ports are cleared/ do
|
2
|
+
VBoxManage.network_adapters(@output).each_with_index do |obj, i|
|
3
|
+
VBoxManage.forwarded_ports(@output, i+1).each do |name, data|
|
4
|
+
VBoxManage.execute("modifyvm", @name, "--natpf#{i+1}", "delete", name)
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
Given /I read the adapter in slot "(.+?)"$/ do |slot|
|
10
|
+
@slot = slot.to_i
|
11
|
+
@adapter = VBoxManage.network_adapters(@output)[slot.to_i]
|
12
|
+
@adapter.should_not be_nil
|
13
|
+
|
14
|
+
@relationship = @model.network_adapters[slot.to_i - 1].nat_driver
|
15
|
+
end
|
16
|
+
|
17
|
+
Given /I create a forwarded port named "(.+?)" from "(.+?)" to "(.+?)" via VBoxManage/ do |name, guest, host|
|
18
|
+
fp_string = "#{name},tcp,,#{host},,#{guest}"
|
19
|
+
VBoxManage.execute("modifyvm", @name, "--natpf#{@slot}", fp_string)
|
20
|
+
end
|
21
|
+
|
22
|
+
When /I create a forwarded port named "(.+?)" from "(.+?)" to "(.+?)"$/ do |name, guest, host|
|
23
|
+
@object = VirtualBox::NATForwardedPort.new
|
24
|
+
@object.name = name
|
25
|
+
@object.guestport = guest.to_i
|
26
|
+
@object.hostport = host.to_i
|
27
|
+
|
28
|
+
@relationship.forwarded_ports << @object
|
29
|
+
end
|
30
|
+
|
31
|
+
When /I update the forwarded port named "(.+?)":/ do |name, table|
|
32
|
+
fp = @relationship.forwarded_ports.find { |fp| fp.name == name }
|
33
|
+
fp.should_not be_nil
|
34
|
+
|
35
|
+
table.hashes.each do |hash|
|
36
|
+
value = hash["value"]
|
37
|
+
value = value.to_i if %W[hostport guestport].include?(hash["attribute"])
|
38
|
+
fp.send("#{hash["attribute"]}=", value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
When /I delete the forwarded port named "(.+?)"/ do |name|
|
43
|
+
@relationship.forwarded_ports.each do |fp|
|
44
|
+
if fp.name == name
|
45
|
+
fp.destroy
|
46
|
+
break
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
Then /the NAT network should exist/ do
|
52
|
+
# Temporary until we find something to really test
|
53
|
+
@relationship.should_not be_nil
|
54
|
+
end
|
55
|
+
|
56
|
+
Then /the forwarded port "(.+?)" should exist/ do |name|
|
57
|
+
ports = VBoxManage.forwarded_ports(@output, @slot)
|
58
|
+
ports.should have_key(name)
|
59
|
+
end
|
60
|
+
|
61
|
+
Then /the forwarded port "(.+?)" should not exist/ do |name|
|
62
|
+
ports = VBoxManage.forwarded_ports(@output, @slot)
|
63
|
+
ports.should_not have_key(name)
|
64
|
+
end
|
65
|
+
|
66
|
+
Then /the forwarded ports should match/ do
|
67
|
+
ports = VBoxManage.forwarded_ports(@output, @slot)
|
68
|
+
|
69
|
+
@relationship.forwarded_ports.length.should == ports.length
|
70
|
+
@relationship.forwarded_ports.each do |fp|
|
71
|
+
port = ports[fp.name]
|
72
|
+
port.should_not be_nil
|
73
|
+
|
74
|
+
test_mappings(FORWARDED_PORT_MAPPINGS, fp, port)
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
Given /the adapters are reset/ do
|
2
|
+
VBoxManage.network_adapters(@output).each_with_index do |obj, i|
|
3
|
+
VBoxManage.execute("modifyvm", @name, "--nic#{i+1}", "none")
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
Given /the adapter in slot "(.+?)" is type "(.+?)"/ do |slot, type|
|
8
|
+
VBoxManage.execute("modifyvm", @name, "--nic#{slot}", type)
|
9
|
+
end
|
10
|
+
|
11
|
+
Given /the following adapters are set:/ do |table|
|
12
|
+
table.hashes.each do |hash|
|
13
|
+
Given %Q[the adapter in slot "#{hash["slot"]}" is type "#{hash["type"]}"]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
When /I update the adapter in slot "(.+?)"/ do |slot|
|
18
|
+
adapter = @relationship.find { |na| na.slot == (slot.to_i - 1) }
|
19
|
+
adapter.should_not be_nil
|
20
|
+
|
21
|
+
@model = adapter
|
22
|
+
end
|
23
|
+
|
24
|
+
Then /the network adapter properties should match/ do
|
25
|
+
adapters = VBoxManage.network_adapters(@output)
|
26
|
+
@relationship.length.should == adapters.length
|
27
|
+
|
28
|
+
@relationship.each do |na|
|
29
|
+
adapter = adapters[na.slot + 1]
|
30
|
+
adapter.should_not be_nil
|
31
|
+
|
32
|
+
if na.enabled?
|
33
|
+
test_mappings(NETWORK_ADAPTER_MAPPINGS, na, adapter)
|
34
|
+
else
|
35
|
+
adapter[:type].should == "none"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Given /I add a shared folder "(.+?)" with path "(.+?)" via VBoxManage/ do |name,hostpath|
|
2
|
+
VBoxManage.execute("sharedfolder", "add", @name,
|
3
|
+
"--name", name,
|
4
|
+
"--hostpath", hostpath)
|
5
|
+
end
|
6
|
+
|
7
|
+
Given /I remove all shared folders/ do
|
8
|
+
VBoxManage.shared_folders(@output).each do |name, folder|
|
9
|
+
Given %Q[I delete the shared folder "#{name}" via VBoxManage]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Given /I delete the shared folder "(.+?)" via VBoxManage/ do |name|
|
14
|
+
VBoxManage.execute("sharedfolder", "remove", @name,
|
15
|
+
"--name", name)
|
16
|
+
end
|
17
|
+
|
18
|
+
Given /a shared folder "(.+?)" exists/ do |name|
|
19
|
+
folders = VBoxManage.shared_folders(@output)
|
20
|
+
|
21
|
+
if !folders.keys.include?(name)
|
22
|
+
Given %Q[I add a shared folder "#{name}" with path "/#{name}" via VBoxManage]
|
23
|
+
Given %Q[I reload the VM]
|
24
|
+
Given %Q[the "shared_folders" relationship]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Given /no shared folder "(.+?)" exists/ do |name|
|
29
|
+
folders = VBoxManage.shared_folders(@output)
|
30
|
+
|
31
|
+
if folders.keys.include?(name)
|
32
|
+
Given %Q[I delete the shared folder "#{name}" via VBoxManage]
|
33
|
+
Given %Q[I reload the VM]
|
34
|
+
Given %Q[the "shared_folders" relationship]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
When /I create a new shared folder "(.+?)" with path "(.+?)"/ do |name,hostpath|
|
39
|
+
@new_record = VirtualBox::SharedFolder.new
|
40
|
+
@new_record.name = name
|
41
|
+
@new_record.host_path = hostpath
|
42
|
+
end
|
43
|
+
|
44
|
+
When /I update the shared folder named "(.+?)":/ do |name, table|
|
45
|
+
object = @relationship.find { |o| o.name == name }
|
46
|
+
object.should_not be_nil
|
47
|
+
|
48
|
+
table.hashes.each do |hash|
|
49
|
+
object.send("#{hash["attribute"]}=", hash["value"])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
When /I delete the shared folder "(.+?)"$/ do |name|
|
54
|
+
@relationship.each do |sf|
|
55
|
+
sf.destroy if sf.name == name
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
Then /the shared folder "(.+?)" should exist/ do |name|
|
60
|
+
VBoxManage.shared_folders(@output).keys.should include(name)
|
61
|
+
end
|
62
|
+
|
63
|
+
Then /the shared folder "(.+?)" should not exist/ do |name|
|
64
|
+
VBoxManage.shared_folders(@output).keys.should_not include(name)
|
65
|
+
end
|
66
|
+
|
67
|
+
Then /the shared folder properties should match/ do
|
68
|
+
folders = VBoxManage.shared_folders(@output)
|
69
|
+
|
70
|
+
@relationship.length.should == folders.length
|
71
|
+
|
72
|
+
@relationship.each do |sf|
|
73
|
+
folder = folders[sf.name]
|
74
|
+
test_mappings(SHARED_FOLDER_MAPPINGS, sf, folder)
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
Given /the snapshots are cleared/ do
|
2
|
+
snapshot_map(VBoxManage.snapshots(@output)) do |snapshot|
|
3
|
+
VBoxManage.execute("snapshot", @name, "delete", snapshot[:name])
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
Given /the following snapshot tree is created:$/ do |tree|
|
8
|
+
tree.hashes.each do |hash|
|
9
|
+
restore_parent = lambda do
|
10
|
+
VBoxManage.execute("snapshot", @name, "restore", hash["key"])
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
restore_parent.call
|
15
|
+
rescue Exception
|
16
|
+
VBoxManage.execute("snapshot", @name, "take", hash["key"])
|
17
|
+
end
|
18
|
+
|
19
|
+
hash["children"].split(",").each do |child|
|
20
|
+
VBoxManage.execute("snapshot", @name, "take", child)
|
21
|
+
restore_parent.call
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
Given /the snapshot "(.+?)" is created/ do |name|
|
27
|
+
VBoxManage.execute("snapshot", @name, "take", name)
|
28
|
+
end
|
29
|
+
|
30
|
+
When /I find the snapshot named "(.+?)"/ do |name|
|
31
|
+
@snapshot = @model.find_snapshot(name)
|
32
|
+
@snapshot.should be
|
33
|
+
end
|
34
|
+
|
35
|
+
When /I take a snapshot "(.+?)"/ do |name|
|
36
|
+
@model.take_snapshot(name)
|
37
|
+
end
|
38
|
+
|
39
|
+
When /I destroy the snapshot/ do
|
40
|
+
@snapshot.destroy
|
41
|
+
end
|
42
|
+
|
43
|
+
Then /the snapshot "(.+?)" should exist/ do |name|
|
44
|
+
result = false
|
45
|
+
snapshot_map(VBoxManage.snapshots(@output)) do |snapshot|
|
46
|
+
result = true if snapshot[:name] == name
|
47
|
+
end
|
48
|
+
|
49
|
+
result.should be
|
50
|
+
end
|
51
|
+
|
52
|
+
Then /the snapshot "(.+?)" should not exist/ do |name|
|
53
|
+
result = false
|
54
|
+
snapshot_map(VBoxManage.snapshots(@output)) do |snapshot|
|
55
|
+
result = true if snapshot[:name] == name
|
56
|
+
end
|
57
|
+
|
58
|
+
result.should_not be
|
59
|
+
end
|
60
|
+
|
61
|
+
Then /the snapshots should match/ do
|
62
|
+
@root = @model.root_snapshot
|
63
|
+
|
64
|
+
match_tester = lambda do |current, expected|
|
65
|
+
current.uuid.should == expected[:uuid]
|
66
|
+
current.children.length.should == expected[:children].length
|
67
|
+
|
68
|
+
current.children.each_with_index do |current_child, i|
|
69
|
+
match_tester.call(current_child, expected[:children][i])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
match_tester.call(@root, VBoxManage.snapshots(@output))
|
74
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Then /the number of storage controllers should match/ do
|
2
|
+
@relationship.length.should == VBoxManage.storage_controllers(@output).length
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /the storage controller properties should match/ do
|
6
|
+
controllers = VBoxManage.storage_controllers(@output)
|
7
|
+
|
8
|
+
@relationship.each do |sc|
|
9
|
+
controller = controllers[sc.name]
|
10
|
+
controller.should_not be_nil
|
11
|
+
|
12
|
+
test_mappings(STORAGE_MAPPINGS, sc, controller) do |value, output|
|
13
|
+
[value.to_s.downcase.gsub("_",""), output.downcase]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Testing VBoxManage -v output
|
2
|
+
When /I try to read the virtualbox "(.+?)"/ do |item|
|
3
|
+
@key = item.to_sym
|
4
|
+
@result = VirtualBox.send(item)
|
5
|
+
end
|
6
|
+
|
7
|
+
Then /the result should match version output/ do
|
8
|
+
data = VBoxManage.execute("-v").split("r")
|
9
|
+
results = {
|
10
|
+
:version => data[0],
|
11
|
+
:revision => data[1],
|
12
|
+
:supported? => !!data
|
13
|
+
}
|
14
|
+
|
15
|
+
@result.should == results[@key]
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
Given /I set the VM "(.+?)" to "(.+?)"/ do |key, value|
|
2
|
+
VBoxManage.execute("modifyvm", @name, "--#{key}", value)
|
3
|
+
end
|
4
|
+
|
5
|
+
Given /I set the VM properties:/ do |properties|
|
6
|
+
properties.hashes.each do |hash|
|
7
|
+
Given %Q[I set the VM "#{hash["name"]}" to "#{hash["value"]}"]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Given /I reload the VM$/ do
|
12
|
+
Given %Q[I find a VM identified by "#{@name}"]
|
13
|
+
end
|
14
|
+
|
15
|
+
When /I find a VM identified by "(.+?)"/ do |name|
|
16
|
+
@name = name
|
17
|
+
@output = VBoxManage.vm_info(name)
|
18
|
+
@vm = VirtualBox::VM.find(name)
|
19
|
+
@model = @vm
|
20
|
+
end
|
21
|
+
|
22
|
+
When /I reload the VM info$/ do
|
23
|
+
@output = VBoxManage.vm_info(@name)
|
24
|
+
end
|
25
|
+
|
26
|
+
When /I save the VM/ do
|
27
|
+
@vm.save
|
28
|
+
end
|
29
|
+
|
30
|
+
Then /the VM should not exist/ do
|
31
|
+
@output.should be_empty
|
32
|
+
@vm.should be_nil
|
33
|
+
end
|
34
|
+
|
35
|
+
Then /the VM should exist/ do
|
36
|
+
@output.should have_key("UUID")
|
37
|
+
@vm.should_not be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
Then /the "(.+?)" properties should match/ do |type|
|
41
|
+
map = {
|
42
|
+
"BIOS" => BIOS_MAPPINGS,
|
43
|
+
"CPU" => CPU_MAPPINGS,
|
44
|
+
"HW virt" => HWVIRT_MAPPINGS,
|
45
|
+
"VM" => VM_MAPPINGS
|
46
|
+
}
|
47
|
+
|
48
|
+
object = type == "VM" ? @vm : @relationship
|
49
|
+
test_mappings(map[type], object, @output)
|
50
|
+
end
|