diff --git a/configs/f32.json b/configs/f32.json index f4f1d24..f5383b4 100644 --- a/configs/f32.json +++ b/configs/f32.json @@ -3,12 +3,14 @@ "ad": { "name": "peru/windows-server-2019-datacenter-x64-eval", "url": "", - "memory": 2048 + "memory": 2048, + "cpus": 2 }, "ad-child": { "name": "peru/windows-server-2019-datacenter-x64-eval", "url": "", - "memory": 2048 + "memory": 2048, + "cpus": 2 }, "ipa": { "name": "fedora/32-cloud-base", diff --git a/configs/sssd-f32.json b/configs/sssd-f32.json index cf47a6d..7f63915 100644 --- a/configs/sssd-f32.json +++ b/configs/sssd-f32.json @@ -3,12 +3,14 @@ "ad": { "name": "peru/windows-server-2019-datacenter-x64-eval", "url": "", - "memory": 2048 + "memory": 2048, + "cpus": 2 }, "ad-child": { "name": "peru/windows-server-2019-datacenter-x64-eval", "url": "", - "memory": 2048 + "memory": 2048, + "cpus": 2 }, "ipa": { "name": "sssd-vagrant/fedora32-ipa", diff --git a/configs/sssd-fedora-rawhide.json b/configs/sssd-fedora-rawhide.json index 2063ff2..84159db 100644 --- a/configs/sssd-fedora-rawhide.json +++ b/configs/sssd-fedora-rawhide.json @@ -3,12 +3,14 @@ "ad": { "name": "peru/windows-server-2019-standard-x64-eval", "url": "", - "memory": 2048 + "memory": 2048, + "cpus": 2 }, "ad-child": { "name": "peru/windows-server-2019-standard-x64-eval", "url": "", - "memory": 2048 + "memory": 2048, + "cpus": 2 }, "ipa": { "name": "sssd-vagrant/fedora-rawhide-ipa", diff --git a/ruby/config.rb b/ruby/config.rb index d5d893c..6ca3f86 100644 --- a/ruby/config.rb +++ b/ruby/config.rb @@ -53,6 +53,16 @@ def getBoxURL(name) return value end + def getCpus(name) + value = @config.dig("boxes", name, "cpus") + + if value.nil? + return 1 + end + + return value + end + def getFolders(type, env_var) if ENV.has_key?("SSSD_TEST_SUITE_BOX") if ENV["SSSD_TEST_SUITE_BOX"] == "yes" diff --git a/ruby/guest.rb b/ruby/guest.rb index 2209401..d07cc41 100644 --- a/ruby/guest.rb +++ b/ruby/guest.rb @@ -11,6 +11,7 @@ def self.Add(config, vagrant_config, machine) this.vm.provider :libvirt do |libvirt| libvirt.memory = machine.memory + libvirt.cpus = machine.cpus libvirt.storage_pool_name = "sssd-test-suite" # Creating new private networks requires system connection. diff --git a/ruby/machine.rb b/ruby/machine.rb index 24eef7e..2454643 100644 --- a/ruby/machine.rb +++ b/ruby/machine.rb @@ -1,7 +1,7 @@ require_relative './config.rb' class Machine - attr_reader :name, :type, :hostname, :ip, :memory, :box, :url + attr_reader :name, :type, :hostname, :ip, :memory, :box, :url, :cpus LINUX = 1 WINDOWS = 2 @@ -14,7 +14,8 @@ def initialize( memory: nil, box: nil, url: nil, - config: nil + config: nil, + cpus: nil ) @name = name @type = type @@ -23,11 +24,13 @@ def initialize( @memory = memory @box = box @url = url + @cpus = cpus if not config.nil? @memory = if memory.nil? then config.getMemory(name) end @box = if box.nil? then config.getBox(type, name) end @url = if url.nil? then config.getBoxURL(name) end + @cpus = if cpus.nil? then config.getCpus(name) end end end end