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,197 @@
|
|
1
|
+
require File.expand_path("../../test_helper", __FILE__)
|
2
|
+
|
3
|
+
class StorageControllerTest < Test::Unit::TestCase
|
4
|
+
setup do
|
5
|
+
@interface = mock("interface")
|
6
|
+
@parent = mock("parent")
|
7
|
+
|
8
|
+
@klass = VirtualBox::StorageController
|
9
|
+
end
|
10
|
+
|
11
|
+
context "class methods" do
|
12
|
+
context "populating relationship" do
|
13
|
+
setup do
|
14
|
+
# Defaulting for non-specified parameters
|
15
|
+
@interface.stubs(:is_a?).returns(false)
|
16
|
+
end
|
17
|
+
|
18
|
+
should "populate array relationship if IMachine is given" do
|
19
|
+
@interface.expects(:is_a?).with(VirtualBox::COM::Util.versioned_interface(:Machine)).returns(true)
|
20
|
+
@klass.expects(:populate_array_relationship).once.with(@parent, @interface)
|
21
|
+
@klass.populate_relationship(@parent, @interface)
|
22
|
+
end
|
23
|
+
|
24
|
+
should "populate attachment relationship if MediumAttachment is given" do
|
25
|
+
@interface.expects(:is_a?).with(VirtualBox::MediumAttachment).returns(true)
|
26
|
+
@klass.expects(:populate_attachment_relationship).once.with(@parent, @interface)
|
27
|
+
@klass.populate_relationship(@parent, @interface)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context "populating array (has many) relationship" do
|
32
|
+
setup do
|
33
|
+
@instance = mock("instance")
|
34
|
+
|
35
|
+
@interface.stubs(:storage_controllers).returns([])
|
36
|
+
|
37
|
+
@klass.stubs(:device_type).returns(:all)
|
38
|
+
@klass.stubs(:new).returns(@instance)
|
39
|
+
end
|
40
|
+
|
41
|
+
def mock_controller(name)
|
42
|
+
controller = mock(name)
|
43
|
+
controller
|
44
|
+
end
|
45
|
+
|
46
|
+
should "return a proxied collection" do
|
47
|
+
result = @klass.populate_array_relationship(nil, @interface)
|
48
|
+
assert result.is_a?(VirtualBox::Proxies::Collection)
|
49
|
+
end
|
50
|
+
|
51
|
+
should "call new for every medium if device type is all" do
|
52
|
+
controllers = []
|
53
|
+
@interface.stubs(:storage_controllers).returns(controllers)
|
54
|
+
5.times { |i| controllers << mock_controller("c#{i}") }
|
55
|
+
|
56
|
+
expected_result = []
|
57
|
+
new_seq = sequence("new_seq")
|
58
|
+
controllers.each do |controller|
|
59
|
+
expected_value = "instance-#{controller.inspect}"
|
60
|
+
@klass.expects(:new).with(@parent, controller).in_sequence(new_seq).returns(expected_value)
|
61
|
+
expected_result << expected_value
|
62
|
+
end
|
63
|
+
|
64
|
+
assert_equal expected_result, @klass.populate_array_relationship(@parent, @interface)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
context "populating relationship for a MediumAttachment" do
|
69
|
+
setup do
|
70
|
+
@controllers = []
|
71
|
+
|
72
|
+
@machine = mock("machine")
|
73
|
+
@machine.stubs(:storage_controllers).returns(@controllers)
|
74
|
+
|
75
|
+
@interface.stubs(:parent).returns(@machine)
|
76
|
+
end
|
77
|
+
|
78
|
+
should "return nil if no controllers match" do
|
79
|
+
assert_nil @klass.populate_attachment_relationship(@parent, @interface)
|
80
|
+
end
|
81
|
+
|
82
|
+
should "return the controller with matching name" do
|
83
|
+
name = :foo
|
84
|
+
@interface.stubs(:controller_name).returns(name)
|
85
|
+
|
86
|
+
controller = mock("controller")
|
87
|
+
controller.stubs(:name).returns(:foo)
|
88
|
+
@controllers << controller
|
89
|
+
|
90
|
+
assert_equal controller, @klass.populate_attachment_relationship(@parent, @interface)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
context "saving relationship" do
|
95
|
+
should "call save on each item" do
|
96
|
+
items = (1..5).to_a.collect do |i|
|
97
|
+
item = mock("item-#{i}")
|
98
|
+
item.expects(:save).once
|
99
|
+
item
|
100
|
+
end
|
101
|
+
|
102
|
+
@klass.save_relationship(nil, items)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
context "initializing" do
|
108
|
+
setup do
|
109
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
110
|
+
end
|
111
|
+
|
112
|
+
should "load interface attribtues" do
|
113
|
+
@klass.any_instance.expects(:load_interface_attributes).with(@interface).once
|
114
|
+
@klass.new(@parent, @interface)
|
115
|
+
end
|
116
|
+
|
117
|
+
should "not be dirty" do
|
118
|
+
@instance = @klass.new(@parent, @interface)
|
119
|
+
assert !@instance.changed?
|
120
|
+
end
|
121
|
+
|
122
|
+
should "be existing record" do
|
123
|
+
@instance = @klass.new(@parent, @interface)
|
124
|
+
assert !@instance.new_record?
|
125
|
+
end
|
126
|
+
|
127
|
+
should "setup parent" do
|
128
|
+
@instance = @klass.new(@parent, @interface)
|
129
|
+
assert_equal @parent, @instance.parent
|
130
|
+
end
|
131
|
+
|
132
|
+
should "setup interface" do
|
133
|
+
@instance = @klass.new(@parent, @interface)
|
134
|
+
assert_equal @interface, @instance.interface
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
context "instance methods" do
|
139
|
+
setup do
|
140
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
141
|
+
|
142
|
+
@parent = mock("parent")
|
143
|
+
@interface = mock("interface")
|
144
|
+
@instance = @klass.new(@parent, @interface)
|
145
|
+
end
|
146
|
+
|
147
|
+
context "medium attachments" do
|
148
|
+
setup do
|
149
|
+
@medium_attachments = []
|
150
|
+
@parent.stubs(:medium_attachments).returns(@medium_attachments)
|
151
|
+
end
|
152
|
+
|
153
|
+
def mock_medium_attachment(sc)
|
154
|
+
ma = mock("ma-#{sc.inspect}")
|
155
|
+
ma.stubs(:storage_controller).returns(sc)
|
156
|
+
ma
|
157
|
+
end
|
158
|
+
|
159
|
+
should "return all medium attachments which match the storage controller" do
|
160
|
+
foo_ma = mock_medium_attachment(@instance)
|
161
|
+
@medium_attachments << foo_ma
|
162
|
+
@medium_attachments << mock_medium_attachment(:bar)
|
163
|
+
|
164
|
+
assert_equal [foo_ma], @instance.medium_attachments
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
context "destroying" do
|
169
|
+
setup do
|
170
|
+
@ma = []
|
171
|
+
@instance.stubs(:medium_attachments).returns(@ma)
|
172
|
+
|
173
|
+
@machine = mock("machine")
|
174
|
+
@session = mock("session")
|
175
|
+
@session.stubs(:machine).returns(@machine)
|
176
|
+
@parent.stubs(:with_open_session).yields(@session)
|
177
|
+
end
|
178
|
+
|
179
|
+
should "remove all the attachments" do
|
180
|
+
ma = mock("medium_attachment")
|
181
|
+
@ma << ma
|
182
|
+
|
183
|
+
destroy_seq = sequence("destroy_seq")
|
184
|
+
ma.expects(:destroy).with(1,2,3).once.in_sequence(destroy_seq)
|
185
|
+
@machine.expects(:remove_storage_controller).with(@instance.name).in_sequence(destroy_seq)
|
186
|
+
|
187
|
+
@instance.destroy(1,2,3)
|
188
|
+
end
|
189
|
+
|
190
|
+
should "remove from the parent and save" do
|
191
|
+
destroy_seq = sequence("destroy_seq")
|
192
|
+
@machine.expects(:remove_storage_controller).with(@instance.name).in_sequence(destroy_seq)
|
193
|
+
@instance.destroy
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require File.expand_path("../../test_helper", __FILE__)
|
2
|
+
|
3
|
+
class SystemPropertiesTest < Test::Unit::TestCase
|
4
|
+
setup do
|
5
|
+
@klass = VirtualBox::SystemProperties
|
6
|
+
@interface = mock("interface")
|
7
|
+
end
|
8
|
+
|
9
|
+
context "initializing" do
|
10
|
+
should "load attributes from the machine" do
|
11
|
+
@klass.any_instance.expects(:initialize_attributes).with(@interface).once
|
12
|
+
@klass.new(@interface)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "initializing attributes" do
|
17
|
+
setup do
|
18
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
19
|
+
end
|
20
|
+
|
21
|
+
should "load interface attribtues" do
|
22
|
+
@klass.any_instance.expects(:load_interface_attributes).with(@interface).once
|
23
|
+
@klass.new(@interface)
|
24
|
+
end
|
25
|
+
|
26
|
+
should "setup the interface" do
|
27
|
+
instance = @klass.new(@interface)
|
28
|
+
assert_equal @interface, instance.interface
|
29
|
+
end
|
30
|
+
|
31
|
+
should "not be dirty" do
|
32
|
+
@instance = @klass.new(@interface)
|
33
|
+
assert !@instance.changed?
|
34
|
+
end
|
35
|
+
|
36
|
+
should "be existing record" do
|
37
|
+
@instance = @klass.new(@interface)
|
38
|
+
assert !@instance.new_record?
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context "class methods" do
|
43
|
+
context "populating relationship" do
|
44
|
+
setup do
|
45
|
+
@instance = mock("instance")
|
46
|
+
|
47
|
+
@klass.stubs(:new).returns(@instance)
|
48
|
+
end
|
49
|
+
|
50
|
+
should "return a SystemProperties instance" do
|
51
|
+
result = @klass.populate_relationship(nil, @interface)
|
52
|
+
assert_equal @instance, result
|
53
|
+
end
|
54
|
+
|
55
|
+
should "call new for every shared folder" do
|
56
|
+
@klass.expects(:new).with(@interface).returns(@instance)
|
57
|
+
result = @klass.populate_relationship(nil, @interface)
|
58
|
+
assert_equal @instance, result
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context "saving relationship" do
|
63
|
+
setup do
|
64
|
+
@item = mock("item")
|
65
|
+
end
|
66
|
+
|
67
|
+
should "just call save on the item" do
|
68
|
+
@item.expects(:save)
|
69
|
+
@klass.save_relationship(nil, @item)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context "instance methods" do
|
75
|
+
setup do
|
76
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
77
|
+
@instance = @klass.new(@interface)
|
78
|
+
end
|
79
|
+
|
80
|
+
context "saving" do
|
81
|
+
should "save changed interface attributes" do
|
82
|
+
@instance.expects(:save_changed_interface_attributes).with(@interface)
|
83
|
+
@instance.save
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
require File.expand_path("../../test_helper", __FILE__)
|
2
|
+
|
3
|
+
class USBControllerTest < Test::Unit::TestCase
|
4
|
+
setup do
|
5
|
+
@klass = VirtualBox::USBController
|
6
|
+
@interface = mock("interface")
|
7
|
+
@parent = mock("parent")
|
8
|
+
end
|
9
|
+
|
10
|
+
context "initializing" do
|
11
|
+
should "load attributes from the machine" do
|
12
|
+
@klass.any_instance.expects(:initialize_attributes).with(@parent, @interface).once
|
13
|
+
@klass.new(@parent, @interface)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context "initializing attributes" do
|
18
|
+
setup do
|
19
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
20
|
+
@klass.any_instance.stubs(:populate_relationships)
|
21
|
+
end
|
22
|
+
|
23
|
+
should "load interface attribtues" do
|
24
|
+
@klass.any_instance.expects(:load_interface_attributes).with(@interface).once
|
25
|
+
@klass.new(@parent, @interface)
|
26
|
+
end
|
27
|
+
|
28
|
+
should "populate relationships" do
|
29
|
+
@klass.any_instance.expects(:populate_relationships).with(@interface).once
|
30
|
+
@klass.new(@parent, @interface)
|
31
|
+
end
|
32
|
+
|
33
|
+
should "setup the parent" do
|
34
|
+
instance = @klass.new(@parent, @interface)
|
35
|
+
assert_equal @parent, instance.parent
|
36
|
+
end
|
37
|
+
|
38
|
+
should "setup the interface" do
|
39
|
+
instance = @klass.new(@parent, @interface)
|
40
|
+
assert_equal @interface, instance.interface
|
41
|
+
end
|
42
|
+
|
43
|
+
should "not be dirty" do
|
44
|
+
@instance = @klass.new(@parent, @interface)
|
45
|
+
assert !@instance.changed?
|
46
|
+
end
|
47
|
+
|
48
|
+
should "be existing record" do
|
49
|
+
@instance = @klass.new(@parent, @interface)
|
50
|
+
assert !@instance.new_record?
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context "class methods" do
|
55
|
+
context "populating relationship" do
|
56
|
+
setup do
|
57
|
+
@instance = mock("instance")
|
58
|
+
|
59
|
+
@klass.stubs(:new).returns(@instance)
|
60
|
+
|
61
|
+
@controller_interface = mock("controller_interface")
|
62
|
+
@interface.stubs(:usb_controller).returns(@controller_interface)
|
63
|
+
end
|
64
|
+
|
65
|
+
should "return a USBController instance" do
|
66
|
+
result = @klass.populate_relationship(nil, @interface)
|
67
|
+
assert_equal @instance, result
|
68
|
+
end
|
69
|
+
|
70
|
+
should "call new with the interface" do
|
71
|
+
@klass.expects(:new).with(@parent, @controller_interface).returns(@instance)
|
72
|
+
result = @klass.populate_relationship(@parent, @interface)
|
73
|
+
assert_equal @instance, result
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context "saving relationship" do
|
78
|
+
setup do
|
79
|
+
@item = mock("item")
|
80
|
+
end
|
81
|
+
|
82
|
+
should "just call save on the item" do
|
83
|
+
@item.expects(:save)
|
84
|
+
@klass.save_relationship(nil, @item)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context "instance methods" do
|
90
|
+
setup do
|
91
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
92
|
+
@klass.any_instance.stubs(:populate_relationship)
|
93
|
+
@instance = @klass.new(@parent, @interface)
|
94
|
+
end
|
95
|
+
|
96
|
+
context "saving" do
|
97
|
+
setup do
|
98
|
+
@session = mock("session")
|
99
|
+
@machine = mock("machine")
|
100
|
+
@usb_controller = mock("usb_controller")
|
101
|
+
@session.stubs(:machine).returns(@machine)
|
102
|
+
@machine.stubs(:usb_controller).returns(@usb_controller)
|
103
|
+
@parent.stubs(:with_open_session).yields(@session)
|
104
|
+
end
|
105
|
+
|
106
|
+
should "save on the locked interface" do
|
107
|
+
@instance.expects(:save_changed_interface_attributes).with(@usb_controller).once
|
108
|
+
@instance.save
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
require File.expand_path("../../test_helper", __FILE__)
|
2
|
+
|
3
|
+
class USBDeviceFilterTestTest < Test::Unit::TestCase
|
4
|
+
setup do
|
5
|
+
@klass = VirtualBox::USBDeviceFilter
|
6
|
+
@interface = mock("interface")
|
7
|
+
end
|
8
|
+
|
9
|
+
context "class methods" do
|
10
|
+
context "populating relationships" do
|
11
|
+
setup do
|
12
|
+
@instance = mock("instance")
|
13
|
+
|
14
|
+
@interface.stubs(:device_filters).returns([])
|
15
|
+
@klass.stubs(:new).returns(@instance)
|
16
|
+
end
|
17
|
+
|
18
|
+
should "return a proxied collection" do
|
19
|
+
result = @klass.populate_relationship(nil, @interface)
|
20
|
+
assert result.is_a?(VirtualBox::Proxies::Collection)
|
21
|
+
end
|
22
|
+
|
23
|
+
should "call new for every interface" do
|
24
|
+
collection = []
|
25
|
+
@interface.stubs(:device_filters).returns(collection)
|
26
|
+
5.times { |i| collection << mock("a#{i}") }
|
27
|
+
|
28
|
+
expected_result = []
|
29
|
+
new_seq = sequence("new_seq")
|
30
|
+
collection.each do |item|
|
31
|
+
expected_value = "instance-#{item.inspect}"
|
32
|
+
@klass.expects(:new).with(item).in_sequence(new_seq).returns(expected_value)
|
33
|
+
expected_result << expected_value
|
34
|
+
end
|
35
|
+
|
36
|
+
assert_equal expected_result, @klass.populate_relationship(@parent, @interface)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "saving relationship" do
|
41
|
+
setup do
|
42
|
+
@item = mock("item")
|
43
|
+
end
|
44
|
+
|
45
|
+
should "just call save on the item" do
|
46
|
+
@item.expects(:save)
|
47
|
+
@klass.save_relationship(nil, @item)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context "initializing" do
|
53
|
+
should "load attributes from the machine" do
|
54
|
+
@klass.any_instance.expects(:initialize_attributes).with(@interface).once
|
55
|
+
@klass.new(@interface)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "initializing attributes" do
|
60
|
+
setup do
|
61
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
62
|
+
end
|
63
|
+
|
64
|
+
should "load interface attribtues" do
|
65
|
+
@klass.any_instance.expects(:load_interface_attributes).with(@interface).once
|
66
|
+
@klass.new(@interface)
|
67
|
+
end
|
68
|
+
|
69
|
+
should "not be dirty" do
|
70
|
+
@instance = @klass.new(@interface)
|
71
|
+
assert !@instance.changed?
|
72
|
+
end
|
73
|
+
|
74
|
+
should "be existing record" do
|
75
|
+
@instance = @klass.new(@interface)
|
76
|
+
assert !@instance.new_record?
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
context "instance methods" do
|
81
|
+
setup do
|
82
|
+
@klass.any_instance.stubs(:load_interface_attributes)
|
83
|
+
|
84
|
+
@parent = mock("parent")
|
85
|
+
@interface = mock("interface")
|
86
|
+
@instance = @klass.new(@interface)
|
87
|
+
@instance.stubs(:interface).returns(@interface)
|
88
|
+
@instance.stubs(:parent).returns(@parent)
|
89
|
+
@collection = VirtualBox::Proxies::Collection.new(@parent)
|
90
|
+
@collection << @instance
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|