[PATCH aggregator] Fix Auth cucumber tests.
by Jason Guiditta
---
src/app/controllers/user_sessions_controller.rb | 2 +-
src/app/controllers/users_controller.rb | 2 +-
src/features/authentication.feature | 4 ++--
src/features/step_definitions/authentication.rb | 6 +++---
src/features/support/paths.rb | 7 +++++++
5 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/app/controllers/user_sessions_controller.rb b/src/app/controllers/user_sessions_controller.rb
index e67cc1d..4a618a4 100644
--- a/src/app/controllers/user_sessions_controller.rb
+++ b/src/app/controllers/user_sessions_controller.rb
@@ -31,7 +31,7 @@ class UserSessionsController < ApplicationController
@user_session = UserSession.new(params[:user_session])
if @user_session.save
flash[:notice] = "Login successful!"
- redirect_back_or_default :controller => 'dashboard'
+ redirect_back_or_default dashboard_url
else
render :action => :new
end
diff --git a/src/app/controllers/users_controller.rb b/src/app/controllers/users_controller.rb
index 3536c0e..19828db 100644
--- a/src/app/controllers/users_controller.rb
+++ b/src/app/controllers/users_controller.rb
@@ -32,7 +32,7 @@ class UsersController < ApplicationController
@registration = RegistrationService.new(@user)
if @registration.save
flash[:notice] = "User registered!"
- redirect_back_or_default url_for(:action => :show, :id => @user.id)
+ redirect_back_or_default user_url(@user)
else
render :action => :new
end
diff --git a/src/features/authentication.feature b/src/features/authentication.feature
index 78754b9..12e217b 100644
--- a/src/features/authentication.feature
+++ b/src/features/authentication.feature
@@ -17,7 +17,7 @@ Feature: User authentication
| Last name | Tester |
| Email | testuser(a)example.com |
And I press "Create Account"
- Then I should be on the account page
+ Then I should be on testuser's user page
And I should see "User registered!"
And I should have one private pool named "testuser"
@@ -26,7 +26,7 @@ Feature: User authentication
And I am on the login page
When I login
Then I should see "Login successful!"
- And I should be on the account page
+ And I should be on the dashboard page
Scenario: Log in without password
Given I am a registered user
diff --git a/src/features/step_definitions/authentication.rb b/src/features/step_definitions/authentication.rb
index 7abcb83..c0d581d 100644
--- a/src/features/step_definitions/authentication.rb
+++ b/src/features/step_definitions/authentication.rb
@@ -28,7 +28,7 @@ When /^I forget to enter my password$/ do
end
When /^I want to edit my profile$/ do
- click_link "Hi, #{user.login}"
+ click_link "#{user.first_name} #{user.last_name}"
response.should contain("User Profile for #{user.login}")
end
@@ -37,6 +37,6 @@ Then /^I should be logged out$/ do
end
Then /^I should have one private pool named "([^\"]*)"$/ do |login|
- PortalPool.find_by_name(login).should_not be_nil
- PortalPool.find_by_name(login).permissions.size.should == 1
+ Pool.find_by_name(login).should_not be_nil
+ Pool.find_by_name(login).permissions.size.should == 1
end
diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb
index 685669c..1f9a8a3 100644
--- a/src/features/support/paths.rb
+++ b/src/features/support/paths.rb
@@ -20,6 +20,9 @@ module NavigationHelpers
when /the login page/
login_path
+ when /^(.*)'s user page$/i
+ user_path(User.find_by_login($1))
+
when /the account page/
account_path
@@ -38,8 +41,12 @@ module NavigationHelpers
when /the pool realms page/
pool_realms_path
+ when /the dashboard page/
+ dashboard_path
+
when /the pool hardware profiles page/
hardware_profiles_pool_path
+
# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
#
--
1.6.2.5
13 years, 12 months
[PATCH aggregator] Updated Cucumber Pool Feature and Steps for updated quota
by Martyn Taylor
From: martyntaylor <mtaylor(a)redhat.com>
---
src/features/pool.feature | 11 +++++------
src/features/step_definitions/pool_steps.rb | 5 +++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/features/pool.feature b/src/features/pool.feature
index 7308dd4..22a7b33 100644
--- a/src/features/pool.feature
+++ b/src/features/pool.feature
@@ -66,9 +66,8 @@ Feature: Manage Pools
Then I should be on the show pool page
When I follow "Quota"
Then I should see the following:
- | Resource | Max Capacity | Used Capacity | Free Capacity | % Used |
- | Running Instances | 10 | 8 | 2 | 80.00 |
- | Running Memory | 10240 | 9240 | 1000 | 90.23 |
- | Running CPUs | 20 | 16 | 4 | 80.00 |
- | Total Instances | 15 | 15 | 0 | 100.00 |
- | Total Storage | 8500 | 8400 | 100 | 98.82 |
\ No newline at end of file
+ | Running Instances | 10 | 8 | 2 |
+ | Running Memory | 10240 | 9240 | 1000 |
+ | Running CPUs | 20 | 16 | 4 |
+ | Total Instances | 15 | 15 | 0 |
+ | Total Storage | 8500 | 8400 | 100 |
\ No newline at end of file
diff --git a/src/features/step_definitions/pool_steps.rb b/src/features/step_definitions/pool_steps.rb
index 3be5808..c58fe73 100644
--- a/src/features/step_definitions/pool_steps.rb
+++ b/src/features/step_definitions/pool_steps.rb
@@ -50,11 +50,12 @@ Then /^I should see the following:$/ do |table|
end
Given /^the Pool has a quota with following capacities:$/ do |table|
- quota_hash = { "pool_id" => @pool, "pool" => @pool}
+ quota_hash = {}
table.hashes.each do |hash|
quota_hash[hash["resource"]] = hash["capacity"]
end
@quota = Factory(:quota, quota_hash)
- puts @quota.pool_id
+ @pool.quota_id = @quota.id
+ @pool.save
end
\ No newline at end of file
--
1.6.6.1
13 years, 12 months
[PATCH 00/14]: Consistency fixes for some of the backend drivers
by Chris Lalancette
As part of working with 4 of the backend drivers with Condor (mock, GoGrid,
EC2, and Rackspace), I've noticed quite a few inconsistencies that make them
difficult for a client to use. This patch series fixes up some of these
inconsistencies, and make things *mostly* work when trying to launch guests
from Condor. There are still some outstanding problems having to do with
error handling and state transitions, but these patches are at least a start.
Additionally, I have not tested out the other drivers we have (Rimu, RHEV-M,
OpenNebula, and Terremark); I assume they will have similar issues.
Chris Lalancette
13 years, 12 months
Re: [deltacloud-devel] [PATCH core 5/6] Disabled show_exceptions to get error reporting work
by Michal Fojtik
On 24/06/10 13:35 -0400, Chris Lalancette wrote:
>On 06/03/10 - 04:27:22PM, mfojtik(a)redhat.com wrote:
>> ---
>> server/server.rb | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/server/server.rb b/server/server.rb
>> index e52fd2a..883f4f8 100644
>> --- a/server/server.rb
>> +++ b/server/server.rb
>> @@ -12,6 +12,7 @@ require 'open3'
>>
>> configure do
>> set :raise_errors => false
>> + set :show_exceptions, false
>> end
>>
>> configure :development do
>
>Definite ACK for this patch; it's needed to get errors to work at all with
>Sinatra.
Pushed to 'core/master'.
-- Michal
--
--------------------------------------------------------
Michal Fojtik, mfojtik(a)redhat.com, +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API: http://deltacloud.org
--------------------------------------------------------
13 years, 12 months
Instance authentication (rev 2)
by Michal Fojtik
Hi,
According to recent discussion with Marion and David I changed
authentication model for instances.
I added new module Deltacloud::Authentication with two classes
'Password' and 'Key'.
Also I added a 'password' authentication to Rackspace, but it's
unfortunatelly returned only after 'create' operation.
All patches are tested on GoGrid/EC2, I'll be glad if someone will
take Rackspace testing.
-- Michal
13 years, 12 months
[PATCH] Fixed JS error in instance list view
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Added missing JS function which checks checkbox on click anywhere in row.
---
src/app/views/instance/_list.html.erb | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/app/views/instance/_list.html.erb b/src/app/views/instance/_list.html.erb
index 9d12c76..4328978 100644
--- a/src/app/views/instance/_list.html.erb
+++ b/src/app/views/instance/_list.html.erb
@@ -1,3 +1,15 @@
+<script type="text/javascript">
+ function clickRow(ev) {
+ var box = $('input[name="image_id[]"]', ev.target.parentNode);
+ if ($(ev.target).attr('name') != "image_id[]")
+ box.attr('checked', !box.attr('checked'));
+ }
+
+ function checkAll(ev) {
+ $('input[name="image_id[]"]', dataTable_instances_table).attr('checked', $(ev.target).attr('checked'))
+ }
+</script>
+
<%= datatable(
Instance::COLUMNS.map {|c| c[:opts]},
{
--
1.7.0.1
13 years, 12 months
[PATCH] Move Image Builder link for better grouping.
by Jason Guiditta
---
deltacloud.org/lib/documentation.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/deltacloud.org/lib/documentation.rb b/deltacloud.org/lib/documentation.rb
index a8e76c7..4863732 100644
--- a/deltacloud.org/lib/documentation.rb
+++ b/deltacloud.org/lib/documentation.rb
@@ -4,9 +4,9 @@ module DocumentationHelper
{ :href => 'documentation.html', :menu => 'Overview' },
{ :href => "api.html" , :menu => 'REST API', :description => 'REST API definition' },
{ :href => "drivers.html" , :menu => 'Drivers', :description => 'Currently-supported drivers' },
- { :href => "image-builder.html" , :menu => 'Image Builder', :description => 'Image Builder' },
{ :href => "framework.html" , :menu => 'Framework', :description => 'Framework for writing additional drivers' },
{ :href => "client-ruby.html" , :menu => 'Ruby Client', :description => 'Ruby client' },
+ { :href => "image-builder.html" , :menu => 'Image Builder', :description => 'Image Builder' },
]
end
--
1.6.2.5
13 years, 12 months
[PATCH aggregator] Image Builder - disabled preselecting of jboss package group
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
No package group is preselected when jboss service is checked
(we don't have a public jboss repo with group definitions now).
---
src/app/util/image_descriptor_xml.rb | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/app/util/image_descriptor_xml.rb b/src/app/util/image_descriptor_xml.rb
index 860bfa4..d9b8348 100644
--- a/src/app/util/image_descriptor_xml.rb
+++ b/src/app/util/image_descriptor_xml.rb
@@ -27,7 +27,9 @@ class ImageDescriptorXML
# FIXME: temporary way to only add jboss until other
# services are supported
SERVICE_PACKAGE_GROUPS = {
- 'jboss' => 'JBoss Core Packages'
+ # FIXME: jboss service is disabled because we don't have public repo
+ # which contains groups for jboss
+ #'jboss' => 'JBoss Core Packages'
}
def initialize(xmlstr = "")
--
1.7.0.1
13 years, 12 months
[PATCH aggregator] Image Builder - repository manager automatically stores xml files in config/image_descriptor_xmls on first download
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/util/repository_manager.rb | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/app/util/repository_manager.rb b/src/app/util/repository_manager.rb
index a650ecf..05cc5da 100644
--- a/src/app/util/repository_manager.rb
+++ b/src/app/util/repository_manager.rb
@@ -77,10 +77,18 @@ class RepositoryManager
private
def get_xml(type)
+ # FIXME: I'm not sure config is right dir for automatic storing of
+ # xml files, but this should be temporary solution until Image Repo is
+ # done
+ xml_dir = "#{RAILS_ROOT}/config/image_descriptor_xmls"
+ xml_file = "#{xml_dir}/#{(a)id}.#{type}.xml"
begin
- return File.open("#{RAILS_ROOT}/config/image_descriptor_xmls/#{(a)id}.#{type}.xml") { |f| f.read }
+ return File.open(xml_file) { |f| f.read }
rescue
- return download_xml(type)
+ xml = download_xml(type)
+ Dir.mkdir(xml_dir) unless File.directory?(xml_dir)
+ File.open(xml_file, 'w') { |f| f.write xml }
+ return xml
end
end
--
1.7.0.1
13 years, 12 months