Unverified Commit 6b28b9de authored by MARGERY David's avatar MARGERY David Committed by GitHub
Browse files

Merge pull request #45 from grid5000/bugs/#8379/tls_client_certs_v3

Bugs/#8379/tls client certs v3
parents 4f5f9b3d f7616da9
......@@ -25,32 +25,32 @@ GEM
specs:
ZenTest (4.11.0)
abstract (1.0.0)
actionmailer (3.0.10)
actionpack (= 3.0.10)
actionmailer (3.0.20)
actionpack (= 3.0.20)
mail (~> 2.2.19)
actionpack (3.0.10)
activemodel (= 3.0.10)
activesupport (= 3.0.10)
actionpack (3.0.20)
activemodel (= 3.0.20)
activesupport (= 3.0.20)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack (~> 1.2.5)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.10)
activesupport (= 3.0.10)
activemodel (3.0.20)
activesupport (= 3.0.20)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.10)
activemodel (= 3.0.10)
activesupport (= 3.0.10)
activerecord (3.0.20)
activemodel (= 3.0.20)
activesupport (= 3.0.20)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activeresource (3.0.10)
activemodel (= 3.0.10)
activesupport (= 3.0.10)
activesupport (3.0.10)
activeresource (3.0.20)
activemodel (= 3.0.20)
activesupport (= 3.0.20)
activesupport (3.0.20)
addressable (2.2.6)
arel (2.0.10)
autotest (4.4.6)
......@@ -70,7 +70,7 @@ GEM
connection_pool (1.2.0)
crack (0.3.1)
daemons (1.2.3)
diff-lcs (1.1.3)
diff-lcs (1.3)
docile (1.1.5)
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
......@@ -100,14 +100,14 @@ GEM
haml (3.1.3)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.5.0)
json (1.6.1)
mail (2.2.19)
i18n (0.5.4)
json (1.8.6)
mail (2.2.20)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mime-types (1.25.1)
multi_json (1.11.2)
mysql2 (0.2.13)
net-scp (1.0.4)
......@@ -125,9 +125,9 @@ GEM
nokogiri (~> 1.5)
nokogiri (1.5.11)
pg (0.18.4)
polyglot (0.3.2)
polyglot (0.3.5)
posix-spawn (0.3.9)
rack (1.2.4)
rack (1.2.8)
rack-cache (1.2)
rack (>= 0.4)
rack-fiber_pool (0.9.2)
......@@ -137,23 +137,23 @@ GEM
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.10)
actionmailer (= 3.0.10)
actionpack (= 3.0.10)
activerecord (= 3.0.10)
activeresource (= 3.0.10)
activesupport (= 3.0.10)
rails (3.0.20)
actionmailer (= 3.0.20)
actionpack (= 3.0.20)
activerecord (= 3.0.20)
activeresource (= 3.0.20)
activesupport (= 3.0.20)
bundler (~> 1.0)
railties (= 3.0.10)
railties (3.0.10)
actionpack (= 3.0.10)
activesupport (= 3.0.10)
railties (= 3.0.20)
railties (3.0.20)
actionpack (= 3.0.20)
activesupport (= 3.0.20)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4)
rake (12.0.0)
rb-readline (0.5.3)
rdoc (3.10)
rdoc (3.12.2)
json (~> 1.4)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
......@@ -185,19 +185,27 @@ GEM
ripl (>= 0.3.0)
ripl-short_errors (0.1.0)
ripl (>= 0.2.8)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
rspec (3.6.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
rspec-mocks (~> 3.6.0)
rspec-core (3.6.0)
rspec-support (~> 3.6.0)
rspec-expectations (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-mocks (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-rails (3.6.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
rspec-mocks (~> 3.6.0)
rspec-support (~> 3.6.0)
rspec-support (3.6.0)
rubinius-actor (0.0.2)
rubinius-core-api
rubinius-core-api (0.0.1)
......@@ -214,10 +222,10 @@ GEM
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
treetop (1.4.10)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.30)
tzinfo (0.3.53)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
......
......@@ -129,7 +129,7 @@ class ApplicationController < ActionController::Base
when 502
raise BadGateway, msg
else
raise ServerError, "Request to #{http.uri.to_s} failed with unexpected status #{status}: #{http.response} ; could be a problem with our version of eventmachine not supporting IPv6"
raise ServerError, "Request to #{http.uri.to_s} failed with unexpected status #{status}: #{http.response} ; could be a problem with our version of eventmachine not supporting IPv6, or TLS problems"
end
end
......
......@@ -78,12 +78,14 @@ class JobsController < ApplicationController
)+"/internal/oarapi/jobs/#{params[:id]}.json",
:out
)
options=tls_options_for(url, :out)
http = EM::HttpRequest.new(url).delete(
:timeout => 5,
:head => {
'X-Remote-Ident' => @credentials[:cn],
'Accept' => media_type(:json)
}
},
:tls => options
)
continue_if!(http, :is => [200,202,204,404])
......@@ -122,6 +124,7 @@ class JobsController < ApplicationController
url = uri_to(
site_path(params[:site_id])+"/internal/oarapi/jobs.json", :out
)
options=tls_options_for(url, :out)
http = EM::HttpRequest.new(url).post(
:timeout => 20,
:body => job_to_send.to_json,
......@@ -129,7 +132,8 @@ class JobsController < ApplicationController
'X-Remote-Ident' => @credentials[:cn],
'Content-Type' => media_type(:json),
'Accept' => media_type(:json)
}
},
:tls => options
)
continue_if!(http, :is => [201,202])
......
......@@ -26,6 +26,10 @@ module ApplicationHelper
Grid5000::Router.uri_to(request, path, in_or_out, relative_or_absolute)
end
def tls_options_for(url, in_or_out = :in)
Grid5000::Router.tls_options_for(url, in_or_out)
end
def repository
@repository ||= Grid5000::Repository.new(
File.expand_path(
......
......@@ -28,7 +28,10 @@ defaults: &defaults
development:
<<: *defaults
base_uri_in: http://localhost:8000
base_uri_out: http://localhost:8000
base_uri_out: https://127.0.0.1:8443
uri_out_private_key_file: /etc/ssl/certs/clientkey_nopass.pem
uri_out_cert_chain_file: /etc/ssl/certs/clientcert.pem
uri_out_verify_peer: false
notifications_uri: https://localhost:3443/sid/notifications
reference_repository_path: ~/reference-repository
smtp_host: localhost
......
......@@ -70,6 +70,17 @@ module Grid5000
Rails.my_config("base_uri_#{in_or_out}".to_sym)
end # def base_uri()
def tls_options_for(url, in_or_out = :in)
tls_options={}
[:cert_chain_file, :private_key_file, :verify_peer, :fail_if_no_peer_cert,
:cipher_list, :ecdh_curve, :dhparam, :ssl_version].each do |tls_param|
config_key=("uri_#{in_or_out.to_s}_"+tls_param.to_s).to_sym
if Rails.my_config(config_key)
tls_options[tls_param]=Rails.my_config(config_key)
end
end
tls_options
end
end
end
end
......@@ -37,12 +37,71 @@ class apache {
file {
'/vagrant/lib/tasks/tunneling.rake':
mode => '0644',
owner => root,
group => root,
owner => vagrant,
group => vagrant,
content => template('apache/tunneling.rake.erb'),
}
exec {
file { "/etc/ssl/secret":
ensure => present,
content => "authority_pass\n",
mode => '0600', owner => root, group => root,
}
file { "/etc/ssl/certs/ca.srl":
ensure => present,
content => "01\n",
mode => '0644', owner => root, group => root,
}
exec { "Generate certificate authority":
command => "/usr/bin/openssl req -new -x509 -days 3650 -keyform PEM -keyout /etc/ssl/private/cakey.pem -outform PEM -out /etc/ssl/certs/ca.pem -passout file:/etc/ssl/secret -batch -subj \"/C=FR/ST=Bretagne/L=Rennes/O=dev/OU=Grid5000/CN=vagrant/emailAddress=support-staff@lists.grid5000.fr\"",
user => root, group => root,
require => File["/etc/ssl/secret"],
creates => "/etc/ssl/private/cakey.pem",
}
exec { "Create client key and csr":
user => root, group => root,
command => "/usr/bin/openssl req -new -newkey rsa:2048 -keyout /etc/ssl/certs/clientkey.pem -out /etc/ssl/clientcsr.pem -batch -subj \"/C=FR/ST=Bretagne/L=Rennes/O=dev/OU=Grid5000/CN=client/emailAddress=support-staff@lists.grid5000.fr\" -passout file:/etc/ssl/secret",
creates => "/etc/ssl/clientcsr.pem",
}
exec { "Sign client csr":
user => root, group => root,
require => [Exec["Create client key and csr","Generate certificate authority"], File["/etc/ssl/certs/ca.srl"]],
command => "/usr/bin/openssl x509 -days 3650 -CA /etc/ssl/certs/ca.pem -CAkey /etc/ssl/private/cakey.pem -req -in /etc/ssl/clientcsr.pem -outform PEM -out /etc/ssl/certs/clientcert.pem -extensions usr_cert -passin file:/etc/ssl/secret",
creates => "/etc/ssl/certs/clientcert.pem",
}
exec { "Remove client key password":
user => root, group => root,
require => Exec["Sign client csr"],
command => "/usr/bin/openssl rsa -in /etc/ssl/certs/clientkey.pem -out /etc/ssl/certs/clientkey_nopass.pem -passin file:/etc/ssl/secret -passout pass:''",
creates => "/etc/ssl/certs/clientkey_nopass.pem"
}
exec { "Create server key and csr":
user => root, group => root,
command => "/usr/bin/openssl req -new -newkey rsa:2048 -keyout /etc/ssl/private/serverkey.pem -out /etc/ssl/servercsr.pem -passout file:/etc/ssl/secret -batch -subj \"/C=FR/ST=Bretagne/L=Rennes/O=dev/OU=Grid5000/CN=server/emailAddress=support-staff@lists.grid5000.fr\"",
creates => ["/etc/ssl/servercsr.pem","/etc/ssl/private/serverkey.pem"]
}
exec { "Sign server csr":
user => root, group => root,
require => [Exec["Create server key and csr","Generate certificate authority"], File["/etc/ssl/certs/ca.srl"]],
command => "/usr/bin/openssl x509 -days 3650 -CA /etc/ssl/certs/ca.pem -CAkey /etc/ssl/private/cakey.pem -req -in /etc/ssl/servercsr.pem -outform PEM -out /etc/ssl/certs/servercert.pem -passin file:/etc/ssl/secret",
creates => "/etc/ssl/certs/servercert.pem",
}
exec { "Remove server key password":
user => root, group => root,
require => Exec["Sign server csr"],
command => "/usr/bin/openssl rsa -in /etc/ssl/private/serverkey.pem -out /etc/ssl/certs/serverkey_nopass.pem -passin file:/etc/ssl/secret -passout pass:''",
creates => "/etc/ssl/certs/serverkey_nopass.pem"
}
exec {
"enable site api-proxy-dev":
command => "/usr/sbin/a2ensite api-proxy-dev",
unless => "/usr/bin/test -f /etc/apache2/sites-enabled/api-proxy-dev.conf",
......@@ -96,6 +155,13 @@ class apache {
require => Package["apache2"];
}
exec{ "enable apache ssl module":
command => "/usr/sbin/a2enmod ssl ",
notify => Service["apache2"],
creates => "/etc/apache2/mods-enabled/ssl.load",
require => Package["apache2-dev"];
}
exec {
"enable module deflate configuration":
command => "/usr/sbin/a2enconf deflate",
......
......@@ -5,6 +5,41 @@
<% oardbsite = scope.lookupvar('oardbsite') -%>
<% developer = scope.lookupvar('developer') -%>
Listen 8443
<VirtualHost *:8443>
TimeOut 300
ServerName <%= @fqdn %>
ServerAlias server api.grid5000.fr
DocumentRoot /vagrant/public
CustomLog /var/log/apache2/api-proxy-dev-ssl.log "%v %h %l %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
ErrorLog syslog:local1
# Set up SSL proxy engine
SSLEngine On
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
SSLCertificateFile /etc/ssl/certs/servercert.pem
SSLCertificateKeyFile /etc/ssl/certs/serverkey_nopass.pem
# Enable SSL client certificates verification
SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLVerifyClient require
# the client certificate should be signed by the first CA (ca.grid5000.fr)
SSLVerifyDepth 1
<Location />
Require all granted
require ssl
ProxyPass http://127.0.0.1:8080/ retry=1
</Location>
</VirtualHost>
Listen 8080
<VirtualHost *:8080>
......
class apt {
Package {
require => Exec["sources update"]
require => Exec["sources update","Box upgrade"]
}
exec { "sources update":
......@@ -9,6 +9,12 @@ class apt {
#refreshonly => true;
}
exec { "Box upgrade":
command => "apt-get -y upgrade",
path => "/usr/bin:/usr/sbin:/bin:/usr/local/sbin:/sbin",
#refreshonly => true;
}
}
class apt::allowunauthenticated inherits apt {
......
......@@ -35,7 +35,7 @@ describe DeploymentsController do
json['items'].length.should == 10
json['items'].map{|i| i['uid']}.should == (0...10).map{|i| "uid#{i}"}.reverse
json['items'].all?{|i| i.has_key?('links')}.should be_true
json['items'].all?{|i| i.has_key?('links')}.should be true
json['items'][0]['links'].should == [
......@@ -172,7 +172,7 @@ describe DeploymentsController do
dep = Grid5000::Deployment.find_by_uid("kadeploy-api-provided-wid")
dep.should_not be_nil
dep.status?(:processing).should be_true
dep.status?(:processing).should be true
end
end # describe "POST /sites/{{site_id}}/deployments"
......
......@@ -28,7 +28,7 @@ describe JobsController do
json['offset'].should == 0
json['items'].length.should == @job_uids.length
json['items'].map{|i| i['uid']}.sort.should == @job_uids.sort
json['items'].all?{|i| i.has_key?('links')}.should be_true
json['items'].all?{|i| i.has_key?('links')}.should be true
json['items'][0]['links'].should == [
{
"rel"=> "self",
......@@ -194,11 +194,11 @@ describe JobsController do
:body => fixture("oarapi-submitted-job.json")
)
OAR::Job.stub!(:expanded).and_return(
expanded_jobs = mock("expanded jobs")
allow(OAR::Job).to receive(:expanded).and_return(
expanded_jobs = double("expanded jobs")
)
expanded_jobs.should_receive(:find).with("961722", anything).and_return(
mock(OAR::Job, :uid => "961722", :to_json => {"key" => "value"}.to_json, :links= => nil)
expect(expanded_jobs).to receive(:find).with("961722", anything).and_return(
double(OAR::Job, :uid => "961722", :to_json => {"key" => "value"}.to_json, :links= => nil)
)
post :create, :site_id => "rennes", :format => :json
......
......@@ -111,8 +111,8 @@ describe SitesController do
response.status.should == 200
json['uid'].should == 'rennes'
json['links'].find{|l|
l['rel'] == 'deployment'
}['href'].should == "/sites/rennes/deployment"
l['rel'] == 'deployments'
}['href'].should == "/sites/rennes/deployments"
end # it "should return link for deployment" do
# abasu 26.10.2016 - bug #7301 should return link /servers if present in site
......
......@@ -20,21 +20,21 @@ describe Grid5000::Router do
end
it "should take into account X-Api-Version header" do
request = mock(Rack::MockRequest, :env => {
request = double(Rack::MockRequest, :env => {
'HTTP_X_API_VERSION' => 'sid'
})
Grid5000::Router.uri_to(request, "/sites/rennes/jobs").should == "/sid/sites/rennes/jobs"
end
it "should take into account X-Api-Path-Prefix header" do
request = mock(Rack::MockRequest, :env => {
request = double(Rack::MockRequest, :env => {
'HTTP_X_API_PATH_PREFIX' => 'grid5000'
})
Grid5000::Router.uri_to(request, "/sites/rennes/jobs").should == "/grid5000/sites/rennes/jobs"
end
it "should take into account both X-Api-Version and X-Api-Path-Prefix headers" do
request = mock(Rack::MockRequest, :env => {
request = double(Rack::MockRequest, :env => {
'HTTP_X_API_VERSION' => 'sid',
'HTTP_X_API_PATH_PREFIX' => 'grid5000'
})
......@@ -43,7 +43,7 @@ describe Grid5000::Router do
it "should take into account the parameters of the config file with empty path" do
Rails.my_config("base_uri_out".to_sym).should == "http://api-out.local"
request = mock(Rack::MockRequest, :env => {
request = double(Rack::MockRequest, :env => {
'HTTP_X_API_VERSION' => 'sid'
})
Grid5000::Router.uri_to(request, "/sites/rennes/internal/oarapi/jobs/374172.json", :out).should == "http://api-out.local/sid/sites/rennes/internal/oarapi/jobs/374172.json"
......@@ -52,8 +52,14 @@ describe Grid5000::Router do
it "should take into account the parameters of the config file with path (for dev environment)" do
Api::Application::CONFIG["base_uri_out"] = "http://api-out.local/sid"
Rails.my_config("base_uri_out".to_sym).should == "http://api-out.local/sid"
request = mock(Rack::MockRequest, :env => {})
request = double(Rack::MockRequest, :env => {})
Grid5000::Router.uri_to(request, "/sites/rennes/internal/oarapi/jobs/374172.json", :out).should == "http://api-out.local/sid/sites/rennes/internal/oarapi/jobs/374172.json"
end
it "should take into account tls options" do
Api::Application::CONFIG["uri_out_verify_peer"] = true
Api::Application::CONFIG["uri_out_private_key_file"] = "/etc/ssl/certs/private/api.out.local.pem"
expect(tls_options_for("https://api-out.local/", :out)).to include ({private_key_file: "/etc/ssl/certs/private/api.out.local.pem"} )
expect(tls_options_for("https://api-out.local/", :out)).to include ({verify_peer: true} )
end
end
......@@ -22,12 +22,12 @@ require 'spec_helper'
describe OAR::Job do
it "should list the expanded jobs, filtered" do
jobs = mock("jobs")
OAR::Job.should_receive(:expanded).and_return(jobs)
jobs.should_receive(:order).with("job_id DESC").and_return(jobs)
jobs.should_receive(:where).with(:job_user => "crohr").and_return(jobs)
jobs.should_receive(:where).with(:job_name => "whatever").and_return(jobs)
jobs.should_receive(:where).with(:queue_name => "default").and_return(jobs)
jobs = double("jobs")
expect(OAR::Job).to receive(:expanded).and_return(jobs)
expect(jobs).to receive(:order).with("job_id DESC").and_return(jobs)
expect(jobs).to receive(:where).with(:job_user => "crohr").and_return(jobs)
expect(jobs).to receive(:where).with(:job_name => "whatever").and_return(jobs)
expect(jobs).to receive(:where).with(:queue_name => "default").and_return(jobs)
OAR::Job.list(:user => 'crohr', :name => 'whatever', :queue => 'default').
should == jobs
end
......@@ -189,11 +189,12 @@ describe OAR::Job do
result['cores'].sort.should == ["paradent-9.rennes.grid5000.fr", "paradent-9.rennes.grid5000.fr", "paradent-9.rennes.grid5000.fr", "paradent-9.rennes.grid5000.fr", "paradent-9.rennes.grid5000.fr", "paradent-9.rennes.grid5000.fr", "paradent-9.rennes.grid5000.fr", "paradent-9.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-28.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-31.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-32.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-33.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-34.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-35.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-38.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-39.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-40.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-41.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-42.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-43.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-44.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-45.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-47.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-48.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-49.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-50.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-52.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-53.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-54.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-55.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-56.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-57.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-58.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-59.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-60.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-61.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-62.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-63.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr", "paradent-64.rennes.grid5000.fr"].sort
end
it "should build a hash of resources indexed by their type [vlans]" do
xit "should build a hash of resources indexed by their type [vlans]" do
pending "example with VLANs"
end
it "should build a hash of resources indexed by their type [subnets]" do
xit "should build a hash of resources indexed by their type [subnets]" do
pending "example with SUBNETs"
fail
end
end
......@@ -118,15 +118,15 @@ describe OAR::Resource do
@cobayes = OAR::Resource.
find_all_by_network_address('paramount-2.rennes.grid5000.fr')
@cobayes.each {|r|
r.update_attribute(
:available_upto, OAR::Resource::STANDBY_AVAILABLE_UPTO
).should be_true
expect(r.update_attribute(
:available_upto, OAR::Resource::STANDBY_AVAILABLE_UPTO
)).to be true
}
end
after do
@cobayes.each {|r|
r.update_attribute(:available_upto, 0).should be_true
expect(r.update_attribute(:available_upto, 0)).to be true
}
end
......
......@@ -17,8 +17,6 @@ require 'spec_helper'
describe Grid5000::Deployment do
before(:each) do
@now = Time.now
Time.stub!(:now).and_return(@now)
@deployment = Grid5000::Deployment.new({
:environment => "lenny-x64-base",
:user_uid => "crohr",
......@@ -196,7 +194,7 @@ describe Grid5000::Deployment do
"state" => "OK"
}
}
@deployment.save.should_not be_false
@deployment.save.should_not be false
@deployment.reload
end
......@@ -236,7 +234,7 @@ describe Grid5000::Deployment do
describe "creation" do
it "should not allow to create a deployment if uid is nil" do
@deployment.uid.should be_nil
@deployment.save.should be_false
@deployment.save.should be false
@deployment.errors[:uid].should == ["must be set"]