Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into update_to_new_plan_…
Browse files Browse the repository at this point in the history
…values
  • Loading branch information
smarterclayton committed Mar 26, 2013
2 parents b4c15bc + ba836ba commit e2bd817
Show file tree
Hide file tree
Showing 27 changed files with 511 additions and 68 deletions.
16 changes: 15 additions & 1 deletion client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Summary: OpenShift client management tools
Name: rhc
Version: 1.6.2
Version: 1.6.5
Release: 1%{?dist}
Group: Network/Daemons
License: ASL 2.0
Expand Down Expand Up @@ -100,6 +100,20 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,-,-) /etc/bash_completion.d/rhc

%changelog
* Mon Mar 25 2013 Adam Miller <[email protected]> 1.6.5-1
- Minor bug fixes ([email protected])
- Minor bug fixes and typos ([email protected])
- Minor bug fixes and typos ([email protected])
- Card #239: Added support to alias creation and deletion and SSL certificate
upload to the CLI ([email protected])

* Thu Mar 21 2013 Adam Miller <[email protected]> 1.6.4-1
- Updates to enable RHC extended tests to run on Fedora 18 ([email protected])

* Mon Mar 18 2013 Adam Miller <[email protected]> 1.6.3-1
- Display the duration of http requests in the debug output
([email protected])

* Thu Mar 14 2013 Adam Miller <[email protected]> 1.6.2-1
- Merge pull request #332 from jtharris/highline_fix ([email protected])
- Merge pull request #331 from BanzaiMan/dev/hasari/bz920028
Expand Down
2 changes: 1 addition & 1 deletion features/application.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Application Operations

@init
Scenario: Application Creation
When a php-5.3 application is created
When a php application is created
Then the application should be accessible

# The state in these examples should be able to be broken into before hooks when we update cucumber
Expand Down
19 changes: 10 additions & 9 deletions features/cartridge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Feature: Single Cartridge Tests

Examples:
| type | command | status |
| mysql-5.1 | added | running |
| mysql | added | running |

Scenario Outline: Cartridge Commands
Given we have a <state> mysql-5.1 cartridge
When the mysql-5.1 cartridge is <command>
Then the mysql-5.1 cartridge should be <status>
Given we have a <state> mysql cartridge
When the mysql cartridge is <command>
Then the mysql cartridge should be <status>

Examples:
| state | command | status |
Expand All @@ -25,13 +25,14 @@ Feature: Single Cartridge Tests

Scenario Outline: Cartridge List
When we list cartridges
Then the list should contain the cartridge <cart> with display name "<name>"
Then the list should contain the cartridge <cart> with display name

Examples:
| cart | name |
| php-5.3 | PHP 5.3 |
| mongodb-2.2 | MongoDB NoSQL |
| cron-1.4 | Cron 1.4 |
| cart |
| php |
| mongodb |
| cron |


# Commenting this out for US2438
# Scenario Outline: Cartridge Storage
Expand Down
9 changes: 3 additions & 6 deletions features/geared_application.feature
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
@geared_application @geared_user_required @domain_required
Feature: Scaled Application Operations

@init
@init @not-origin
Scenario: Geared Application Creation
When a php-5.3 application is created with a medium gear
When a php application is created with a medium gear
Then the application should be accessible
Then the application should have a medium gear



Then the application should have a medium gear
4 changes: 2 additions & 2 deletions features/lib/rhc_helper/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def cartridge(name)

def get_index_file
case @type
when "php-5.3" then "php/index.php"
when "php-5.3","php-5.4" then "php/index.php"
when "ruby-1.8" then "config.ru"
when "python-2.6" then "wsgi/application"
when "perl-5.10" then "perl/index.pl"
Expand All @@ -130,7 +130,7 @@ def get_index_file

def get_mysql_file
case @type
when "php-5.3" then File.expand_path("../misc/php/db_test.php", File.expand_path(File.dirname(__FILE__)))
when "php-5.3","php-5.4" then File.expand_path("../misc/php/db_test.php", File.expand_path(File.dirname(__FILE__)))
end
end
end
Expand Down
17 changes: 9 additions & 8 deletions features/multiple_cartridge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ Feature: Multiple Cartridge Tests

@init
Scenario: Supporting Cartridge Added
Given an existing or new php-5.3 application with an embedded mysql-5.1 cartridge
When the phpmyadmin-3.4 cartridge is added
Then the phpmyadmin-3.4 cartridge should be running
Given an existing or new php application with an embedded mysql cartridge
When the phpmyadmin cartridge is added
Then the phpmyadmin cartridge should be running

@not-origin
Scenario: Conflicting Cartridge Fails
Then adding the postgresql-8.5 cartridge should fail
Then adding the postgresql cartridge should fail

Scenario: Cartridge Removed
When the phpmyadmin-3.4 cartridge is removed
When the mysql-5.1 cartridge is removed
Then the phpmyadmin-3.4 cartridge should be removed
Then the mysql-5.1 cartridge should be removed
When the phpmyadmin cartridge is removed
When the mysql cartridge is removed
Then the phpmyadmin cartridge should be removed
Then the mysql cartridge should be removed
10 changes: 5 additions & 5 deletions features/scaled_application.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Scaled Application Operations

@init
Scenario: Scaled Application Creation
When a scaled php-5.3 application is created
When a scaled php application is created
Then the application should be accessible
Then the application should be scalable

Expand Down Expand Up @@ -34,9 +34,9 @@ Feature: Scaled Application Operations

Examples:
| cart | type | value |
| php-5.3 | min | 1 |
| php-5.3 | max | 5 |
| php-5.3 | max | -1 |
| php | min | 1 |
| php | max | 5 |
| php | max | -1 |

Scenario Outline: Invalid Scaling Values
When we are updating the <cart> cartridge
Expand All @@ -45,4 +45,4 @@ Feature: Scaled Application Operations

Examples:
| cart | type | value | code |
| php-5.3 | min | a | 1 |
| php | min | a | 1 |
7 changes: 4 additions & 3 deletions features/step_definitions/application_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Use the transformed array so we can reuse this step for all combinations
Given /^an existing (or new )?(scaled )?(.+) (application with.*)$/ do |create, scaled, type, embeds|
options = { :type => type }
options[:embed] = embeds if embeds
options[:embed] = embeds.map{ |c| map_cartridge_type(c) } if embeds
options[:scalable] = scaled if scaled
@app = App.find_on_fs(options)

Expand Down Expand Up @@ -51,7 +51,8 @@
@app = old_app
end

When /^a (scaled )?(.+) application is created(?: with a (.*) gear)?$/ do |scaled, type, gear_profile|
When /^a (scaled )?(.+) application is created(?: with a (.*) gear)?$/ do |scaled, type, gear_profile|
type = map_cartridge_type(type)
@app = App.create_unique(type, scaled, gear_profile)
@app.rhc_app_create
end
Expand Down Expand Up @@ -111,7 +112,7 @@
end

Then /^the application should be scalable/ do
step "the haproxy-1.4 cartridge should be running"
step "the haproxy cartridge should be running"
end

Then /^the application should have a (.*) gear$/ do |gear_profile|
Expand Down
9 changes: 8 additions & 1 deletion features/step_definitions/cartridge_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
include RHCHelper

When /^the (.+) cartridge is added$/ do |name|
name = map_cartridge_type(name)
@app.add_cartridge name
end

When /^the (.+) cartridge is removed$/ do |name|
name = map_cartridge_type(name)
@app.remove_cartridge name
end

When /^the (.+) cartridge is (stopped|(?:re)?started)$/ do |name,command|
name = map_cartridge_type(name)
cmd = case command.to_sym
when :stopped
'stop'
Expand All @@ -26,6 +29,7 @@
end

Then /^the (.+) cartridge should be (.*)$/ do |name,status|
name = map_cartridge_type(name)
expected = case status.to_sym
when :running
"(.+) is running|Uptime:"
Expand All @@ -40,10 +44,12 @@
end

Then /^adding the (.+) cartridge should fail$/ do |name|
name = map_cartridge_type(name)
@app.add_cartridge(name).should == 154
end

When /^we are updating the (.+) cartridge$/ do |cart|
cart = map_cartridge_type(cart)
@cartridge_name = cart
end

Expand Down Expand Up @@ -81,7 +87,8 @@
@exitcode.should == code.to_i
end

