Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for number of cpus #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions configs/f32.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions configs/sssd-f32.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions configs/sssd-fedora-rawhide.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions ruby/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ruby/guest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions ruby/machine.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,7 +14,8 @@ def initialize(
memory: nil,
box: nil,
url: nil,
config: nil
config: nil,
cpus: nil
)
@name = name
@type = type
Expand All @@ -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