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

Enable scm_credential type in refresh #14471

Merged
merged 1 commit into from
Mar 23, 2017
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def credentials
when 'net' then "#{provider_module}::AutomationManager::NetworkCredential"
when 'ssh' then "#{provider_module}::AutomationManager::MachineCredential"
when 'vmware' then "#{provider_module}::AutomationManager::VmwareCredential"
# when 'scm' then "#{provider_module}::AutomationManager::???Credential"
when 'scm' then "#{provider_module}::AutomationManager::ScmCredential"
when 'aws' then "#{provider_module}::AutomationManager::AmazonCredential"
when 'rax' then "#{provider_module}::AutomationManager::RackspaceCredential"
when 'satellite6' then "#{provider_module}::AutomationManager::Satellite6Credential"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'support/ansible_shared/automation_manager/refresher'
require 'support/ansible_shared/automation_manager/refresher_v2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow... i.e. we never tested the _v2 refresh?!

Copy link
Contributor Author

@jameswnl jameswnl Mar 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we did at one point 😬


describe ManageIQ::Providers::AnsibleTower::AutomationManager::Refresher do
it_behaves_like 'ansible refresher',
it_behaves_like 'ansible refresher_v2',
:provider_ansible_tower,
described_class.parent,
:ansible_tower_automation,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'support/ansible_shared/automation_manager/refresher'
require 'support/ansible_shared/automation_manager/refresher_v2'

describe ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Refresher do
it_behaves_like 'ansible refresher_v2',
Expand Down
7 changes: 7 additions & 0 deletions spec/support/ansible_shared/automation_manager/refresher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ def assert_credentials
:userid => "[email protected]",
)
expect(cloud_credential.options.keys).to match_array(cloud_credential.class::EXTRA_ATTRIBUTES.keys)

scm_credential = expected_configuration_script_source.authentication
expect(scm_credential).to have_attributes(
:name => "db-github",
:userid => "syncrou"
)
expect(scm_credential.options.keys).to match_array(scm_credential.class::EXTRA_ATTRIBUTES.keys)
end

def assert_playbooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,21 @@ def assert_credentials
:name => "appliance",
:userid => "root",
)

cloud_credential = expected_configuration_script.authentications.find_by(
:type => manager_class::AmazonCredential
)
expect(cloud_credential).to have_attributes(
:name => "AWS",
:userid => "065ZMGNV5WNKPMX4FF82",
)

scm_credential = expected_configuration_script_source.authentication
expect(scm_credential).to have_attributes(
:name => "db-github",
:userid => "syncrou"
)
expect(scm_credential.options.keys).to match_array(scm_credential.class::EXTRA_ATTRIBUTES.keys)
end

def assert_playbooks
Expand Down