[PATCH conductor] BZ 847798 - fix provider names in tests

jzigmund at redhat.com jzigmund at redhat.com
Wed Sep 5 12:08:21 UTC 2012


From: Jozef Zigmund <jzigmund at redhat.com>

---
 src/features/hardware_profile.feature              |  8 +--
 src/features/pool_family.feature                   |  4 +-
 src/features/provider.feature                      | 60 ++++++++++-----------
 src/features/provider_account.feature              | 62 +++++++++++-----------
 src/features/provider_priority_group.feature       |  4 +-
 .../step_definitions/provider_account_steps.rb     |  4 +-
 src/features/step_definitions/provider_steps.rb    |  3 +-
 src/spec/factories/provider.rb                     |  4 +-
 8 files changed, 74 insertions(+), 75 deletions(-)

diff --git a/src/features/hardware_profile.feature b/src/features/hardware_profile.feature
index 41c72b5..1f6e111 100644
--- a/src/features/hardware_profile.feature
+++ b/src/features/hardware_profile.feature
@@ -100,14 +100,14 @@ Feature: Manage Hardware Profiles
      | Test Hardware Profile | 1740   | 2 | 250 | i386 |
 
   Scenario: Check New Hardware Profile matching Provider Hardware Profiles
-    Given there is a provider named "provider1"
-    And there is a provider named "provider2"
-    And "provider1" has the following hardware profiles:
+    Given there is a provider named "mockprovider1"
+    And there is a provider named "mockprovider2"
+    And "mockprovider1" has the following hardware profiles:
     | name         | memory | cpu |storage  | architecture |
     | m1-small     | 1740   | 1   | 250     | i386         |
     | m1-medium    | 1740   | 2   | 500     | i386         |
     | m1-large     | 2048   | 4   | 850     | x86_64       |
-    And "provider2" has the following hardware profiles:
+    And "mockprovider2" has the following hardware profiles:
     | name         | memory | cpu |storage  | architecture |
     | m1-small     | 4048   | 4   | 500     | i386         |
     | m1-medium    | 8192   | 4   | 500     | i386         |
diff --git a/src/features/pool_family.feature b/src/features/pool_family.feature
index b3c6461..650423c 100644
--- a/src/features/pool_family.feature
+++ b/src/features/pool_family.feature
@@ -61,7 +61,7 @@ Feature: Pool Families
 
   Scenario: Add provider account to pool family
     Given there is a pool family named "testpoolfamily"
-    And there is a provider named "testprovider"
+    And there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
     And I am on the pool family provider accounts page
     Then I should see "Account Name"
@@ -73,7 +73,7 @@ Feature: Pool Families
 
   Scenario: Remove provider account from pool family
     Given there is a pool family named "testpoolfamily"
-    And there is a provider named "testprovider"
+    And there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
     And there is a provider account "testaccount" related to pool family "testpoolfamily"
     And I am on the pool family provider accounts page
diff --git a/src/features/provider.feature b/src/features/provider.feature
index 5b4715d..df44ff4 100644
--- a/src/features/provider.feature
+++ b/src/features/provider.feature
@@ -10,23 +10,23 @@ Feature: Manage Providers
   Scenario: List providers
     Given I am on the homepage
     And there are these providers:
-    | name      |
-    | provider1 |
-    | provider2 |
-    | provider3 |
+    | name  |
+    | mock1 |
+    | mock2 |
+    | mock3 |
     When I go to the providers page
     Then I should see the following:
-    | provider1 |
-    | provider2 |
-    | provider3 |
+    | mock1 |
+    | mock2 |
+    | mock3 |
 
   Scenario: List providers in XML format
     Given I accept XML
     And there are these providers:
-    | name      |
-    | provider1 |
-    | provider2 |
-    | provider3 |
+    | name  |
+    | mock1 |
+    | mock2 |
+    | mock3 |
     When I go to the providers page
     Then I should get a XML document
     And XML should contain 3 providers
@@ -34,23 +34,23 @@ Feature: Manage Providers
     And each provider should have "url"
     And each provider should have "provider_type"
     And there should be these provider:
-    | name         | url                       | provider_type |
-    | provider1    | http://localhost:3002/api | mock          |
-    | provider2    | http://localhost:3002/api | mock          |
-    | provider3    | http://localhost:3002/api | mock          |
+    | name     | url                       | provider_type |
+    | mock1    | http://localhost:3002/api | mock          |
+    | mock2    | http://localhost:3002/api | mock          |
+    | mock3    | http://localhost:3002/api | mock          |
 
   Scenario: Show provider details
-    Given there is a provider named "testprovider"
-    When I am on the testprovider's edit provider page
+    Given there is a provider named "mockprovider"
+    When I am on the mockprovider's edit provider page
     Then I should see "Provider name"
     And I should see "Provider URL"
 
   Scenario: Create a new Provider
     Given I am on the new provider page
     And I attempt to add a valid provider
-    Then I should be on the testprovider's edit provider page
+    Then I should be on the ec2-testprovider's edit provider page
     And I should see a confirmation message
-    And I should have a provider named "testprovider"
+    And I should have a provider named "ec2-testprovider"
 
   Scenario: Create a new Provider failure when using wrong url
     Given I am on the new provider page
@@ -60,37 +60,37 @@ Feature: Manage Providers
 
   Scenario: Delete a provider
     Given I am on the homepage
-    And there is a provider named "provider1"
+    And there is a provider named "mock1"
     And this provider has 5 hardware profiles
     And this provider has a realm
     And this provider has a provider account
-    When I go to the provider1's edit provider page
+    When I go to the mock1's edit provider page
     And I follow "delete"
-    And there should not exist a provider named "provider1"
+    And there should not exist a provider named "mock1"
     And there should not be any hardware profiles
     And there should not be a provider account
     And there should not be a realm
 
   Scenario: Disable a provider
-    Given there is a provider named "provider1"
+    Given there is a provider named "mock1"
     And this provider has a provider account with 2 running instances
-    When I go to the provider1's edit provider page
+    When I go to the mock1's edit provider page
     And I press "provider_submit"
-    Then I should be on the provider1's edit provider page
+    Then I should be on the mock1's edit provider page
     And I should see "Provider is disabled."
     And I should not see "Error while stopping an instance"
 
   Scenario: Disable an inaccessible provider
-    Given there is a provider named "provider1"
+    Given there is a provider named "mock1"
     And this provider has a provider account with 2 running instances
-    And provider "provider1" is not accessible
-    When I go to the provider1's edit provider page
+    And provider "mock1" is not accessible
+    When I go to the mock1's edit provider page
     And I press "provider_submit"
     Then I should see "Provider is not accessible. The status of following Instances will be changed to 'stopped' but their actual state is unknown."
     When I press "disable_button"
-    Then I should be on the provider1's edit provider page
+    Then I should be on the mock1's edit provider page
     And I should see "Provider is disabled."
-    And provider "provider1" should have all instances stopped
+    And provider "mock1" should have all instances stopped
 
 #  Scenario: Search for hardware profiles
 #    Given there are these providers:
diff --git a/src/features/provider_account.feature b/src/features/provider_account.feature
index fe16312..799e300 100644
--- a/src/features/provider_account.feature
+++ b/src/features/provider_account.feature
@@ -9,8 +9,8 @@ Feature: Manage Provider Accounts
 
   Scenario: List provider accounts for provider
     Given I am on the homepage
-    And there is a provider named "testprovider"
-    When I go to the testprovider's provider accounts page
+    And there is a provider named "mockprovider"
+    When I go to the mockprovider's provider accounts page
     Then I should see "New Account"
     And there should be no provider accounts
 
@@ -25,30 +25,30 @@ Feature: Manage Provider Accounts
     | mock_account  | mock         | mock          |||
     And there should be these ec2 provider accounts:
     | name         | provider   | provider_type | access_key | secret_access_key |
