Files
vagrant-libvirt/spec/support/environment_helper.rb
Uli Fahrer 0363459bec feat: add websocket graphics config (#1672)
This adds websocket functionality for VNC. The websocket attribute may 
be used to specify the port to listen on (with -1 meaning 
auto-allocation and autoport having no effect due to security reasons).
2022-11-21 11:05:51 +00:00

49 lines
872 B
Ruby

# frozen_string_literal: true
require 'ostruct'
require 'pathname'
class EnvironmentHelper
attr_writer :domain_name
attr_accessor :random_hostname, :name, :default_prefix
def [](value)
send(value.to_sym)
end
def cpus
4
end
def memory
1024
end
%w(cpus cpu_mode loader nvram boot_order machine_type disk_bus disk_device nested volume_cache kernel cmd_line initrd graphics_type graphics_autoport graphics_port graphics_websocket graphics_ip graphics_passwd video_type video_vram keymap storage_pool_name disks cdroms floppies driver).each do |name|
define_method(name.to_sym) do
nil
end
end
def machine
self
end
def provider_config
self
end
def root_path
Pathname.new('./spec/support/foo')
end
def domain_name
# noop
end
def libvirt_compute
OpenStruct.new(servers: [])
end
end