Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1a483539 authored by Jonathan Pastor's avatar Jonathan Pastor
Browse files

implement a spec test for non reservable GPUs

parent 00e67539
No related branches found
No related tags found
1 merge request!6WIP: Features/oar gpus
...@@ -2112,47 +2112,4 @@ GeForce RTX 2080 Ti ...@@ -2112,47 +2112,4 @@ GeForce RTX 2080 Ti
end end
end end
context 'interracting with a configured OAR server (misconfigured to test the "DIFF" action)' do
before do
prepare_stubs("dump_oar_api_configured_server_to_test_diff.json", "load_data_hierarchy_stubbed_data.json")
end
it 'should ignore the GPUs' do
uri = URI(conf["uri"])
response = Net::HTTP.get(uri)
expect(response).to be_an_instance_of(String)
options = {
:table => false,
:print => false,
:update => false,
:diff => true,
:site => "fakesite",
:clusters => ["clustera"],
:verbose => 2
}
expected_output = <<-TXT
clustera-2:
["~", "eth_rate", 100, 10]
["~", "gpu_count", 2, 4]
TXT
expected_output2 = <<-TXT
# Error: Resource 4 (host=clustera-1.fakesite.grid5000.fr cpu=1 core=4 cpuset=2 gpu=2 gpudevice=1) has a mismatch for ressource CPUSET: API gives 2, generator wants 3.
# Error: Resource 4 (host=clustera-1.fakesite.grid5000.fr cpu=1 core=4 cpuset=2 gpu=2 gpudevice=1) has a mismatch for ressource GPU: API gives 2, generator wants 1.
# Error: Resource 4 (host=clustera-1.fakesite.grid5000.fr cpu=1 core=4 cpuset=2 gpu=2 gpudevice=1) has a mismatch for ressource GPUDEVICE: API gives 1, generator wants 0.
TXT
generator_output = capture do
generate_oar_properties(options)
end
expect(generator_output[:stdout]).to include(expected_output)
expect(generator_output[:stdout]).to include(expected_output2)
end
end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment