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

Add proxy client tests #1409

Open
wants to merge 2 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: 1 addition & 5 deletions bats/fb-katello-client.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ load fixtures/content
foreman-maintain packages unlock -y
}

@test "install subscription manager" {
tPackageExists subscription-manager || tPackageInstall subscription-manager
}

@test "disable puppet agent to prevent checkin from registering host to another org" {
systemctl is-active puppet || skip "Puppet is not active"
systemctl stop puppet
Expand All @@ -39,7 +35,7 @@ load fixtures/content
run yum erase -y 'katello-ca-consumer-*'
echo "rc=${status}"
echo "${output}"
run rpm -Uvh http://localhost/pub/katello-ca-consumer-latest.noarch.rpm
tPackageInstall http://localhost/pub/katello-ca-consumer-latest.noarch.rpm
echo "rc=${status}"
echo "${output}"
subscription-manager register --force --org="${ORGANIZATION_LABEL}" --username=admin --password=changeme --env=Library
Expand Down
4 changes: 4 additions & 0 deletions bats/fb-katello-proxy.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ setup() {
hammer capsule content add-lifecycle-environment --id=$PROXY_ID --environment="Library" --organization="${ORGANIZATION}"
}

@test "enable test lifecycle environment for proxy" {
hammer capsule content add-lifecycle-environment --id=$PROXY_ID --environment="Test" --organization="${ORGANIZATION}"
}

@test "sync proxy" {
hammer capsule content synchronize --id=$PROXY_ID
}
Expand Down
2 changes: 2 additions & 0 deletions bats/foreman_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ tKatelloVersion() {
tPackageVersion tfm-rubygem-katello
elif tPackageExists rubygem-katello; then
tPackageVersion rubygem-katello
elif tPackageExists foreman-proxy-content; then
tPackageVersion foreman-proxy-content
fi
) | cut -d. -f1-2
}
Expand Down
32 changes: 32 additions & 0 deletions pipelines/install/04-install_proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,35 @@
scenario_version: "{{ pipeline_version }}"
- foreman_proxy_content
- foreman_installer
post_tasks:
- name: install hammer
package:
name: "{{ 'tfm-' if ansible_distribution_major_version == '7' else '' }}rubygem-hammer_cli_katello"

- name: deploy hammer config
copy:
dest: /etc/hammer/cli.modules.d/foreman.yml
content: |
:foreman:
# Enable/disable foreman commands
:enable_module: true

:username: 'admin'
:password: 'changeme'

# Your foreman server address
:host: 'https://{{ server_fqdn }}'

# Enable using sessions
# When sessions are enabled, hammer ignores credentials stored in the config file
# and asks for them interactively at the begining of each session.
:use_sessions: false

# Check API documentation cache status on each request
:refresh_cache: false

# API request timeout in seconds, set -1 for infinity
:request_timeout: 120

:ssl:
:ssl_ca_file: '/etc/pki/katello/certs/katello-server-ca.crt'
10 changes: 10 additions & 0 deletions pipelines/install/05-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@
- role: foreman_client_repositories
when: pipeline_type != 'foreman'
- role: foreman_testing
bats_tests:
- "fb-verify-packages.bats"
- "fb-test-foreman.bats"
- "fb-test-puppet.bats"
- "fb-test-katello.bats"
- "fb-katello-content.bats"
- "fb-katello-client.bats"
- "fb-katello-client-global-registration.bats"
- "fb-katello-proxy.bats"
bats_teardown: []
22 changes: 22 additions & 0 deletions pipelines/install/06-proxy-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
- name: run tests
hosts:
- "{{ forklift_proxy_name }}"
become: true
vars_files:
- ../vars/install_base.yml
- ../vars/repos_staging.yml
environment:
FOREMAN_EXPECTED_VERSION: "{{ foreman_expected_version | default('') }}"
roles:
- role: forklift_versions
scenario: "{{ pipeline_type }}"
scenario_os: "{{ pipeline_os }}"
scenario_version: "{{ pipeline_version }}"
- role: foreman_client_repositories
when: pipeline_type != 'foreman'
- role: foreman_testing
bats_tests:
- "fb-verify-packages.bats"
- "fb-katello-client.bats"
bats_teardown: []
22 changes: 22 additions & 0 deletions pipelines/install/07-final-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
- name: run tests
hosts:
- "{{ forklift_server_name }}"
become: true
vars_files:
- ../vars/install_base.yml
- ../vars/repos_staging.yml
environment:
FOREMAN_EXPECTED_VERSION: "{{ foreman_expected_version | default('') }}"
roles:
- role: forklift_versions
scenario: "{{ pipeline_type }}"
scenario_os: "{{ pipeline_os }}"
scenario_version: "{{ pipeline_version }}"
- role: foreman_client_repositories
when: pipeline_type != 'foreman'
- role: foreman_testing
bats_tests:
- "fb-destroy-organization.bats"
bats_tests_additional: []
bats_teardown: []
File renamed without changes.
4 changes: 3 additions & 1 deletion pipelines/install_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
- import_playbook: install/03-install_server.yaml
- import_playbook: install/04-install_proxy.yaml
- import_playbook: install/05-tests.yaml
- import_playbook: install/06-smoker.yaml
- import_playbook: install/06-proxy-tests.yaml
- import_playbook: install/07-final-tests.yaml
- import_playbook: install/08-smoker.yaml