Commit 07176d99 authored by Samir Noir's avatar Samir Noir 🧀
Browse files

Cleanup some comments

parent 2a916e11
......@@ -35,7 +35,7 @@ class ApplicationController < ActionController::Base
class NotAcceptable < ClientError; end # Error code 406
class PreconditionFailed < ClientError; end # Error code 412
# abasu : class & subclasses to handle server-side exceptions (Error codes 5xx)
# class & subclasses to handle server-side exceptions (Error codes 5xx)
class ServerError < ActionController::ActionControllerError; end
class UnsupportedMediaType < ServerError; end # Error code 415 (moved to server-side)
class BadGateway < ServerError; end # Error code 50x (to be refined later)
......
......@@ -24,7 +24,7 @@ module Grid5000
:scheduled_at, :walltime, :queue, :state, :mode,
:command, :directory, :exit_code, :signal, :checkpoint, :anterior,
:message, :stderr, :stdout]
# abasu bug ref. 7360 - added :job_key_from_file --- 29.11.2016
# OAR expects these as import-job-key-from-file
READ_ONLY_UNDERSCORE_ATTRIBUTES = [:import_job_key_from_file]
READ_WRITE_ATTRIBUTES = [:name, :project]
......
......@@ -24,25 +24,23 @@ Api::Application.routes.draw do
get '*resource/versions' => 'versions#index', :via => [:get]
get '*resource/versions/:id' => 'versions#show', :via => [:get]
# abasu : 1 line introduced below for correction to bug ref 5065 -- 2015.01.23
resources :environments, :only => [:index, :show], :constraints => { :id => /[0-9A-Za-z\-\.]+/ }
resources :network_equipments, :only => [:index, :show]
resources :sites, :only => [:index, :show] do
member do
get :status
end
# abasu : 1 line introduced below for correction to bug ref 5065 -- 2015.01.23
resources :environments, :only => [:index, :show], :constraints => { :id => /[0-9A-Za-z\-\.]+/ }
resources :network_equipments, :only => [:index, :show]
resources :pdus, :only => [:index, :show]
resources :clusters, :only => [:index, :show] do
# abasu : 3 lines introduced below for correction to bug ref 5856 -- 2015.04.17
member do
get :status
end
resources :nodes, :only => [:index, :show]
end
# abasu bug #7301 to incorporate feature /servers -- 2016.10.24
resources :servers, :only => [:index, :show]
resources :jobs
resources :deployments
......
......@@ -26,7 +26,7 @@ describe ClustersController do
expect(json['disks']).not_to be_nil
expect(json['nodes']['parasilo-5.rennes.grid5000.fr']['reservations']).not_to be_empty
expect(json['disks']['sdb.parasilo-5.rennes.grid5000.fr']['reservations']).not_to be_empty
end # "should return the status ONLY for the specified cluster"
end
# GET /sites/{{site_id}}/clusters/{{id}}/status?network_address={{network_address}}
it "should return the status ONLY for the specified node" do
......@@ -37,7 +37,7 @@ describe ClustersController do
expect(json['disks'].keys.map{|k| k.split('.')[1]}.uniq.sort).to eq ['parasilo-5']
expect(json['nodes']['parasilo-5.rennes.grid5000.fr']['reservations']).not_to be_empty
expect(json['disks']['sdb.parasilo-5.rennes.grid5000.fr']['reservations']).not_to be_empty
end # "should return the status ONLY for the specified node"
end
# GET /sites/{{site_id}}/clusters/{{id}}/status?disks=no
it "should return the status of nodes but not disks" do
......@@ -47,7 +47,7 @@ describe ClustersController do
expect(json['nodes'].keys.map{|k| k.split('-')[0]}.uniq.sort).to eq ['parasilo']
expect(json['disks']).to be_nil
expect(json['nodes']['parasilo-5.rennes.grid5000.fr']['reservations']).not_to be_empty
end # "should return the status of nodes but not disks"
end
# GET /sites/{{site_id}}/clusters/{{id}}/status?job_details=no
it "should return the status of nodes without the reservations" do
......@@ -58,7 +58,7 @@ describe ClustersController do
expect(json['disks']).not_to be_nil
expect(json['nodes']['parasilo-5.rennes.grid5000.fr']['reservations']).to be_nil
expect(json['disks']['sdb.parasilo-5.rennes.grid5000.fr']['reservations']).to be_nil
end # "should return the status of nodes without the reservations"
end
# GET /sites/{{site_id}}/clusters/{{id}}/status?waiting=no
it "should not return the reservations in Waiting state" do
......@@ -69,7 +69,7 @@ describe ClustersController do
expect(json['disks']).not_to be_nil
expect(json['nodes']['parasilo-5.rennes.grid5000.fr']['reservations']).to be_empty
expect(json['disks']['sdb.parasilo-5.rennes.grid5000.fr']['reservations']).to be_empty
end # "should not return the reservations of nodes in Waiting state"
end
it "should return all nodes in the specified cluster for which the status is requested" do
get :status, params: { :site_id => "rennes", :id => "parapluie", :format => :json }
......@@ -77,7 +77,7 @@ describe ClustersController do
assert_media_type(:json)
expect(json['nodes'].length).to eq 46
expect(json['nodes'].keys.uniq.sort).to eq ["parapluie-1.rennes.grid5000.fr", "parapluie-10.rennes.grid5000.fr", "parapluie-11.rennes.grid5000.fr", "parapluie-12.rennes.grid5000.fr", "parapluie-13.rennes.grid5000.fr", "parapluie-14.rennes.grid5000.fr", "parapluie-15.rennes.grid5000.fr", "parapluie-16.rennes.grid5000.fr", "parapluie-17.rennes.grid5000.fr", "parapluie-18.rennes.grid5000.fr", "parapluie-19.rennes.grid5000.fr", "parapluie-2.rennes.grid5000.fr", "parapluie-20.rennes.grid5000.fr", "parapluie-21.rennes.grid5000.fr", "parapluie-22.rennes.grid5000.fr", "parapluie-23.rennes.grid5000.fr", "parapluie-24.rennes.grid5000.fr", "parapluie-25.rennes.grid5000.fr", "parapluie-26.rennes.grid5000.fr", "parapluie-27.rennes.grid5000.fr", "parapluie-28.rennes.grid5000.fr", "parapluie-29.rennes.grid5000.fr", "parapluie-3.rennes.grid5000.fr", "parapluie-30.rennes.grid5000.fr", "parapluie-31.rennes.grid5000.fr", "parapluie-32.rennes.grid5000.fr", "parapluie-33.rennes.grid5000.fr", "parapluie-34.rennes.grid5000.fr", "parapluie-35.rennes.grid5000.fr", "parapluie-36.rennes.grid5000.fr", "parapluie-37.rennes.grid5000.fr", "parapluie-38.rennes.grid5000.fr", "parapluie-39.rennes.grid5000.fr", "parapluie-4.rennes.grid5000.fr", "parapluie-40.rennes.grid5000.fr", "parapluie-5.rennes.grid5000.fr", "parapluie-51.rennes.grid5000.fr", "parapluie-52.rennes.grid5000.fr", "parapluie-53.rennes.grid5000.fr", "parapluie-54.rennes.grid5000.fr", "parapluie-55.rennes.grid5000.fr", "parapluie-56.rennes.grid5000.fr", "parapluie-6.rennes.grid5000.fr", "parapluie-7.rennes.grid5000.fr", "parapluie-8.rennes.grid5000.fr", "parapluie-9.rennes.grid5000.fr"]
end # "should return all nodes in the specified cluster for which the status is requested"
end
it "should return the status with the correct links" do
get :status, params: { :site_id => "rennes", :id => "parapluie", :format => :json }
......@@ -96,10 +96,9 @@ describe ClustersController do
expect(json["links"][1]).to eq({"rel"=>"parent",
"href"=>"/sites/rennes/clusters/parapluie",
"type"=>"application/vnd.grid5000.item+json"})
end # "should return the status with the correct links"
end
end # "GET /sites/{{site_id}}/clusters/{{id}}/status"
# abasu : unit test for bug ref 6363 to handle filter queues - 08.01.2016
describe "GET /sites/{{site_id}}/clusters/{{id}}" do
# The following unit tests check the responses at level of specific clusters:
# 1. Where queues filter is NOT mentioned in request, for 3 types of clusters
......@@ -119,7 +118,7 @@ describe ClustersController do
expect(response.status).to eq 200
expect(json["queues"]).to eq ["admin", "production"]
end # it "should return ONLY cluster mbi in nancy without any queues filter"
end
it "should return ONLY cluster talc in nancy without any queues filter" do
expected_url = "http://api-out.local:80/sites/nancy/clusters/talc?branch=master&pretty=yes"
......@@ -133,7 +132,7 @@ describe ClustersController do
expect(response.status).to eq 200
expect(json["queues"]).to eq ["admin", "default"]
end # it "should return ONLY cluster talc in nancy without any queues filter"
end
it "should return ONLY cluster graphique in nancy without any queues filter" do
expected_url = "http://api-out.local:80/sites/nancy/clusters/graphique?branch=master&pretty=yes"
......@@ -147,7 +146,7 @@ describe ClustersController do
expect(response.status).to eq 200
expect(json["queues"] | []).to eq ["admin", "default"]
end # it "should return ONLY cluster graphique in nancy without any queues filter"
end
it "should return ONLY cluster mbi in nancy" do
expected_url = "http://api-out.local:80/sites/nancy/clusters/mbi?branch=master&queues=production&pretty=yes"
......@@ -161,9 +160,8 @@ describe ClustersController do
expect(response.status).to eq 200
expect(json["queues"]).to eq ["admin", "production"]
end # it "should return ONLY cluster mbi in nancy"
end
# abasu : unit test for bug ref 6363 to handle filter queues - 08.01.2016
it "should return ONLY cluster talc in nancy" do
expected_url = "http://api-out.local:80/sites/nancy/clusters/talc?branch=master&queues=default&pretty=yes"
stub_request(:get, expected_url)
......@@ -176,7 +174,7 @@ describe ClustersController do
expect(response.status).to eq 200
expect(json["queues"]).to eq ["admin", "default"]
end # it "should return ONLY cluster talc in nancy"
end
it "should return NO cluster because talc is NOT production cluster" do
expected_url = "http://api-out.local:80/sites/nancy/clusters/talc?branch=master&queues=production&pretty=yes"
......@@ -189,7 +187,7 @@ describe ClustersController do
expect(response.status).to eq 404
expect(response.body).to eq "Cannot find resource /sites/nancy/clusters/talc"
end # it "should return NO cluster because talc is NOT production cluster"
end
it "should return 404 if a resource does not exist" do
get :show, params: { :branch => 'master', :site_id => "nancy", :id => "doesnotexist", :queues => "production", :format => :json }
......@@ -197,7 +195,6 @@ describe ClustersController do
end
end # "GET /sites/{{site_id}}/clusters/{{id}}/"
# abasu : unit tests for bug ref 6363 to handle filter queues - 08.01.2016
describe "GET /sites/{{site_id}}/clusters" do
# The following unit tests check the responses at level of all clusters in a site:
# 1. Where queues filter is NOT mentioned in request (mbi, talc, graphique)
......@@ -205,7 +202,6 @@ describe ClustersController do
# 3. Where queues filter is specified as 'default' (talc graphique)
# 4. Where queues filter is 'all' (mbi, talc, graphique)
# abasu : unit test for bug ref 6363 to handle filter queues - 08.01.2016
it "should return ALL clusters in site nancy without any queues param" do
get :index, params: { :branch => 'master', :site_id => "nancy", :format => :json }
assert_media_type(:json)
......@@ -218,7 +214,7 @@ describe ClustersController do
clusterList = [cluster["uid"]] | clusterList
end
expect(clusterList - ["graphique","mbi","talc"]).to be_empty
end # it "should return ALL clusters in site nancy without any queues param"
end
it "should return ONLY cluster mbi in site nancy" do
expected_url = "http://api-out.local:80/sites/nancy/clusters?branch=master&queues=production&pretty=yes"
......@@ -234,9 +230,8 @@ describe ClustersController do
expect(json["total"]).to eq 1
expect(json["items"][0]["uid"]).to eq "mbi"
expect(json["items"][0]["queues"]).to include("production")
end # it "should return ONLY cluster mbi in nancy"
end
# abasu : unit test for bug ref 6363 to handle filter queues - 08.01.2016
it "should return ONLY clusters talc & graphique in site nancy" do
expected_url = "http://api-out.local:80/sites/nancy/clusters?branch=master&queues=default&pretty=yes"
stub_request(:get, expected_url)
......@@ -255,9 +250,8 @@ describe ClustersController do
expect(cluster["queues"]).to include("default")
end
expect(clusterList - ["graphique","talc"]).to be_empty
end # it "should return ONLY clusters talc & graphique in site nancy"
end
# abasu : unit test for bug ref 6363 to handle filter queues - 08.01.2016
it "should return ALL clusters in site nancy" do
get :index, params: { :branch => 'master', :site_id => "nancy", :queues => "all", :format => :json }
assert_media_type(:json)
......@@ -274,6 +268,6 @@ describe ClustersController do
expect(combined_queues).to eq ["admin","default","production"]
expect(clusterList - ["graphique","mbi","talc"]).to be_empty
end # it "should return ALL clusters in site nancy"
end
end # "GET /sites/{{site_id}}/clusters?branch=master&queues=all&pretty=yes"
end # describe ClustersController
end
......@@ -90,7 +90,7 @@ describe DeploymentsController do
before do
@valid_attributes = {
"nodes" => ["paradent-1.rennes.grid5000.fr"],
"environment" => "lenny-x64-base"
"environment" => "lenny-x64-base"
}
@deployment = Grid5000::Deployment.new(@valid_attributes)
end
......
......@@ -136,7 +136,7 @@ describe JobsController do
expect(response.status).to eq 400
expect(response.body).to eq "Request to #{expected_url} failed with status 400: some error"
end
# abasu : unit test for bug ref 5912 to handle error codes - 02.04.2015
it "should return a 400 error if the OAR API returns 400 error code" do
payload = @valid_job_attributes.merge("resources" => "{ib30g='YES'}/nodes=2")
authenticate_as("crohr")
......@@ -162,8 +162,8 @@ describe JobsController do
expect(response.status).to eq 400
expect(response.body).to eq "Request to #{expected_url} failed with status 400: Bad Request"
end # "should return a 400 error if the OAR API returns 400 error code"
# abasu : unit test for bug ref 5912 to handle error codes - 02.04.2015
end
it "should return a 401 error if the OAR API returns 401 error code" do
payload = @valid_job_attributes
authenticate_as("xyz")
......@@ -189,7 +189,8 @@ describe JobsController do
expect(response.status).to eq 401
expect(response.body).to eq "Request to #{expected_url} failed with status 401: Authorization Required"
end # "should return a 401 error if the OAR API returns 400 error code"
end
it "should return 201, the job details, and the Location header" do
payload = @valid_job_attributes
authenticate_as("crohr")
......
......@@ -17,7 +17,6 @@ require 'spec_helper'
describe ServersController do
render_views
# abasu : unit test for bug ref 7301 to handle /servers - 24.10.2016
describe "GET /sites/{{site_id}}/servers/{{id}}" do
# The following unit tests check the responses at level of specific servers.
......@@ -26,14 +25,12 @@ describe ServersController do
assert_media_type(:json)
expect(response.body).to eq('{"alias":[],"kind":"physical","monitoring":{"metric":"power","wattmeter":"multiple"},"network_adapters":{"bmc":{"ip":"172.17.79.21"},"default":{"ip":"172.16.79.21"}},"sensors":{"network":{"available":true,"resolution":1},"power":{"available":true,"resolution":1,"via":{"pdu":[{"port":20,"uid":"grisou-pdu1"},{"port":20,"uid":"grisou-pdu2"}]}}},"serial":"92ZLL82","type":"server","uid":"talc-data","warranty":11.202,"version":"8a562420c9a659256eeaafcfd89dfa917b5fb4d0","links":[{"rel":"self","type":"application/vnd.grid5000.item+json","href":"/sites/nancy/servers/talc-data"},{"rel":"parent","type":"application/vnd.grid5000.item+json","href":"/sites/nancy"},{"rel":"version","type":"application/vnd.grid5000.item+json","href":"/sites/nancy/servers/talc-data/versions/8a562420c9a659256eeaafcfd89dfa917b5fb4d0"},{"rel":"versions","type":"application/vnd.grid5000.collection+json","href":"/sites/nancy/servers/talc-data/versions"}]}')
expect(response.status).to eq(200)
end # it "should return ONLY cluster talc in nancy without any queues filter"
end # "GET /sites/{{site_id}}/servers/{{id}}/"
end
end
# abasu : unit tests for bug ref 7301 to handle /servers - 24.10.2016
describe "GET /sites/{{site_id}}/servers" do
# The following unit tests check the responses at level of all servers in a site
# abasu : unit test for bug ref 7301 to handle /servers - 24.10.2016
it "should return 2 servers in site nancy and their exact names" do
get :index, params: { :branch => 'master', :site_id => "nancy", :format => :json }
assert_media_type(:json)
......@@ -45,6 +42,6 @@ describe ServersController do
serverList = [server["uid"]] | serverList
end
expect(serverList - ["storage5k", "talc-data"]).to be_empty
end # it "should return ALL servers in site nancy"
end # "GET /sites/{{site_id}}/servers"
end # describe ServersController
end
end
end
......@@ -104,7 +104,6 @@ describe SitesController do
]
end
# abasu 19.10.2016 - bug #7364 changed "deployments" to "deployment"
it "should return link for deployment" do
get :show, params: { :id => "rennes", :format => :json }
expect(response.status).to eq 200
......@@ -112,9 +111,8 @@ describe SitesController do
expect(json['links'].find{|l|
l['rel'] == 'deployments'
}['href']).to eq "/sites/rennes/deployments"
end # it "should return link for deployment" do
end
# abasu 26.10.2016 - bug #7301 should return link /servers if present in site
it "should return link /servers if present in site" do
get :show, params: { :id => "nancy", :format => :json }
expect(response.status).to eq 200
......@@ -122,7 +120,7 @@ describe SitesController do
expect(json['links'].find{|l|
l['rel'] == 'servers'
}['href']).to eq "/sites/nancy/servers"
end # it "should return link /servers if present in site" do
end
it "should return the specified version, and the max-age value in the Cache-Control header should be big" do
get :show, params: { :id => "rennes", :format => :json, :version => "b00bd30bf69c322ffe9aca7a9f6e3be0f29e20f4" }
......@@ -134,7 +132,7 @@ describe SitesController do
l['rel'] == 'version'
}['href']).to eq "/sites/rennes/versions/b00bd30bf69c322ffe9aca7a9f6e3be0f29e20f4"
end
end # describe "GET /sites/{{site_id}}"
end
describe "GET /sites/{{site_id}}/status (authenticated)" do
before do
......@@ -201,10 +199,6 @@ describe SitesController do
get :status, params: { :id => "rennes", :job_details => "no", :format => :json }
expect(response.status).to eq 503
end
# it "should fail if the site does not exist" do
# pending "this will be taken care of at the api-proxy layer"
# end
end # "GET /sites/{{site_id}}/status"
describe "GET /sites/{{site_id}}/status (by anonymous)" do
......
......@@ -205,7 +205,6 @@ describe Grid5000::Repository do
describe "versions_for" do
it "find the versions for a resource" do
# abasu - 24.10.2016 - update "total" value from 8 to 10
expect(@repository.versions_for("grid5000/sites")["total"]).to eq(10)
end
it "should return an empty list if the resource does not exist" do
......
This diff is collapsed.
......@@ -130,54 +130,47 @@ describe OAR::Resource do
expect(OAR::Resource.status(:waiting => 'no', :network_address => 'parasilo-5.rennes.grid5000.fr')["nodes"].first[1]['reservations']).to be_nil
end
# abasu : test added to check new status values -- bug ref 5106
it "should return a node with status free_busy" do
expect(OAR::Resource.status["nodes"].select do |_node, status|
status[:soft] == "free_busy"
end.map{|(node, _status)| node}).to eq ["parapluie-54.rennes.grid5000.fr"]
end # it "should return a node with status busy_free"
end
# abasu : test added to check new status values -- bug ref 5106
it "should return a node with status busy_free" do
expect(OAR::Resource.status["nodes"].select do |_node, status|
status[:soft] == "busy_free"
end.map{|(node, _status)| node}).to eq ["parapluie-55.rennes.grid5000.fr"]
end # it "should return a node with status busy_free"
end
# abasu : test added to check new status values -- bug ref 5106
it "should return all nodes with status busy" do
expect(OAR::Resource.status["nodes"].select do |_node, status|
status[:soft] == "busy"
end.map{|(node, _status)| node}.sort).to eq ["paradent-9.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "parapide-10.rennes.grid5000.fr", "parapide-11.rennes.grid5000.fr", "parapide-12.rennes.grid5000.fr", "parapide-13.rennes.grid5000.fr", "parapide-14.rennes.grid5000.fr", "parapide-15.rennes.grid5000.fr", "parapide-16.rennes.grid5000.fr", "parapide-17.rennes.grid5000.fr", "parapide-18.rennes.grid5000.fr", "parapluie-9.rennes.grid5000.fr", "paramount-6.rennes.grid5000.fr", "paramount-7.rennes.grid5000.fr", "paramount-8.rennes.grid5000.fr", "paramount-9.rennes.grid5000.fr", "paramount-5.rennes.grid5000.fr", "parapide-1.rennes.grid5000.fr", "parapide-2.rennes.grid5000.fr", "parapide-3.rennes.grid5000.fr", "parapide-4.rennes.grid5000.fr", "parapide-5.rennes.grid5000.fr", "parapide-6.rennes.grid5000.fr", "parapide-7.rennes.grid5000.fr", "parapide-8.rennes.grid5000.fr", "parapide-9.rennes.grid5000.fr", "parapide-19.rennes.grid5000.fr", "parapide-20.rennes.grid5000.fr", "parapide-21.rennes.grid5000.fr", "parapide-22.rennes.grid5000.fr", "parapide-23.rennes.grid5000.fr", "parapide-24.rennes.grid5000.fr", "parapide-25.rennes.grid5000.fr", "paramount-4.rennes.grid5000.fr", "paramount-30.rennes.grid5000.fr", "paramount-32.rennes.grid5000.fr", "paramount-33.rennes.grid5000.fr", "parasilo-1.rennes.grid5000.fr", "parasilo-3.rennes.grid5000.fr"].sort
end # it "should return all nodes with status busy"
end
# abasu : test added to check new status values -- bug ref 5106
it "should return all nodes with status free" do
expect(OAR::Resource.status["nodes"].select do |_node, status|
status[:soft] == "free"
end.map{|(node, _status)| node}.sort).to eq ["paramount-29.rennes.grid5000.fr", "paramount-28.rennes.grid5000.fr", "paramount-27.rennes.grid5000.fr", "paramount-26.rennes.grid5000.fr", "paramount-24.rennes.grid5000.fr", "paramount-23.rennes.grid5000.fr", "paramount-22.rennes.grid5000.fr", "paramount-19.rennes.grid5000.fr", "paramount-18.rennes.grid5000.fr", "paramount-17.rennes.grid5000.fr", "paramount-16.rennes.grid5000.fr", "paramount-15.rennes.grid5000.fr", "paramount-14.rennes.grid5000.fr", "paramount-13.rennes.grid5000.fr", "paramount-12.rennes.grid5000.fr", "paramount-11.rennes.grid5000.fr", "paramount-10.rennes.grid5000.fr", "paramount-3.rennes.grid5000.fr", "paramount-2.rennes.grid5000.fr", "paramount-1.rennes.grid5000.fr", "paradent-2.rennes.grid5000.fr", "paradent-3.rennes.grid5000.fr", "paradent-4.rennes.grid5000.fr", "paradent-5.rennes.grid5000.fr", "paradent-6.rennes.grid5000.fr", "paradent-7.rennes.grid5000.fr", "paradent-10.rennes.grid5000.fr", "paradent-11.rennes.grid5000.fr", "paradent-12.rennes.grid5000.fr", "paradent-13.rennes.grid5000.fr", "paradent-14.rennes.grid5000.fr", "paradent-15.rennes.grid5000.fr", "paradent-16.rennes.grid5000.fr", "paradent-17.rennes.grid5000.fr", "paradent-18.rennes.grid5000.fr", "paradent-19.rennes.grid5000.fr", "paradent-20.rennes.grid5000.fr", "paradent-21.rennes.grid5000.fr", "paradent-22.rennes.grid5000.fr", "paradent-23.rennes.grid5000.fr", "paradent-24.rennes.grid5000.fr", "paradent-25.rennes.grid5000.fr", "paradent-26.rennes.grid5000.fr", "paradent-27.rennes.grid5000.fr", "paradent-29.rennes.grid5000.fr", "paradent-30.rennes.grid5000.fr", "paradent-36.rennes.grid5000.fr", "paradent-37.rennes.grid5000.fr", "paradent-51.rennes.grid5000.fr", "parapluie-7.rennes.grid5000.fr", "parapluie-20.rennes.grid5000.fr", "parapluie-21.rennes.grid5000.fr", "parapluie-8.rennes.grid5000.fr", "parapluie-22.rennes.grid5000.fr", "parapluie-23.rennes.grid5000.fr", "parapluie-24.rennes.grid5000.fr", "parapluie-25.rennes.grid5000.fr", "parapluie-26.rennes.grid5000.fr", "parapluie-27.rennes.grid5000.fr", "parapluie-28.rennes.grid5000.fr", "parapluie-29.rennes.grid5000.fr", "parapluie-3.rennes.grid5000.fr", "parapluie-30.rennes.grid5000.fr", "parapluie-31.rennes.grid5000.fr", "parapluie-32.rennes.grid5000.fr", "parapluie-33.rennes.grid5000.fr", "parapluie-34.rennes.grid5000.fr", "parapluie-35.rennes.grid5000.fr", "parapluie-36.rennes.grid5000.fr", "parapluie-37.rennes.grid5000.fr", "parapluie-38.rennes.grid5000.fr", "parapluie-39.rennes.grid5000.fr", "parapluie-4.rennes.grid5000.fr", "parapluie-40.rennes.grid5000.fr", "parapluie-5.rennes.grid5000.fr", "parapluie-6.rennes.grid5000.fr", "parapluie-2.rennes.grid5000.fr", "parapluie-19.rennes.grid5000.fr", "parapluie-18.rennes.grid5000.fr", "parapluie-17.rennes.grid5000.fr", "parapluie-16.rennes.grid5000.fr", "parapluie-15.rennes.grid5000.fr", "parapluie-14.rennes.grid5000.fr", "parapluie-13.rennes.grid5000.fr", "parapluie-12.rennes.grid5000.fr", "parapluie-11.rennes.grid5000.fr", "parapluie-10.rennes.grid5000.fr", "parapluie-1.rennes.grid5000.fr", "parasilo-2.rennes.grid5000.fr", "parasilo-5.rennes.grid5000.fr"].sort
end # it "should return all nodes with status free"
end
# abasu : test added to check new status values -- bug ref 5106
it "should return a node with status free_busy_besteffort" do
expect(OAR::Resource.status["nodes"].select do |_node, status|
status[:soft] == "free_busy_besteffort"
end.map{|(node, _status)| node}).to eq ["parapluie-51.rennes.grid5000.fr"]
end # it "should return a node with status free_busy_besteffort"
end
# abasu : test added to check new status values -- bug ref 5106
it "should return a node with status busy_free_besteffort" do
expect(OAR::Resource.status["nodes"].select do |_node, status|
status[:soft] == "busy_free_besteffort"
end.map{|(node, _status)| node}).to eq ["parapluie-52.rennes.grid5000.fr"]
end # it "should return a node with status busy_free_besteffort"
end
# abasu : test added to check new status values -- bug ref 5106
it "should return a node with status busy_besteffort" do
expect(OAR::Resource.status["nodes"].select do |_node, status|
status[:soft] == "busy_besteffort"
end.map{|(node, _status)| node}).to eq ["parapluie-53.rennes.grid5000.fr"]
end # it "should return a node with status busy_besteffort"
end
describe "standby state" do
before do
......@@ -257,6 +250,6 @@ describe OAR::Resource do
expect(OAR::Resource.status(:types=>['disk'])["disks"].select do |_disk, status|
status[:soft] == "free"
end.map{|disk, _status| disk}.sort).to eq ["sdb.parasilo-5.rennes.grid5000.fr", "sdc.parasilo-5.rennes.grid5000.fr", "sdb.paradent-9.rennes.grid5000.fr", "sdc.paradent-9.rennes.grid5000.fr"].sort
end # it "should return all disks with status free"
end
end
end # describe OAR::Resource
end
......@@ -110,7 +110,6 @@ describe Grid5000::Job do
})
end
# abasu bug ref. 7360 - added test for import job_key_from_file --- 29.11.2016
it "should copy import-job-key-from-file to a hash structure" do
reservation = Time.parse("2009-11-10 15:54:56")
job = Grid5000::Job.new(:resources => "/nodes=1", :reservation => reservation, :command => "id", :types => ["deploy", "idempotent"], :walltime => 3600, :checkpoint => 40, :'import-job-key-from-file' => "file://abcd")
......@@ -124,7 +123,7 @@ describe Grid5000::Job do
"type"=>["deploy", "idempotent"],
"import-job-key-from-file"=> "file://abcd"
})
end # it "should copy import-job-key-from-file to a hash structure" do
end
end
describe "Creating for future submission" do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment