Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes from Gentoo packaging #133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
source "http://rubygems.org"

gem 'right_http_connection', '1.2.5', :git => '[email protected]:rightscale/right_http_connection.git'
gem 'libxml-ruby', '~> 0.5.2'
gem 'right_http_connection', '>= 1.2.5'
gem 'libxml-ruby', '>= 0.5.2'

group :development do
gem 'rake'
gem 'rcov'
end

group :activesdb do
gem 'uuidtools', "~> 1.0.7"
gem 'uuidtools', ">= 1.0.7"
end
23 changes: 0 additions & 23 deletions Gemfile.lock

This file was deleted.

19 changes: 7 additions & 12 deletions test/README.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,17 @@

Before you can run any tests, you need to set up credentials (API key and secret) that
will be used when talking to AWS. The credentials are loaded in `test/test_credentials.rb`
and are expected to be found in `~/.rightscale/testcredentials.rb` and look like this:
and are expected to be found through three environment variables:

TestCredentials.aws_access_key_id= 'AAAAAAAAAAAAAAAAAAAA'
TestCredentials.aws_secret_access_key= 'asdfasdfsadf'
TestCredentials.account_number= '???'
RIGHT_AWS_TEST_ACCESS_KEY_ID = 'AAAAAAAAAAAAAAAAAAAA'
RIGHT_AWS_TEST_ACCESS_SECRET_KEY = 'asdfasdfsadf'
RIGHT_AWS_TEST_ACCOUNT_NUMBER = '???'

If you prefer to store your secret key in the OS X keychain, you can do this:

def secret_access_key_from_keychain (key_id)
dump = `security -q find-generic-password -a "#{key_id}" -g 2>&1`
dump[/password: "(.*)"/, 1]
end

TestCredentials.aws_access_key_id= 'AAAAAAAAAAAAAAAAAAAA'
TestCredentials.aws_secret_access_key= secret_access_key_from_keychain(TestCredentials.aws_access_key_id)
TestCredentials.account_number= '???'
RIGHT_AWS_TEST_ACCESS_KEY_ID = 'AAAAAAAAAAAAAAAAAAAA'
RIGHT_AWS_TEST_ACCESS_SECRET_KEY = `security -q find-generic-password -a "#{key_id}" -g 2>&1 | cut -d: -f2`
RIGHT_AWS_TEST_ACCOUNT_NUMBER = '???'

## Running tests

Expand Down
31 changes: 3 additions & 28 deletions test/test_credentials.rb
Original file line number Diff line number Diff line change
@@ -1,37 +1,12 @@
class TestCredentials

@@aws_access_key_id = nil
@@aws_secret_access_key = nil
@@account_number = nil

def self.aws_access_key_id
@@aws_access_key_id
end
def self.aws_access_key_id=(newval)
@@aws_access_key_id = newval
ENV['RIGHT_AWS_TEST_ACCESS_KEY_ID']
end
def self.account_number
@@account_number
end
def self.account_number=(newval)
@@account_number = newval
ENV['RIGHT_AWS_TEST_ACCOUNT_NUMBER']
end
def self.aws_secret_access_key
@@aws_secret_access_key
end
def self.aws_secret_access_key=(newval)
@@aws_secret_access_key = newval
end

def self.get_credentials
Dir.chdir do
begin
Dir.chdir('./.rightscale') do
require 'testcredentials'
end
rescue Exception => e
puts "Couldn't chdir to ~/.rightscale: #{e.message}"
end
end
ENV['RIGHT_AWS_TEST_SECRET_ACCESS_KEY']
end
end