-    | ec2_account  | ec2provider| ec2           |||
+    | ec2_account  | ec2-provider| ec2           |||
 
   Scenario: Create a new Provider Account
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there are no provider accounts
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     When I follow "New Account"
-    Then I should be on testprovider's new provider account page
+    Then I should be on mockprovider's new provider account page
     And I should see "New Provider Account"
     When I fill in "provider_account[label]" with "testaccount"
     And I fill in "provider_account[credentials_hash][username]" with "mockuser"
     And I fill in "provider_account[credentials_hash][password]" with "mockpassword"
     And I fill in "quota[maximum_running_instances]" with "13"
     And I press "Save"
-    Then I should be on the testprovider's edit provider page
+    Then I should be on the mockprovider's edit provider page
     And I should see "Account testaccount was added."
     And I should have a provider account named "testaccount"
 
   Scenario: Create a new Provider Account using wrong credentials
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there are no provider accounts
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     And I follow "New Account"
-    Then I should be on testprovider's new provider account page
+    Then I should be on mockprovider's new provider account page
     And I should see "New Provider Account"
     And I fill in "provider_account[label]" with "testaccount"
     When I fill in "provider_account[credentials_hash][username]" with "mockuser"
@@ -59,38 +59,38 @@ Feature: Manage Provider Accounts
     Then I should see "Login credentials are invalid for this Provider"
 
   Scenario: Delete a provider account
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
     And the account has an instance associated with it
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     When I check the "testaccount" account
     And I press "Delete"
-    Then I should be on the testprovider's edit provider page
+    Then I should be on the mockprovider's edit provider page
     And I should see "was not deleted"
     And there should be 1 provider account
     When I delete all instances from the account
     And I check the "testaccount" account
     And I press "Delete"
-    Then I should be on the testprovider's edit provider page
+    Then I should be on the mockprovider's edit provider page
     And I should see "was deleted"
     And there should be no provider accounts
 
   Scenario: Delete a provider account with stopped instances
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
     And the account has an instance associated with it
     And all the account instances are stopped
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     When I check the "testaccount" account
     And I press "Delete"
-    Then I should be on the testprovider's edit provider page
+    Then I should be on the mockprovider's edit provider page
     And I should see "was deleted"
     And there should be no provider accounts
 
   Scenario: Edit a existing Provider Account
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     And I follow "testaccount"
     When I follow "Edit"
     And I fill in "provider_account[label]" with "testaccount_updated"
@@ -98,9 +98,9 @@ Feature: Manage Provider Accounts
     Then I should see "Provider Account updated" within ".flashes"
 
   Scenario: Edit a existing Provider Account with invalid credentials
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     And I follow "testaccount"
     When I follow "Edit"
     And I fill in "provider_account[label]" with ""
@@ -108,42 +108,42 @@ Feature: Manage Provider Accounts
     Then I should see "Provider Account wasn't updated"
 
   Scenario: Display alert when Provider Account Quota is over 70% filled
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
     And the account has an instance associated with it
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     When I follow "testaccount"
     And I follow "Edit"
     And I fill in "quota[maximum_running_instances]" with "1"
     And I press "save"
-    Then I should be on the testprovider's edit provider page
+    Then I should be on the mockprovider's edit provider page
     And I should see "Account Quota Reached"
 
   Scenario: Display alert when Provider Account Quota is exceeded
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
     And the account has an instance associated with it
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     When I follow "testaccount"
     And I follow "Edit"
     And I fill in "quota[maximum_running_instances]" with "0"
     And I press "save"
-    Then I should be on the testprovider's edit provider page
+    Then I should be on the mockprovider's edit provider page
     And I should see "Account Quota Exceeded"
 
   Scenario: Test Provider Account connection
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     When I follow "testaccount"
     Then I should see "Test Connection"
     When I follow "Test Connection"
     Then I should see "Test Connection Success"
 
   Scenario: Search for Provider Accounts
-    Given there is a provider named "testprovider"
+    Given there is a provider named "mockprovider"
     And there is a provider account named "testaccount"
-    And I am on the testprovider's provider accounts page
+    And I am on the mockprovider's provider accounts page
     When I fill in "provider_accounts_search" with "abc"
     And I press "apply_provider_accounts_search"
     And I should not see "testaccount"
