fog-xenserver 0.0.1.beta1 → 0.0.1.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.hound.yml +14 -15
- data/.travis.yml +5 -7
- data/CONTRIBUTORS.md +2 -1
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/fog-xenserver.gemspec +5 -2
- data/gemfiles/Gemfile.1.9.2+ +1 -1
- data/gemfiles/{Gemfile.1.8.7 → Gemfile.1.9.2-} +1 -1
- data/lib/fog/compute/xen_server.rb +284 -59
- data/lib/fog/compute/xen_server/mock.rb +4 -0
- data/lib/fog/compute/xen_server/models.rb +4 -0
- data/lib/fog/compute/xen_server/models/blob.rb +2 -1
- data/lib/fog/compute/xen_server/models/blobs.rb +1 -1
- data/lib/fog/compute/xen_server/models/bond.rb +5 -4
- data/lib/fog/compute/xen_server/models/bonds.rb +1 -1
- data/lib/fog/compute/xen_server/models/class_methods.rb +24 -0
- data/lib/fog/compute/xen_server/models/collection.rb +45 -0
- data/lib/fog/compute/xen_server/models/console.rb +3 -2
- data/lib/fog/compute/xen_server/models/consoles.rb +1 -1
- data/lib/fog/compute/xen_server/models/crash_dump.rb +4 -3
- data/lib/fog/compute/xen_server/models/crash_dumps.rb +1 -1
- data/lib/fog/compute/xen_server/models/dr_task.rb +3 -2
- data/lib/fog/compute/xen_server/models/dr_tasks.rb +1 -1
- data/lib/fog/compute/xen_server/models/gpu_group.rb +5 -4
- data/lib/fog/compute/xen_server/models/gpu_groups.rb +1 -1
- data/lib/fog/compute/xen_server/models/guest_metrics.rb +4 -3
- data/lib/fog/compute/xen_server/models/guests_metrics.rb +1 -1
- data/lib/fog/compute/xen_server/models/host.rb +23 -65
- data/lib/fog/compute/xen_server/models/host_cpu.rb +4 -3
- data/lib/fog/compute/xen_server/models/host_cpus.rb +1 -1
- data/lib/fog/compute/xen_server/models/host_crash_dump.rb +3 -2
- data/lib/fog/compute/xen_server/models/host_crash_dumps.rb +1 -1
- data/lib/fog/compute/xen_server/models/host_metrics.rb +3 -7
- data/lib/fog/compute/xen_server/models/host_patch.rb +4 -3
- data/lib/fog/compute/xen_server/models/host_patchs.rb +1 -1
- data/lib/fog/compute/xen_server/models/hosts.rb +1 -1
- data/lib/fog/compute/xen_server/models/hosts_metrics.rb +1 -1
- data/lib/fog/compute/xen_server/models/instance_methods.rb +54 -0
- data/lib/fog/compute/xen_server/models/model.rb +12 -0
- data/lib/fog/compute/xen_server/models/network.rb +9 -40
- data/lib/fog/compute/xen_server/models/networks.rb +1 -1
- data/lib/fog/compute/xen_server/models/pbd.rb +4 -7
- data/lib/fog/compute/xen_server/models/pbds.rb +1 -1
- data/lib/fog/compute/xen_server/models/pci.rb +4 -3
- data/lib/fog/compute/xen_server/models/pcis.rb +1 -1
- data/lib/fog/compute/xen_server/models/pgpu.rb +5 -4
- data/lib/fog/compute/xen_server/models/pgpus.rb +1 -1
- data/lib/fog/compute/xen_server/models/pif.rb +27 -16
- data/lib/fog/compute/xen_server/models/pif_metrics.rb +2 -1
- data/lib/fog/compute/xen_server/models/pifs.rb +1 -1
- data/lib/fog/compute/xen_server/models/pifs_metrics.rb +4 -2
- data/lib/fog/compute/xen_server/models/pool.rb +24 -6
- data/lib/fog/compute/xen_server/models/pool_patch.rb +3 -2
- data/lib/fog/compute/xen_server/models/pool_patchs.rb +1 -1
- data/lib/fog/compute/xen_server/models/pools.rb +1 -1
- data/lib/fog/compute/xen_server/models/role.rb +3 -2
- data/lib/fog/compute/xen_server/models/roles.rb +2 -2
- data/lib/fog/compute/xen_server/models/server.rb +89 -118
- data/lib/fog/compute/xen_server/models/server_appliance.rb +3 -2
- data/lib/fog/compute/xen_server/models/server_appliances.rb +1 -1
- data/lib/fog/compute/xen_server/models/server_metrics.rb +7 -6
- data/lib/fog/compute/xen_server/models/servers.rb +4 -4
- data/lib/fog/compute/xen_server/models/servers_metrics.rb +1 -1
- data/lib/fog/compute/xen_server/models/storage_manager.rb +2 -1
- data/lib/fog/compute/xen_server/models/storage_managers.rb +1 -1
- data/lib/fog/compute/xen_server/models/storage_repositories.rb +1 -1
- data/lib/fog/compute/xen_server/models/storage_repository.rb +17 -44
- data/lib/fog/compute/xen_server/models/tunnel.rb +4 -3
- data/lib/fog/compute/xen_server/models/tunnels.rb +1 -1
- data/lib/fog/compute/xen_server/models/vbd.rb +29 -28
- data/lib/fog/compute/xen_server/models/vbd_metrics.rb +3 -7
- data/lib/fog/compute/xen_server/models/vbds.rb +1 -1
- data/lib/fog/compute/xen_server/models/vbds_metrics.rb +1 -1
- data/lib/fog/compute/xen_server/models/vdi.rb +22 -34
- data/lib/fog/compute/xen_server/models/vdis.rb +1 -1
- data/lib/fog/compute/xen_server/models/vif.rb +17 -20
- data/lib/fog/compute/xen_server/models/vif_metrics.rb +2 -1
- data/lib/fog/compute/xen_server/models/vifs.rb +1 -1
- data/lib/fog/compute/xen_server/models/vifs_metrics.rb +1 -1
- data/lib/fog/compute/xen_server/models/vlan.rb +5 -44
- data/lib/fog/compute/xen_server/models/vlans.rb +1 -1
- data/lib/fog/compute/xen_server/models/vmpp.rb +3 -2
- data/lib/fog/compute/xen_server/models/vmpps.rb +1 -1
- data/lib/fog/compute/xen_server/models/vtpm.rb +4 -3
- data/lib/fog/compute/xen_server/models/vtpms.rb +1 -1
- data/lib/fog/compute/xen_server/real.rb +11 -1
- data/lib/fog/compute/xen_server/requests/add_ipv4_allowed_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/add_ipv6_allowed_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/add_to_vcpus_params_live_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/apply_edition_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/apply_edition_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/assert_agile_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/assert_attachable_vbd.rb +11 -0
- data/lib/fog/compute/xen_server/requests/assert_can_be_recovered_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/assert_can_boot_here_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/assert_can_evacuate_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/assert_can_host_ha_statefile_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/assert_can_migrate_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/assert_operation_valid_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/assert_supports_database_replication_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/backup_rrds_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/bugreport_upload_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/builtin_templates.rb +1 -7
- data/lib/fog/compute/xen_server/requests/call_plugin_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/certificate_install_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/certificate_list_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/certificate_sync_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/certificate_uninstall_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/checkpoint_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/clean_reboot_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/clean_shutdown_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/clone_server.rb +4 -18
- data/lib/fog/compute/xen_server/requests/clone_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/compute_free_memory_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/compute_memory_overhead_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/compute_memory_overhead_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/copy_bios_strings_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/copy_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/copy_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/create_network.rb +2 -28
- data/lib/fog/compute/xen_server/requests/create_new_blob_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/create_new_blob_network.rb +11 -0
- data/lib/fog/compute/xen_server/requests/create_new_blob_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/create_new_blob_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/create_new_blob_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/create_server.rb +3 -107
- data/lib/fog/compute/xen_server/requests/create_sr.rb +5 -57
- data/lib/fog/compute/xen_server/requests/create_vbd.rb +2 -26
- data/lib/fog/compute/xen_server/requests/create_vdi.rb +2 -19
- data/lib/fog/compute/xen_server/requests/create_vif.rb +2 -43
- data/lib/fog/compute/xen_server/requests/create_vlan.rb +3 -21
- data/lib/fog/compute/xen_server/requests/create_vlan_from_pif_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/create_vlan_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/crl_install_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/crl_list_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/crl_uninstall_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/custom_templates.rb +0 -6
- data/lib/fog/compute/xen_server/requests/db_forget_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/db_forget_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/db_introduce_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/db_introduce_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/declare_dead_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/designate_new_master_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/destroy_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/destroy_record.rb +11 -0
- data/lib/fog/compute/xen_server/requests/destroy_sr.rb +3 -17
- data/lib/fog/compute/xen_server/requests/detect_nonhomogeneous_external_auth_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/disable_database_replication_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/disable_external_auth_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/disable_external_auth_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/disable_ha_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/disable_host.rb +4 -16
- data/lib/fog/compute/xen_server/requests/disable_local_storage_caching_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/disable_local_storage_caching_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/disable_redo_log_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/dmesg_clear_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/dmesg_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/eject_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/eject_vbd.rb +3 -9
- data/lib/fog/compute/xen_server/requests/emergency_ha_disable_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/emergency_reset_master_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/emergency_transition_to_master_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/enable_database_replication_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/enable_external_auth_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/enable_external_auth_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/enable_ha_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/enable_host.rb +4 -15
- data/lib/fog/compute/xen_server/requests/enable_local_storage_caching_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/enable_local_storage_caching_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/enable_redo_log_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/evacuate_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/forget_data_source_archives_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/forget_data_source_archives_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/forget_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/forget_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/forget_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_allowed_vbd_devices_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/get_allowed_vif_devices_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/get_boot_record_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/get_data_sources_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_data_sources_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/get_license_state_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_log_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_management_interface_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_possible_hosts_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/get_record.rb +4 -22
- data/lib/fog/compute/xen_server/requests/get_records.rb +5 -14
- data/lib/fog/compute/xen_server/requests/get_server_certificate_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_server_localtime_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_servertime_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_supported_types_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_system_status_capabilities_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/get_vms_which_prevent_evacuation_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/ha_compute_hypothetical_max_host_failures_to_tolerate_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/ha_compute_max_host_failures_to_tolerate_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/ha_compute_vm_failover_plan_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/ha_failover_plan_exists_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/ha_prevent_restarts_for_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/hard_reboot_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/hard_shutdown_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/import_convert_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/insert_vbd.rb +3 -9
- data/lib/fog/compute/xen_server/requests/introduce_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/introduce_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/introduce_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/join_force_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/join_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/list_methods_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/local_management_reconfigure_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/management_disable_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/management_reconfigure_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/maximise_memory_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/migrate_receive_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/migrate_send_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/open_database_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/pause_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/plug_pbd.rb +11 -0
- data/lib/fog/compute/xen_server/requests/plug_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/plug_vbd.rb +11 -0
- data/lib/fog/compute/xen_server/requests/plug_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/pool_migrate_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/pool_migrate_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/power_on_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/power_state_reset_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/probe_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/provision_server.rb +4 -8
- data/lib/fog/compute/xen_server/requests/query_data_source_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/query_data_source_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/query_services_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/read_database_pool_uuid_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/reboot_host.rb +3 -9
- data/lib/fog/compute/xen_server/requests/reboot_server.rb +13 -5
- data/lib/fog/compute/xen_server/requests/reconfigure_ip_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/reconfigure_ipv6_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/record_data_source_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/record_data_source_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/recover_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/recover_slaves_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/refresh_pack_info_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/remove_ipv4_allowed_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/remove_ipv6_allowed_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/reset_cpu_features_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/resize_online_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/resize_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/restart_agent_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/resume_on_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/resume_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/revert_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/revert_to_server.rb +18 -0
- data/lib/fog/compute/xen_server/requests/scan_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/scan_sr.rb +3 -9
- data/lib/fog/compute/xen_server/requests/send_debug_keys_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/send_sysrq_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/send_test_post_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/send_trigger_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_affinity.rb +1 -7
- data/lib/fog/compute/xen_server/requests/set_allow_caching_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_appliance_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_attribute.rb +1 -7
- data/lib/fog/compute/xen_server/requests/set_cpu_features_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_default_locking_mode_network.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_device_config_pbd.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_ha_host_failures_to_tolerate_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_ha_restart_priority_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_hostname_live_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_hvm_shadow_multiplier_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_ipv4_allowed_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_ipv6_allowed_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_is_a_snapshot_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_locking_mode_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_managed_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_memory_dynamic_max_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_memory_dynamic_min_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_memory_dynamic_range_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_memory_limits_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_memory_static_max_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_memory_static_min_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_memory_static_range_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_metadata_of_pool_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_missing_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_name_description_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_name_description_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_name_label_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_name_label_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_on_boot_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_order_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_physical_size_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_physical_utilisation_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_physical_utilisation_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_power_on_mode_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_primary_address_type_pif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_protection_policy_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_read_only_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_shadow_multiplier_live_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_sharable_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_shared_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_shutdown_delay_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_snapshot_of_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_snapshot_time_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_start_delay_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_suspend_vdi_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_vcpus_at_startup_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_vcpus_max_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_vcpus_number_live_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/set_virtual_allocation_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_virtual_size_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/set_vswitch_controller_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/shutdown_agent_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/shutdown_host.rb +3 -9
- data/lib/fog/compute/xen_server/requests/shutdown_server.rb +5 -8
- data/lib/fog/compute/xen_server/requests/snapshot_server.rb +4 -8
- data/lib/fog/compute/xen_server/requests/snapshot_vdi.rb +11 -0
- data/lib/fog/compute/xen_server/requests/snapshot_with_quiesce_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/snapshots.rb +15 -0
- data/lib/fog/compute/xen_server/requests/start_on_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/start_server.rb +4 -8
- data/lib/fog/compute/xen_server/requests/suspend_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/sync_data_host.rb +11 -0
- data/lib/fog/compute/xen_server/requests/sync_database_pool.rb +11 -0
- data/lib/fog/compute/xen_server/requests/templates.rb +0 -6
- data/lib/fog/compute/xen_server/requests/unpause_server.rb +13 -0
- data/lib/fog/compute/xen_server/requests/unplug_force_vbd.rb +11 -0
- data/lib/fog/compute/xen_server/requests/unplug_pbd.rb +3 -12
- data/lib/fog/compute/xen_server/requests/unplug_vbd.rb +3 -17
- data/lib/fog/compute/xen_server/requests/unplug_vif.rb +11 -0
- data/lib/fog/compute/xen_server/requests/update_sr.rb +11 -0
- data/lib/fog/compute/xen_server/requests/update_vdi.rb +11 -0
- data/lib/fog/parsers/xen_server.rb +0 -7
- data/lib/fog/xen_server/connection.rb +1 -0
- data/lib/fog/xen_server/version.rb +1 -1
- data/lib/fog/xenserver.rb +0 -2
- data/spec/cassettes/builtin_templates.yml +48 -0
- data/spec/cassettes/clone_server.yml +130 -0
- data/spec/cassettes/create_network.yml +87 -0
- data/spec/cassettes/create_server_create_vm.yml +144 -0
- data/spec/cassettes/create_server_get_all_hosts.yml +59 -0
- data/spec/cassettes/create_server_open_connection.yml +45 -0
- data/spec/cassettes/create_vbd_create_vbd.yml +173 -0
- data/spec/cassettes/create_vbd_create_vdi.yml +132 -0
- data/spec/cassettes/create_vbd_create_vm.yml +144 -0
- data/spec/cassettes/create_vbd_get_all_hosts.yml +59 -0
- data/spec/cassettes/create_vbd_get_storage_repository.yml +89 -0
- data/spec/cassettes/create_vbd_open_connection.yml +45 -0
- data/spec/cassettes/create_vdi.yml +132 -0
- data/spec/cassettes/create_vif_create_vif.yml +173 -0
- data/spec/cassettes/create_vif_get_network_by_name.yml +88 -0
- data/spec/cassettes/create_vif_open_connection.yml +45 -0
- data/spec/cassettes/create_vif_vif_set_device_number.yml +89 -0
- data/spec/cassettes/get_all_hosts.yml +73 -0
- data/spec/cassettes/get_network_by_name.yml +88 -0
- data/spec/cassettes/get_storage_repository.yml +89 -0
- data/spec/cassettes/get_vm_by_name.yml +130 -0
- data/spec/cassettes/open_connection.yml +45 -0
- data/spec/cassettes/sync_database_pool.yml +129 -0
- data/spec/cassettes/vif_set_device_number.yml +342 -0
- data/spec/fog/compute/xen_server/models/blob_spec.rb +63 -0
- data/spec/fog/compute/xen_server/models/blobs_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/bond_spec.rb +63 -0
- data/spec/fog/compute/xen_server/models/bonds_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/console_spec.rb +57 -0
- data/spec/fog/compute/xen_server/models/consoles_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/crash_dump_spec.rb +56 -0
- data/spec/fog/compute/xen_server/models/crash_dumps_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/dr_task_spec.rb +51 -0
- data/spec/fog/compute/xen_server/models/dr_tasks_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/gpu_group_spec.rb +65 -0
- data/spec/fog/compute/xen_server/models/gpu_groups_spec.rb +9 -0
- data/{test/fog/compute/xen_server/models/guest_metrics_test.rb → spec/fog/compute/xen_server/models/guest_metrics_spec.rb} +32 -5
- data/spec/fog/compute/xen_server/models/guests_metrics_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/host_cpu_spec.rb +73 -0
- data/spec/fog/compute/xen_server/models/host_cpus_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/host_crash_dump_spec.rb +57 -0
- data/spec/fog/compute/xen_server/models/host_crash_dumps_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/host_metrics_spec.rb +72 -0
- data/spec/fog/compute/xen_server/models/host_patch_spec.rb +68 -0
- data/spec/fog/compute/xen_server/models/host_patchs_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/host_spec.rb +231 -0
- data/spec/fog/compute/xen_server/models/hosts_metrics_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/hosts_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/network_spec.rb +79 -0
- data/spec/fog/compute/xen_server/models/networks_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/pbd_spec.rb +67 -0
- data/spec/fog/compute/xen_server/models/pbds_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/pci_spec.rb +61 -0
- data/spec/fog/compute/xen_server/models/pcis_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/pgpu_spec.rb +58 -0
- data/spec/fog/compute/xen_server/models/pgpus_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/pif_metrics_spec.rb +74 -0
- data/spec/fog/compute/xen_server/models/pif_spec.rb +118 -0
- data/spec/fog/compute/xen_server/models/pifs_metrics_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/pifs_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/pool_patch_spec.rb +66 -0
- data/spec/fog/compute/xen_server/models/pool_patchs_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/pool_spec.rb +106 -0
- data/spec/fog/compute/xen_server/models/pools_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/role_spec.rb +56 -0
- data/spec/fog/compute/xen_server/models/roles_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/server_appliance_spec.rb +61 -0
- data/spec/fog/compute/xen_server/models/server_appliances_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/server_metrics_spec.rb +76 -0
- data/spec/fog/compute/xen_server/models/server_spec.rb +554 -0
- data/spec/fog/compute/xen_server/models/servers_metrics_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/servers_spec.rb +9 -0
- data/{test/fog/compute/xen_server/models/storage_manger_test.rb → spec/fog/compute/xen_server/models/storage_manager_spec.rb} +34 -5
- data/spec/fog/compute/xen_server/models/storage_managers_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/storage_repositories_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/storage_repository_spec.rb +92 -0
- data/spec/fog/compute/xen_server/models/tunnel_spec.rb +57 -0
- data/spec/fog/compute/xen_server/models/tunnels_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/vbd_metrics_spec.rb +70 -0
- data/spec/fog/compute/xen_server/models/vbd_spec.rb +194 -0
- data/spec/fog/compute/xen_server/models/vbds_metrics_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/vbds_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/vdi_spec.rb +162 -0
- data/spec/fog/compute/xen_server/models/vdis_spec.rb +9 -0
- data/{test/fog/compute/xen_server/models/vif_metrics_test.rb → spec/fog/compute/xen_server/models/vif_metrics_spec.rb} +26 -5
- data/spec/fog/compute/xen_server/models/vif_spec.rb +141 -0
- data/spec/fog/compute/xen_server/models/vifs_metrics_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/vifs_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/vlan_spec.rb +58 -0
- data/spec/fog/compute/xen_server/models/vlans_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/vmpp_spec.rb +89 -0
- data/spec/fog/compute/xen_server/models/vmpps_spec.rb +9 -0
- data/spec/fog/compute/xen_server/models/vtpm_spec.rb +53 -0
- data/spec/fog/compute/xen_server/models/vtpms_spec.rb +9 -0
- data/spec/fog/compute/xen_server/requests/builtin_templates_spec.rb +18 -0
- data/spec/fog/compute/xen_server/requests/clone_server_spec.rb +36 -0
- data/spec/fog/compute/xen_server/requests/create_network_spec.rb +24 -0
- data/spec/fog/compute/xen_server/requests/create_server_spec.rb +30 -0
- data/spec/fog/compute/xen_server/requests/create_vbd_spec.rb +45 -0
- data/spec/fog/compute/xen_server/requests/create_vdi_spec.rb +27 -0
- data/spec/fog/compute/xen_server/requests/create_vif_spec.rb +46 -0
- data/spec/fog/compute/xen_server/requests/sync_database_pool_spec.rb +16 -0
- data/spec/fog/compute/xen_server_spec.rb +13 -0
- data/{test → spec}/minitest_helper.rb +17 -5
- metadata +470 -94
- data/lib/fog.rb +0 -3
- data/lib/fog/collection.rb +0 -37
- data/lib/fog/compute/xen_server/requests/destroy_network.rb +0 -28
- data/lib/fog/compute/xen_server/requests/destroy_server.rb +0 -17
- data/lib/fog/compute/xen_server/requests/destroy_vdi.rb +0 -17
- data/lib/fog/compute/xen_server/requests/destroy_vif.rb +0 -17
- data/lib/fog/compute/xen_server/requests/destroy_vlan.rb +0 -27
- data/lib/fog/compute/xen_server/requests/snapshot_revert.rb +0 -17
- data/lib/fog/compute/xen_server/requests/start_vm.rb +0 -19
- data/lib/fog/model.rb +0 -48
- data/lib/fog/parsers/xen_server/get_hosts.rb +0 -16
- data/lib/fog/parsers/xen_server/get_networks.rb +0 -16
- data/lib/fog/parsers/xen_server/get_pools.rb +0 -16
- data/lib/fog/parsers/xen_server/get_storage_repositories.rb +0 -16
- data/lib/fog/parsers/xen_server/get_vbds.rb +0 -16
- data/lib/fog/parsers/xen_server/get_vifs.rb +0 -16
- data/lib/fog/parsers/xen_server/get_vms.rb +0 -16
- data/test/fog/compute/xen_server/models/blob_test.rb +0 -40
- data/test/fog/compute/xen_server/models/bond_test.rb +0 -42
- data/test/fog/compute/xen_server/models/console_test.rb +0 -38
- data/test/fog/compute/xen_server/models/crash_dump_test.rb +0 -39
- data/test/fog/compute/xen_server/models/dr_task_test.rb +0 -35
- data/test/fog/compute/xen_server/models/gpu_group_test.rb +0 -45
- data/test/fog/compute/xen_server/models/host_cpu_test.rb +0 -46
- data/test/fog/compute/xen_server/models/host_crash_dump_test.rb +0 -37
- data/test/fog/compute/xen_server/models/host_metrics_test.rb +0 -38
- data/test/fog/compute/xen_server/models/host_patch_test.rb +0 -45
- data/test/fog/compute/xen_server/models/host_test.rb +0 -102
- data/test/fog/compute/xen_server/models/network_test.rb +0 -51
- data/test/fog/compute/xen_server/models/pbd_test.rb +0 -40
- data/test/fog/compute/xen_server/models/pci_test.rb +0 -40
- data/test/fog/compute/xen_server/models/pgpu_test.rb +0 -41
- data/test/fog/compute/xen_server/models/pif_metrics_test.rb +0 -45
- data/test/fog/compute/xen_server/models/pif_test.rb +0 -81
- data/test/fog/compute/xen_server/models/pool_patch_test.rb +0 -43
- data/test/fog/compute/xen_server/models/pool_test.rb +0 -69
- data/test/fog/compute/xen_server/models/role_test.rb +0 -38
- data/test/fog/compute/xen_server/models/server_appliance_test.rb +0 -41
- data/test/fog/compute/xen_server/models/server_metrics_test.rb +0 -48
- data/test/fog/compute/xen_server/models/server_test.rb +0 -149
- data/test/fog/compute/xen_server/models/storage_repository_test.rb +0 -56
- data/test/fog/compute/xen_server/models/tunnel_test.rb +0 -40
- data/test/fog/compute/xen_server/models/vbd_metrics_test.rb +0 -37
- data/test/fog/compute/xen_server/models/vbd_test.rb +0 -58
- data/test/fog/compute/xen_server/models/vdi_test.rb +0 -71
- data/test/fog/compute/xen_server/models/vif_test.rb +0 -59
- data/test/fog/compute/xen_server/models/vlan_test.rb +0 -40
- data/test/fog/compute/xen_server/models/vmpp_test.rb +0 -55
- data/test/fog/compute/xen_server/models/vtpm_test.rb +0 -36
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::PifsMetrics do
|
4
|
+
let(:pifs_metrics_class) { Fog::Compute::XenServer::Models::PifsMetrics }
|
5
|
+
|
6
|
+
it 'should be a collection of PifsMetrics' do
|
7
|
+
pifs_metrics_class.model.must_equal(Fog::Compute::XenServer::Models::PifMetrics)
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::PoolPatch do
|
4
|
+
let(:pool_patch_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::PoolPatch
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Fog::Compute::XenServer::Models::PoolPatch
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should associate to a provider class' do
|
14
|
+
pool_patch_class.provider_class.must_equal('pool_patch')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should have a collection name' do
|
18
|
+
pool_patch_class.collection_name.must_equal(:pool_patchs)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
pool_patch_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 9 attributes' do
|
26
|
+
pool_patch_class.attributes.must_equal([ :reference,
|
27
|
+
:after_apply_guidance,
|
28
|
+
:description,
|
29
|
+
:name,
|
30
|
+
:other_config,
|
31
|
+
:pool_applied,
|
32
|
+
:size,
|
33
|
+
:uuid,
|
34
|
+
:version ])
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should have 1 association' do
|
38
|
+
pool_patch_class.associations.must_equal(:host_patches => :host_patchs)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should have 10 masks' do
|
42
|
+
pool_patch_class.masks.must_equal(:reference => :reference,
|
43
|
+
:after_apply_guidance => :after_apply_guidance,
|
44
|
+
:description => :description,
|
45
|
+
:name => :name,
|
46
|
+
:other_config => :other_config,
|
47
|
+
:pool_applied => :pool_applied,
|
48
|
+
:size => :size,
|
49
|
+
:uuid => :uuid,
|
50
|
+
:version => :version,
|
51
|
+
:host_patches => :host_patches)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should have 2 aliases' do
|
55
|
+
pool_patch_class.aliases.must_equal(:name_description => :description,
|
56
|
+
:name_label => :name)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "shouldn't have default values" do
|
60
|
+
pool_patch_class.default_values.must_equal({})
|
61
|
+
end
|
62
|
+
|
63
|
+
it "shouldn't require attributes before save" do
|
64
|
+
pool_patch_class.require_before_save.must_equal([])
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::PoolPatchs do
|
4
|
+
let(:pool_patchs_class) { Fog::Compute::XenServer::Models::PoolPatchs }
|
5
|
+
|
6
|
+
it 'should be a collection of PoolPatchs' do
|
7
|
+
pool_patchs_class.model.must_equal(Fog::Compute::XenServer::Models::PoolPatch)
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Pool do
|
4
|
+
let(:pool_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::Pool
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Fog::Compute::XenServer::Models::Pool
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should associate to a provider class' do
|
14
|
+
pool_class.provider_class.must_equal('pool')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should have a collection name' do
|
18
|
+
pool_class.collection_name.must_equal(:pools)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
pool_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 23 attributes' do
|
26
|
+
pool_class.attributes.must_equal([ :reference,
|
27
|
+
:blobs,
|
28
|
+
:description,
|
29
|
+
:gui_config,
|
30
|
+
:ha_allow_overcommit,
|
31
|
+
:ha_configuration,
|
32
|
+
:ha_enabled,
|
33
|
+
:ha_host_failures_to_tolerate,
|
34
|
+
:ha_overcommitted,
|
35
|
+
:ha_plan_exists_for,
|
36
|
+
:ha_statefiles,
|
37
|
+
:name,
|
38
|
+
:other_config,
|
39
|
+
:redo_log_enabled,
|
40
|
+
:redo_log_vdi,
|
41
|
+
:restrictions,
|
42
|
+
:tags,
|
43
|
+
:uuid,
|
44
|
+
:vswitch_controller,
|
45
|
+
:wlb_enabled,
|
46
|
+
:wlb_url,
|
47
|
+
:wlb_username,
|
48
|
+
:wlb_verify_cert ])
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should have 5 associations' do
|
52
|
+
pool_class.associations.must_equal(:crash_dump_sr => :storage_repositories,
|
53
|
+
:default_sr => :storage_repositories,
|
54
|
+
:master => :hosts,
|
55
|
+
:metadata_vdis => :vdis,
|
56
|
+
:suspend_image_sr => :storage_repositories)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should have 28 masks' do
|
60
|
+
pool_class.masks.must_equal(:reference => :reference,
|
61
|
+
:blobs => :blobs,
|
62
|
+
:description => :description,
|
63
|
+
:gui_config => :gui_config,
|
64
|
+
:ha_allow_overcommit => :ha_allow_overcommit,
|
65
|
+
:ha_configuration => :ha_configuration,
|
66
|
+
:ha_enabled => :ha_enabled,
|
67
|
+
:ha_host_failures_to_tolerate => :ha_host_failures_to_tolerate,
|
68
|
+
:ha_overcommitted => :ha_overcommitted,
|
69
|
+
:ha_plan_exists_for => :ha_plan_exists_for,
|
70
|
+
:ha_statefiles => :ha_statefiles,
|
71
|
+
:name => :name,
|
72
|
+
:other_config => :other_config,
|
73
|
+
:redo_log_enabled => :redo_log_enabled,
|
74
|
+
:redo_log_vdi => :redo_log_vdi,
|
75
|
+
:restrictions => :restrictions,
|
76
|
+
:tags => :tags,
|
77
|
+
:uuid => :uuid,
|
78
|
+
:vswitch_controller => :vswitch_controller,
|
79
|
+
:wlb_enabled => :wlb_enabled,
|
80
|
+
:wlb_url => :wlb_url,
|
81
|
+
:wlb_username => :wlb_username,
|
82
|
+
:wlb_verify_cert => :wlb_verify_cert,
|
83
|
+
:crash_dump_sr => :crash_dump_SR,
|
84
|
+
:default_sr => :default_SR,
|
85
|
+
:master => :master,
|
86
|
+
:metadata_vdis => :metadata_VDIs,
|
87
|
+
:suspend_image_sr => :suspend_image_SR)
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should have 6 aliases' do
|
91
|
+
pool_class.aliases.must_equal(:name_label => :name,
|
92
|
+
:name_description => :description,
|
93
|
+
:crash_dump_SR => :crash_dump_sr,
|
94
|
+
:default_SR => :default_sr,
|
95
|
+
:metadata_VDIs => :metadata_vdis,
|
96
|
+
:suspend_image_SR => :suspend_image_sr)
|
97
|
+
end
|
98
|
+
|
99
|
+
it "shouldn't have default values" do
|
100
|
+
pool_class.default_values.must_equal({})
|
101
|
+
end
|
102
|
+
|
103
|
+
it "shouldn't require attributes before save" do
|
104
|
+
pool_class.require_before_save.must_equal([])
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Pools do
|
4
|
+
let(:pools_class) { Fog::Compute::XenServer::Models::Pools }
|
5
|
+
|
6
|
+
it 'should be a collection of Pools' do
|
7
|
+
pools_class.model.must_equal(Fog::Compute::XenServer::Models::Pool)
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Role do
|
4
|
+
let(:role_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::Role
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Fog::Compute::XenServer::Models::Role
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should associate to a provider class' do
|
14
|
+
role_class.provider_class.must_equal('role')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should have a collection name' do
|
18
|
+
role_class.collection_name.must_equal(:roles)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
role_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 4 attributes' do
|
26
|
+
role_class.attributes.must_equal([ :reference,
|
27
|
+
:description,
|
28
|
+
:name,
|
29
|
+
:uuid ])
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should have 1 association' do
|
33
|
+
role_class.associations.must_equal(:subroles => :roles)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should have 5 masks' do
|
37
|
+
role_class.masks.must_equal(:reference => :reference,
|
38
|
+
:description => :description,
|
39
|
+
:name => :name,
|
40
|
+
:uuid => :uuid,
|
41
|
+
:subroles => :subroles)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should have 2 aliases' do
|
45
|
+
role_class.aliases.must_equal({ :name_description => :description,
|
46
|
+
:name_label => :name })
|
47
|
+
end
|
48
|
+
|
49
|
+
it "shouldn't have default values" do
|
50
|
+
role_class.default_values.must_equal({})
|
51
|
+
end
|
52
|
+
|
53
|
+
it "shouldn't require attributes before save" do
|
54
|
+
role_class.require_before_save.must_equal([])
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Roles do
|
4
|
+
let(:roles_class) { Fog::Compute::XenServer::Models::Roles }
|
5
|
+
|
6
|
+
it 'should be a collection of Roles' do
|
7
|
+
roles_class.model.must_equal(Fog::Compute::XenServer::Models::Role)
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::ServerAppliance do
|
4
|
+
let(:server_appliance_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::ServerAppliance
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Fog::Compute::XenServer::Models::ServerAppliance
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should associate to a provider class' do
|
14
|
+
server_appliance_class.provider_class.must_equal('VM_appliance')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should have a collection name' do
|
18
|
+
server_appliance_class.collection_name.must_equal(:server_appliances)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
server_appliance_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 6 attributes' do
|
26
|
+
server_appliance_class.attributes.must_equal([ :reference,
|
27
|
+
:allowed_operations,
|
28
|
+
:current_operations,
|
29
|
+
:description,
|
30
|
+
:name,
|
31
|
+
:uuid ])
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should have 1 association' do
|
35
|
+
server_appliance_class.associations.must_equal(:vms => :servers)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should have 7 masks' do
|
39
|
+
server_appliance_class.masks.must_equal(:reference => :reference,
|
40
|
+
:allowed_operations => :allowed_operations,
|
41
|
+
:current_operations => :current_operations,
|
42
|
+
:description => :description,
|
43
|
+
:name => :name,
|
44
|
+
:uuid => :uuid,
|
45
|
+
:vms => :VMs)
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should have 3 aliases' do
|
49
|
+
server_appliance_class.aliases.must_equal(:name_description => :description,
|
50
|
+
:name_label => :name,
|
51
|
+
:VMs => :vms)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "shouldn't have default values" do
|
55
|
+
server_appliance_class.default_values.must_equal({})
|
56
|
+
end
|
57
|
+
|
58
|
+
it "shouldn't require attributes before save" do
|
59
|
+
server_appliance_class.require_before_save.must_equal([])
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::ServerAppliances do
|
4
|
+
let(:server_appliances_class) { Fog::Compute::XenServer::Models::ServerAppliances }
|
5
|
+
|
6
|
+
it 'should be a collection of ServerAppliances' do
|
7
|
+
server_appliances_class.model.must_equal(Fog::Compute::XenServer::Models::ServerAppliance)
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::ServerMetrics do
|
4
|
+
let(:server_metrics_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::ServerMetrics
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Fog::Compute::XenServer::Models::ServerMetrics
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should associate to a provider class' do
|
14
|
+
server_metrics_class.provider_class.must_equal('VM_metrics')
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should have a collection name' do
|
18
|
+
server_metrics_class.collection_name.must_equal(:servers_metrics)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
server_metrics_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 13 attributes' do
|
26
|
+
server_metrics_class.attributes.must_equal([ :reference,
|
27
|
+
:install_time,
|
28
|
+
:last_updated,
|
29
|
+
:memory_actual,
|
30
|
+
:other_config,
|
31
|
+
:start_time,
|
32
|
+
:state,
|
33
|
+
:uuid,
|
34
|
+
:vcpus_cpu,
|
35
|
+
:vcpus_flags,
|
36
|
+
:vcpus_number,
|
37
|
+
:vcpus_params,
|
38
|
+
:vcpus_utilisation ])
|
39
|
+
end
|
40
|
+
|
41
|
+
it "shouldn't have associations" do
|
42
|
+
server_metrics_class.associations.must_equal({})
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should have 13 masks' do
|
46
|
+
server_metrics_class.masks.must_equal(:reference => :reference,
|
47
|
+
:install_time => :install_time,
|
48
|
+
:last_updated => :last_updated,
|
49
|
+
:memory_actual => :memory_actual,
|
50
|
+
:other_config => :other_config,
|
51
|
+
:start_time => :start_time,
|
52
|
+
:state => :state,
|
53
|
+
:uuid => :uuid,
|
54
|
+
:vcpus_cpu => :VCPUs_CPU,
|
55
|
+
:vcpus_flags => :VCPUs_flags,
|
56
|
+
:vcpus_number => :VCPUs_number,
|
57
|
+
:vcpus_params => :VCPUs_params,
|
58
|
+
:vcpus_utilisation => :VCPUs_utilisation)
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should have 6 aliases' do
|
62
|
+
server_metrics_class.aliases.must_equal(:VCPUs_CPU => :vcpus_cpu,
|
63
|
+
:VCPUs_flags => :vcpus_flags,
|
64
|
+
:VCPUs_number => :vcpus_number,
|
65
|
+
:VCPUs_params => :vcpus_params,
|
66
|
+
:VCPUs_utilisation => :vcpus_utilisation)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "shouldn't have default values" do
|
70
|
+
server_metrics_class.default_values.must_equal({})
|
71
|
+
end
|
72
|
+
|
73
|
+
it "shouldn't require attributes before save" do
|
74
|
+
server_metrics_class.require_before_save.must_equal([])
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,554 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Server do
|
4
|
+
let(:server_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::Server
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Fog::Compute::XenServer::Models::Server
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:server) { Fog::Compute::XenServer::Models::Server.new }
|
14
|
+
let(:service) { Object.new }
|
15
|
+
let(:collection) { Object.new }
|
16
|
+
let(:vif) { Fog::Compute::XenServer::Models::Vif.new }
|
17
|
+
let(:vbd) { Fog::Compute::XenServer::Models::Vbd.new }
|
18
|
+
|
19
|
+
it 'should associate to a provider class' do
|
20
|
+
server_class.provider_class.must_equal('VM')
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should have a collection name' do
|
24
|
+
server_class.collection_name.must_equal(:servers)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should have an unique id' do
|
28
|
+
server_class.read_identity.must_equal(:reference)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should have 57 attributes' do
|
32
|
+
server_class.attributes.must_equal([ :reference,
|
33
|
+
:actions_after_crash,
|
34
|
+
:actions_after_reboot,
|
35
|
+
:actions_after_shutdown,
|
36
|
+
:allowed_operations,
|
37
|
+
:blobs,
|
38
|
+
:blocked_operations,
|
39
|
+
:bios_strings,
|
40
|
+
:current_operations,
|
41
|
+
:domarch,
|
42
|
+
:domid,
|
43
|
+
:description,
|
44
|
+
:generation_id,
|
45
|
+
:ha_always_run,
|
46
|
+
:ha_restart_priority,
|
47
|
+
:hvm_boot_params,
|
48
|
+
:hvm_boot_policy,
|
49
|
+
:hvm_shadow_multiplier,
|
50
|
+
:is_a_snapshot,
|
51
|
+
:is_a_template,
|
52
|
+
:is_control_domain,
|
53
|
+
:is_snapshot_from_vmpp,
|
54
|
+
:last_booted_record,
|
55
|
+
:last_boot_cpu_flags,
|
56
|
+
:memory_dynamic_max,
|
57
|
+
:memory_dynamic_min,
|
58
|
+
:memory_overhead,
|
59
|
+
:memory_static_max,
|
60
|
+
:memory_static_min,
|
61
|
+
:memory_target,
|
62
|
+
:name,
|
63
|
+
:order,
|
64
|
+
:other_config,
|
65
|
+
:pci_bus,
|
66
|
+
:platform,
|
67
|
+
:power_state,
|
68
|
+
:pv_args,
|
69
|
+
:pv_bootloader,
|
70
|
+
:pv_bootloader_args,
|
71
|
+
:pv_kernel,
|
72
|
+
:pv_legacy_args,
|
73
|
+
:pv_ramdisk,
|
74
|
+
:recommendations,
|
75
|
+
:shutdown_delay,
|
76
|
+
:snapshot_info,
|
77
|
+
:snapshot_metadata,
|
78
|
+
:snapshot_time,
|
79
|
+
:start_delay,
|
80
|
+
:tags,
|
81
|
+
:transportable_snapshot_id,
|
82
|
+
:user_version,
|
83
|
+
:uuid,
|
84
|
+
:vcpus_at_startup,
|
85
|
+
:vcpus_max,
|
86
|
+
:vcpus_params,
|
87
|
+
:version,
|
88
|
+
:xenstore_data ])
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should have 19 associations' do
|
92
|
+
server_class.associations.must_equal(:affinity => :hosts,
|
93
|
+
:appliance => :server_appliances,
|
94
|
+
:attached_pcis => :pcis,
|
95
|
+
:children => :servers,
|
96
|
+
:consoles => :consoles,
|
97
|
+
:crash_dumps => :crash_dumps,
|
98
|
+
:guest_metrics => :guests_metrics,
|
99
|
+
:metrics => :servers_metrics,
|
100
|
+
:parent => :servers,
|
101
|
+
:protection_policy => :vmpps,
|
102
|
+
:resident_on => :hosts,
|
103
|
+
:snapshots => :servers,
|
104
|
+
:snapshot_of => :servers,
|
105
|
+
:suspend_sr => :storage_repositories,
|
106
|
+
:suspend_vdi => :vdis,
|
107
|
+
:vbds => :vbds,
|
108
|
+
:vgpus => :vgpus,
|
109
|
+
:vifs => :vifs,
|
110
|
+
:vtpms => :vtpms)
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'should have 76 masks' do
|
114
|
+
server_class.masks.must_equal(:reference => :reference,
|
115
|
+
:actions_after_crash => :actions_after_crash,
|
116
|
+
:actions_after_reboot => :actions_after_reboot,
|
117
|
+
:actions_after_shutdown => :actions_after_shutdown,
|
118
|
+
:allowed_operations => :allowed_operations,
|
119
|
+
:blobs => :blobs,
|
120
|
+
:blocked_operations => :blocked_operations,
|
121
|
+
:bios_strings => :bios_strings,
|
122
|
+
:current_operations => :current_operations,
|
123
|
+
:domarch => :domarch,
|
124
|
+
:domid => :domid,
|
125
|
+
:description => :name_description,
|
126
|
+
:generation_id => :generation_id,
|
127
|
+
:ha_always_run => :ha_always_run,
|
128
|
+
:ha_restart_priority => :ha_restart_priority,
|
129
|
+
:hvm_boot_params => :HVM_boot_params,
|
130
|
+
:hvm_boot_policy => :HVM_boot_policy,
|
131
|
+
:hvm_shadow_multiplier => :HVM_shadow_multiplier,
|
132
|
+
:is_a_snapshot => :is_a_snapshot,
|
133
|
+
:is_a_template => :is_a_template,
|
134
|
+
:is_control_domain => :is_control_domain,
|
135
|
+
:is_snapshot_from_vmpp => :is_snapshot_from_vmpp,
|
136
|
+
:last_booted_record => :last_booted_record,
|
137
|
+
:last_boot_cpu_flags => :last_boot_CPU_flags,
|
138
|
+
:memory_dynamic_max => :memory_dynamic_max,
|
139
|
+
:memory_dynamic_min => :memory_dynamic_min,
|
140
|
+
:memory_overhead => :memory_overhead,
|
141
|
+
:memory_static_max => :memory_static_max,
|
142
|
+
:memory_static_min => :memory_static_min,
|
143
|
+
:memory_target => :memory_target,
|
144
|
+
:name => :name_label,
|
145
|
+
:order => :order,
|
146
|
+
:other_config => :other_config,
|
147
|
+
:pci_bus => :PCI_bus,
|
148
|
+
:platform => :platform,
|
149
|
+
:power_state => :power_state,
|
150
|
+
:pv_args => :PV_args,
|
151
|
+
:pv_bootloader => :PV_bootloader,
|
152
|
+
:pv_bootloader_args => :PV_bootloader_args,
|
153
|
+
:pv_kernel => :PV_kernel,
|
154
|
+
:pv_legacy_args => :PV_legacy_args,
|
155
|
+
:pv_ramdisk => :PV_ramdisk,
|
156
|
+
:recommendations => :recommendations,
|
157
|
+
:shutdown_delay => :shutdown_delay,
|
158
|
+
:snapshot_info => :snapshot_info,
|
159
|
+
:snapshot_metadata => :snapshot_metadata,
|
160
|
+
:snapshot_time => :snapshot_time,
|
161
|
+
:start_delay => :start_delay,
|
162
|
+
:tags => :tags,
|
163
|
+
:transportable_snapshot_id => :transportable_snapshot_id,
|
164
|
+
:user_version => :user_version,
|
165
|
+
:uuid => :uuid,
|
166
|
+
:vcpus_at_startup => :VCPUs_at_startup,
|
167
|
+
:vcpus_max => :VCPUs_max,
|
168
|
+
:vcpus_params => :VCPUs_params,
|
169
|
+
:version => :version,
|
170
|
+
:xenstore_data => :xenstore_data,
|
171
|
+
:affinity => :affinity,
|
172
|
+
:appliance => :appliance,
|
173
|
+
:attached_pcis => :attached_PCIs,
|
174
|
+
:children => :children,
|
175
|
+
:consoles => :consoles,
|
176
|
+
:crash_dumps => :crash_dumps,
|
177
|
+
:guest_metrics => :guest_metrics,
|
178
|
+
:metrics => :metrics,
|
179
|
+
:parent => :parent,
|
180
|
+
:protection_policy => :protection_policy,
|
181
|
+
:resident_on => :resident_on,
|
182
|
+
:snapshots => :snapshots,
|
183
|
+
:snapshot_of => :snapshot_of,
|
184
|
+
:suspend_sr => :suspend_SR,
|
185
|
+
:suspend_vdi => :suspend_VDI,
|
186
|
+
:vbds => :VBDs,
|
187
|
+
:vgpus => :VGPUs,
|
188
|
+
:vifs => :VIFs,
|
189
|
+
:vtpms => :VTPMs)
|
190
|
+
end
|
191
|
+
|
192
|
+
it 'should have 23 aliases' do
|
193
|
+
server_class.aliases.must_equal(:attached_PCIs => :attached_pcis,
|
194
|
+
:name_label => :name,
|
195
|
+
:name_description => :description,
|
196
|
+
:last_boot_CPU_flags => :last_boot_cpu_flags,
|
197
|
+
:PV_args => :pv_args,
|
198
|
+
:PV_bootloader => :pv_bootloader,
|
199
|
+
:PV_bootloader_args => :pv_bootloader_args,
|
200
|
+
:PV_kernel => :pv_kernel,
|
201
|
+
:PV_ramdisk => :pv_ramdisk,
|
202
|
+
:PV_legacy_args => :pv_legacy_args,
|
203
|
+
:suspend_SR => :suspend_sr,
|
204
|
+
:suspend_VDI => :suspend_vdi,
|
205
|
+
:VBDs => :vbds,
|
206
|
+
:VCPUs_at_startup => :vcpus_at_startup,
|
207
|
+
:VCPUs_max => :vcpus_max,
|
208
|
+
:VCPUs_params => :vcpus_params,
|
209
|
+
:VGPUs => :vgpus,
|
210
|
+
:VIFs => :vifs,
|
211
|
+
:VTPMs => :vtpms,
|
212
|
+
:HVM_boot_policy => :hvm_boot_policy,
|
213
|
+
:HVM_boot_params => :hvm_boot_params,
|
214
|
+
:HVM_shadow_multiplier => :hvm_shadow_multiplier,
|
215
|
+
:PCI_bus => :pci_bus)
|
216
|
+
end
|
217
|
+
|
218
|
+
it 'should have 26 default values' do
|
219
|
+
server_class.default_values.must_equal(:actions_after_crash => 'Restart',
|
220
|
+
:actions_after_reboot => 'Restart',
|
221
|
+
:actions_after_shutdown => 'Destroy',
|
222
|
+
:description => '',
|
223
|
+
:hvm_boot_params => {},
|
224
|
+
:hvm_boot_policy => '',
|
225
|
+
:is_a_template => true,
|
226
|
+
:memory_dynamic_max => '536870912',
|
227
|
+
:memory_dynamic_min => '536870912',
|
228
|
+
:memory_static_max => '536870912',
|
229
|
+
:memory_static_min => '536870912',
|
230
|
+
:name => '',
|
231
|
+
:other_config => {},
|
232
|
+
:pci_bus => '',
|
233
|
+
:platform => { 'nx' => 'true',
|
234
|
+
'acpi' => 'true',
|
235
|
+
'apic' => 'true',
|
236
|
+
'pae' => 'true',
|
237
|
+
'viridian' => 'true' },
|
238
|
+
:pv_args => '-- quiet console=hvc0',
|
239
|
+
:pv_bootloader => 'pygrub',
|
240
|
+
:pv_bootloader_args => '',
|
241
|
+
:pv_kernel => '',
|
242
|
+
:pv_legacy_args => '',
|
243
|
+
:pv_ramdisk => '',
|
244
|
+
:recommendations => '',
|
245
|
+
:user_version => '0',
|
246
|
+
:vcpus_at_startup => '1',
|
247
|
+
:vcpus_max => '1',
|
248
|
+
:vcpus_params => {})
|
249
|
+
end
|
250
|
+
|
251
|
+
it 'should require 2 attributes before save' do
|
252
|
+
server_class.require_before_save.must_equal([ :name, :affinity ])
|
253
|
+
end
|
254
|
+
|
255
|
+
describe '#tools_installed?' do
|
256
|
+
describe 'when guest_metrics is nil' do
|
257
|
+
it 'should return false' do
|
258
|
+
server.stub(:guest_metrics, nil) do
|
259
|
+
server.tools_installed?.must_equal false
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
describe 'when guest_metrics is not nil' do
|
265
|
+
it 'should return true' do
|
266
|
+
server.stub(:guest_metrics, Object.new) do
|
267
|
+
server.tools_installed?.must_equal true
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
describe '#home_hypervisor' do
|
274
|
+
before :each do
|
275
|
+
def service.hosts
|
276
|
+
[ 1, 2 ]
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
it 'should return the first host' do
|
281
|
+
server.stub(:service, service) do
|
282
|
+
server.home_hypervisor.must_equal 1
|
283
|
+
end
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
describe '#mac_address' do
|
288
|
+
it 'should return the mac address of the first virtual interface' do
|
289
|
+
server.stub(:vifs, [ vif ]) do
|
290
|
+
vif.stub(:mac, 'mac') do
|
291
|
+
server.mac_address.must_equal 'mac'
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
describe '#running?' do
|
298
|
+
describe 'when it is running' do
|
299
|
+
before :each do
|
300
|
+
server.power_state = 'Running'
|
301
|
+
end
|
302
|
+
|
303
|
+
it 'should return true' do
|
304
|
+
server.stub(:reload, true) do
|
305
|
+
server.running?.must_equal true
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
describe 'when it is not running' do
|
311
|
+
before :each do
|
312
|
+
server.power_state = 'Anything'
|
313
|
+
end
|
314
|
+
|
315
|
+
it 'should return false' do
|
316
|
+
server.stub(:reload, true) do
|
317
|
+
server.running?.must_equal false
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
describe '#halted?' do
|
324
|
+
describe 'when it is halted' do
|
325
|
+
before :each do
|
326
|
+
server.power_state = 'Halted'
|
327
|
+
end
|
328
|
+
|
329
|
+
it 'should return true' do
|
330
|
+
server.stub(:reload, true) do
|
331
|
+
server.halted?.must_equal true
|
332
|
+
end
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
describe 'when it is not halted' do
|
337
|
+
before :each do
|
338
|
+
server.power_state = 'Anything'
|
339
|
+
end
|
340
|
+
|
341
|
+
it 'should return false' do
|
342
|
+
server.stub(:reload, true) do
|
343
|
+
server.halted?.must_equal false
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
349
|
+
describe '#destroy' do
|
350
|
+
before :each do
|
351
|
+
def server.hard_shutdown; @shutdown = true; end
|
352
|
+
def vbd.destroy; @destroyed = true; end
|
353
|
+
def service.destroy_record(_reference, _provider_class); @destroyed = true; end
|
354
|
+
server.stub(:service, service) do
|
355
|
+
server.stub(:vbds, [vbd]) do
|
356
|
+
server.destroy
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
it 'should shutdown the vm' do
|
362
|
+
server.instance_variable_get(:@shutdown).must_equal(true)
|
363
|
+
end
|
364
|
+
|
365
|
+
it 'should destroy the vbds' do
|
366
|
+
vbd.instance_variable_get(:@destroyed).must_equal(true)
|
367
|
+
end
|
368
|
+
|
369
|
+
it 'should destroy the vm' do
|
370
|
+
service.instance_variable_get(:@destroyed).must_equal(true)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
describe '#start' do
|
375
|
+
describe 'on a running server' do
|
376
|
+
before :each do
|
377
|
+
def server.running?; true end
|
378
|
+
end
|
379
|
+
|
380
|
+
it 'should return false' do
|
381
|
+
server.start.must_equal(false)
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
describe 'on a halted server' do
|
386
|
+
before :each do
|
387
|
+
def server.running?; false end
|
388
|
+
def service.start_vm(reference); @started = true end
|
389
|
+
def server.wait_for(&block); instance_eval(&block); @started = true end
|
390
|
+
server.stub(:service, service) do
|
391
|
+
server.start
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
395
|
+
it 'should start the server' do
|
396
|
+
service.instance_variable_get(:@started).must_equal(true)
|
397
|
+
end
|
398
|
+
|
399
|
+
it 'should wait the server start' do
|
400
|
+
server.instance_variable_get(:@started).must_equal(true)
|
401
|
+
end
|
402
|
+
|
403
|
+
it 'should return true' do
|
404
|
+
server.stub(:service, service) do
|
405
|
+
server.start.must_equal(true)
|
406
|
+
end
|
407
|
+
end
|
408
|
+
end
|
409
|
+
end
|
410
|
+
|
411
|
+
describe '#hard_shutdown' do
|
412
|
+
describe 'on a halted server' do
|
413
|
+
before :each do
|
414
|
+
def server.halted?; true end
|
415
|
+
end
|
416
|
+
|
417
|
+
it 'should return false' do
|
418
|
+
server.hard_shutdown.must_equal(false)
|
419
|
+
end
|
420
|
+
end
|
421
|
+
|
422
|
+
describe 'on a running server' do
|
423
|
+
before :each do
|
424
|
+
def server.halted?; false end
|
425
|
+
def service.hard_shutdown_vm(reference); @halted = true end
|
426
|
+
def server.wait_for(&block); instance_eval(&block); @halted = true end
|
427
|
+
server.stub(:service, service) do
|
428
|
+
server.hard_shutdown
|
429
|
+
end
|
430
|
+
end
|
431
|
+
|
432
|
+
it 'should shutdown the server' do
|
433
|
+
service.instance_variable_get(:@halted).must_equal(true)
|
434
|
+
end
|
435
|
+
|
436
|
+
it 'should wait the server shutdown' do
|
437
|
+
server.instance_variable_get(:@halted).must_equal(true)
|
438
|
+
end
|
439
|
+
|
440
|
+
it 'should return true' do
|
441
|
+
server.stub(:service, service) do
|
442
|
+
server.hard_shutdown.must_equal(true)
|
443
|
+
end
|
444
|
+
end
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
448
|
+
describe '#clean_shutdown' do
|
449
|
+
describe 'on a halted server' do
|
450
|
+
before :each do
|
451
|
+
def server.halted?; true end
|
452
|
+
end
|
453
|
+
|
454
|
+
it 'should return false' do
|
455
|
+
server.clean_shutdown.must_equal(false)
|
456
|
+
end
|
457
|
+
end
|
458
|
+
|
459
|
+
describe 'on a running server' do
|
460
|
+
before :each do
|
461
|
+
def server.halted?; false end
|
462
|
+
def service.clean_shutdown_vm(reference); @halted = true end
|
463
|
+
def server.wait_for(&block); instance_eval(&block); @halted = true end
|
464
|
+
server.stub(:service, service) do
|
465
|
+
server.clean_shutdown
|
466
|
+
end
|
467
|
+
end
|
468
|
+
|
469
|
+
it 'should shutdown the server' do
|
470
|
+
service.instance_variable_get(:@halted).must_equal(true)
|
471
|
+
end
|
472
|
+
|
473
|
+
it 'should wait the server shutdown' do
|
474
|
+
server.instance_variable_get(:@halted).must_equal(true)
|
475
|
+
end
|
476
|
+
|
477
|
+
it 'should return true' do
|
478
|
+
server.stub(:service, service) do
|
479
|
+
server.clean_shutdown.must_equal(true)
|
480
|
+
end
|
481
|
+
end
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
describe '#can_be_cloned?' do
|
486
|
+
describe "when it can be cloned" do
|
487
|
+
before :each do
|
488
|
+
server.allowed_operations = %w(clone)
|
489
|
+
end
|
490
|
+
|
491
|
+
it 'should return true' do
|
492
|
+
server.can_be_cloned?.must_equal(true)
|
493
|
+
end
|
494
|
+
end
|
495
|
+
|
496
|
+
describe 'when can not be cloned' do
|
497
|
+
before :each do
|
498
|
+
server.allowed_operations = []
|
499
|
+
end
|
500
|
+
|
501
|
+
it 'should return false' do
|
502
|
+
server.can_be_cloned?.must_equal(false)
|
503
|
+
end
|
504
|
+
end
|
505
|
+
end
|
506
|
+
|
507
|
+
describe '#clone' do
|
508
|
+
describe "when it can be cloned" do
|
509
|
+
before :each do
|
510
|
+
def server.can_be_cloned?; true end
|
511
|
+
def service.clone_vm(name, reference); @cloned = true end
|
512
|
+
def server.reload; @reloaded = true end
|
513
|
+
server.stub(:service, service) do
|
514
|
+
server.clone('')
|
515
|
+
end
|
516
|
+
end
|
517
|
+
|
518
|
+
it 'should clone the vm' do
|
519
|
+
service.instance_variable_get(:@cloned).must_equal(true)
|
520
|
+
end
|
521
|
+
|
522
|
+
it 'should reload the vm' do
|
523
|
+
server.instance_variable_get(:@reloaded).must_equal(true)
|
524
|
+
end
|
525
|
+
end
|
526
|
+
|
527
|
+
describe 'when can not be cloned' do
|
528
|
+
before :each do
|
529
|
+
def server.can_be_cloned?; false end
|
530
|
+
end
|
531
|
+
|
532
|
+
it 'should raise an exception' do
|
533
|
+
lambda { server.clone('') }.must_raise RuntimeError, 'Clone Operation not Allowed'
|
534
|
+
end
|
535
|
+
end
|
536
|
+
end
|
537
|
+
|
538
|
+
describe '#revert_to' do
|
539
|
+
before :each do
|
540
|
+
collection.instance_variable_set(:@server, server)
|
541
|
+
def collection.get_by_reference_or_name_or_uuid(name); @server end
|
542
|
+
def service.revert_to_vm(reference); @reverted = true end
|
543
|
+
server.stub(:service, service) do
|
544
|
+
server.stub(:collection, collection) do
|
545
|
+
server.revert_to('snapshot')
|
546
|
+
end
|
547
|
+
end
|
548
|
+
end
|
549
|
+
|
550
|
+
it 'should revert the snapshot' do
|
551
|
+
service.instance_variable_get(:@reverted).must_equal(true)
|
552
|
+
end
|
553
|
+
end
|
554
|
+
end
|