Skip to content

Commit

Permalink
Add client tests through the proxy on install pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Sep 6, 2021
1 parent b98fd94 commit 75ed2ff
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 3 deletions.
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
4 changes: 2 additions & 2 deletions roles/bats/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ bats_fetch_results: true
bats_environment: {}
bats_git_dir: "/root/bats"
bats_forklift_dir: "/root/forklift"
bats_forklift_repo: "https://github.com/theforeman/forklift.git"
bats_forklift_version: HEAD
bats_forklift_repo: "https://github.com/ehelms/forklift.git"
bats_forklift_version: fix-katello-client-sub-man
bats_output_dir: "/root/bats_results"
bats_remote_dir: "/tmp/debug-{{ pipeline_type | default('foreman') }}-{{ pipeline_version | default('nightly') }}-{{ pipeline_os | default('el7') }}"
bats_update_forklift: "yes"
Expand Down

0 comments on commit 75ed2ff

Please sign in to comment.