Then /^the list should contain the cartridge ([^\s]+) with display name "([^"]+)"$/ do |name, display_name|
Then /^the list should contain the cartridge ([^\s]+) with display name$/ do |name|
display_name = map_cartridge_name(name)
line = @cartridge_output.each_line.find{ |s| s.include?(name) }
line.should_not be_nil
line.should match(display_name)
Expand Down
12 changes: 6 additions & 6 deletions features/support/before_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
end

Before('@single_cartridge','@init') do
step 'an existing or new php-5.3 application without an embedded cartridge'
step "an existing or new php application without an embedded cartridge"
end

# These assumptions help to ensure any steps that are run independently have the same state as after the @init step
{
:application => 'an existing or new php-5.3 application without an embedded cartridge',
:scaled_application => 'an existing or new scaled php-5.3 application without an embedded cartridge',
:application => "an existing or new php application without an embedded cartridge",
:scaled_application => "an existing or new scaled php application without an embedded cartridge",
:domain => 'we have an existing domain',
:client => 'we have the client tools setup',
:single_cartridge => 'an existing or new php-5.3 application with an embedded mysql-5.1 cartridge',
:multiple_cartridge => 'an existing or new php-5.3 application with embedded mysql-5.1 and phpmyadmin-3.4 cartridges',
:single_cartridge => "an existing or new php application with an embedded mysql cartridge",
:multiple_cartridge => "an existing or new php application with embedded mysql and phpmyadmin cartridges",
}.each do |tag,assumption|
Before("@#{tag}",'~@init') do
step assumption
end
end
end
9 changes: 8 additions & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ def set_endpoint
$user_register_script_format = "oo-register-user -l admin -p admin --username %s --userpass %s"
if ENV['REGISTER_USER']
command = $user_register_script_format % [$username,$password]
%x[#{command}]
if Object.const_defined?('Bundler')
Bundler::with_clean_env do
system "gem install activeresource bundler parseconfig --no-ri --no-rdoc"
system command
end
else
system command
end
end

def _log(msg)
Expand Down
29 changes: 29 additions & 0 deletions features/support/platform_support.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
if File.exist?("/etc/fedora-release")
CARTRIDGE_MAP = {
"php" => { type: "php-5.4", name: "PHP 5.4" },
"mysql" => { type: "mysql-5.1", name: "MySQL Database 5.1" },
"phpmyadmin" => { type: "phpmyadmin-3.5", name: "phpMyAdmin 3.5" },
"mongodb" => { type: "mongodb-2.2", name: "MongoDB NoSQL Database 2.2" },
"postgresql" => { type: "postgresql-9.2", name: "PostgreSQL Database 9.2" },
"cron" => { type: "cron-1.4", name: "Cron 1.4" },
"haproxy" => { type: "haproxy-1.4", name: "" }
}
else
CARTRIDGE_MAP = {
"php" => { type: "php-5.3", name: "PHP 5.3" },
"mysql" => { type: "mysql-5.1", name: "MySQL Database 5.1" },
"phpmyadmin" => { type: "phpmyadmin-3.4", name: "phpMyAdmin 3.4" },
"mongodb" => { type: "mongodb-2.2", name: "MongoDB NoSQL Database 2.2" },
"postgresql" => { type: "postgresql-8.4", name: "PostgreSQL Database 8.4" },
"cron" => { type: "cron-1.4", name: "Cron 1.4" },
"haproxy" => { type: "haproxy-1.4", name: "" }
}
end

def map_cartridge_type(type)
CARTRIDGE_MAP[type][:type]
end

def map_cartridge_name(type)
CARTRIDGE_MAP[type][:name]
end
2 changes: 1 addition & 1 deletion lib/rhc/commands/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Account < Base
def run
user = rest_client.user

say_table nil, get_properties(user, :login, :plan_id, :consumed_gears, :max_gears) + get_properties(user.capabilities, :gear_sizes).unshift(['Server', openshift_server]), :delete => true
say_table nil, get_properties(user, :login, :plan_id, :consumed_gears, :max_gears) + get_properties(user.capabilities, :gear_sizes).unshift(['Server:', openshift_server]) << ['SSL Certificates Supported:', user.capabilities.private_ssl_certificates ? 'yes' : 'no'], :delete => true

if openshift_online_server?
else
Expand Down
Loading

0 comments on commit e2bd817

Please sign in to comment.