diff --git a/src/features/provider_priority_group.feature b/src/features/provider_priority_group.feature
index 0b78d9f..a859007 100644
--- a/src/features/provider_priority_group.feature
+++ b/src/features/provider_priority_group.feature
@@ -12,7 +12,7 @@ Feature: Manage Provider Priority Groups
 
   Scenario: Create a new Provider Priority Group
     Given a pool "testpool" exists
-    And there is a provider named "testprovider"
+    And there is a provider named "mockprovider"
     And there is a provider account named "testprovideraccount"
     And I am on the testpool's provider priority groups page
     When I follow "Add new"
@@ -24,7 +24,7 @@ Feature: Manage Provider Priority Groups
 
   Scenario: Tries to create a new Provider Priority Group with invalid input data
     Given a pool "testpool" exists
-    And there is a provider named "testprovider"
+    And there is a provider named "mockprovider"
     And there is a provider account named "testprovideraccount"
     And I am on the testpool's provider priority groups page
     When I follow "Add new"
diff --git a/src/features/step_definitions/provider_account_steps.rb b/src/features/step_definitions/provider_account_steps.rb
index c6b6e2b..74ac178 100644
--- a/src/features/step_definitions/provider_account_steps.rb
+++ b/src/features/step_definitions/provider_account_steps.rb
@@ -53,7 +53,7 @@ Then /^I should have a provider account named "([^"]*)"$/ do |label|
 end
 
 Given /^there is a provider account named "([^"]*)"$/ do |label|
-  @provider = Provider.find_by_name('testprovider')
+  @provider = Provider.find_by_name('mockprovider')
   @provider_account = FactoryGirl.create(:mock_provider_account, :provider => @provider, :label => label)
 end
 
@@ -79,7 +79,7 @@ Given /^that there are these provider accounts:$/ do |table|
 end
 
 Given /^there is ec2 provider account "([^"]*)"$/ do |arg1|
-  provider =  FactoryGirl.create(:ec2_provider, :name => 'ec2provider')
+  provider =  FactoryGirl.create(:ec2_provider, :name => 'ec2-provider')
   FactoryGirl.create(:ec2_provider_account, :label => arg1, :provider => provider)
 end
 
diff --git a/src/features/step_definitions/provider_steps.rb b/src/features/step_definitions/provider_steps.rb
index 05d614b..d52cb7a 100644
--- a/src/features/step_definitions/provider_steps.rb
+++ b/src/features/step_definitions/provider_steps.rb
@@ -14,9 +14,8 @@
 #   limitations under the License.
 #
 def new_provider(port,bool)
-  destroy_provider("testprovider")
   stub_framework(bool)
-  fill_in "provider[name]", :with => "testprovider"
+  fill_in "provider[name]", :with => "ec2-testprovider"
   fill_in "provider[url]", :with => "http://localhost:#{port}/api"
   select("Amazon EC2", :from => "provider_provider_type_id")
   click_button "save"
diff --git a/src/spec/factories/provider.rb b/src/spec/factories/provider.rb
index f41e752..c607540 100644
--- a/src/spec/factories/provider.rb
+++ b/src/spec/factories/provider.rb
@@ -17,7 +17,7 @@
 FactoryGirl.define do
 
   factory :provider do
-    sequence(:name) { |n| "provider#{n}" }
+    sequence(:name) { |n| "mock#{n}" }
     provider_type { Factory.build :provider_type }
     url { |p| "http://www." + p.name + ".com/api" }
     after_build do |p|
@@ -52,7 +52,7 @@ FactoryGirl.define do
   end
 
   factory :ec2_provider, :parent => :provider do
-    name 'amazon-ec2'
+    name 'ec2-amazon'
     provider_type { ProviderType.find_by_deltacloud_driver("ec2") }
     url 'http://localhost:3002/api'
     deltacloud_provider 'ec2-us-east-1'
-- 
1.7.11.4




More information about the aeolus-devel mailing list