Skip to content
Closed
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
27 changes: 25 additions & 2 deletions container-images/tcib/base/ansible-tests/run_ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

ANSIBLE_DIR="/var/lib/ansible/ansible"
ANSIBLE_DIR="/var/lib/ansible/ansible/"
ANSIBLE_FILE_EXTRA_VARS_PARAM="${ANSIBLE_FILE_EXTRA_VARS_PARAM:-}"
POD_ANSIBLE_PLAYBOOK="${POD_ANSIBLE_PLAYBOOK:-}"
POD_ANSIBLE_EXTRA_VARS="${POD_ANSIBLE_EXTRA_VARS:-}"
Expand All @@ -15,7 +15,10 @@ if [[ ${POD_DEBUG:-true} == true ]]; then
fi

# Clone the Ansible repository
git clone "$POD_ANSIBLE_GIT_REPO" "$ANSIBLE_DIR"
#git clone "$POD_ANSIBLE_GIT_REPO" "$ANSIBLE_DIR"
# This should be passed in via the appropriate vars
git clone -b "efoley/run_fvt_in_test_operator" "http://github.com/infrawatch/feature-verification-tests" "$ANSIBLE_DIR"/feature-verification-tests
ls "$ANSIBLE_DIR"

# Handle extra vars file if provided
if [[ -n "${POD_ANSIBLE_FILE_EXTRA_VARS:-}" ]]; then
Expand All @@ -40,6 +43,26 @@ else
echo "requirements.yaml doesn't exist, skipping requirements installation"
fi

# Can I add a special config file here? Or arbitrary config vars?
# Q: Can I pass a config file by path?
# Navigate to ansible directory and run playbook
# ANSIBLE_CONFIG can be passed
# This is only needed if I cannot specify which directory to execute from
# IF the ansible runner is always using custom_junit plugin, then having a test-class var passed in will do no harm.
# The ansible.config would just need to change the classname.
# OR we might need to look into passing a config file content into the runner.
cd "$ANSIBLE_DIR"
export ANSIBLE_CONFIG="$ANSIBLE_DIR/feature-verification-tests/ci/ansible.cfg"
# this should be passed in with the appropriate vars.
ls $ANSIBLE_DIR
export POD_ANSIBLE_PLAYBOOK=$ANSIBLE_DIR/feature-verification-tests/ci/run_verify_metrics_osp18.yml
ansible-playbook "$POD_ANSIBLE_PLAYBOOK" $ANSIBLE_DEBUG -i $ANSIBLE_DIR/inventory $POD_ANSIBLE_EXTRA_VARS $ANSIBLE_FILE_EXTRA_VARS_PARAM
# anything that is run by FVT is always going to pass, since it relies on report_results to run afterwards, so I will need to add a new playbook to do the tests and the reporting.
# Currently, the report-results has to be separate since the custom junit plugin will only create the XML files once the playbook is completed.
# After FVT tests are run, there still needs to be a separate hook to check the results (including fetching the results from the pod)
# or else there needs to be some mechanism here to check the results.
# the testoperator expects results files to be in /var/lib/AnsibleTests/external_files/ and this will get copied to cifmw-data/logs
# So the sequence here should be: configure the FVTs to use /var/lib/AnsibleTests/external_files/ as the output dir
# Run the playbook
# run report_results to make the pod fail
cp ~/.ansible.log/ /var/lib/AnsibleTests/external_files/
2 changes: 2 additions & 0 deletions containers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
container_images:
- imagename: quay.io/podified-master-centos9/openstack-ansible-tests:current-podified
20 changes: 15 additions & 5 deletions zuul.d/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@
vars: &edpm_vars
cifmw_run_test_role: test_operator
cifmw_test_operator_stages:
- name: tempest
type: tempest
cifmw_test_operator_tempest_registry: "{{ content_provider_os_registry_url | split('/') | first }}"
cifmw_test_operator_tempest_namespace: "{{ content_provider_os_registry_url | split('/') | last }}"
cifmw_test_operator_tempest_image_tag: "{{ content_provider_dlrn_md5_hash }}"
- name: "fvtansibletests"
type: ansibletest
cifmw_test_operator_ansibletest_workload_ssh_key_secret_name: "dataplane-ansible-ssh-private-key-secret"
cifmw_test_operator_default_registry: "{{ content_provider_os_registry_url | split('/') | first }}"
cifmw_test_operator_default_namespace: "{{ content_provider_os_registry_url | split('/') | last }}"
cifmw_test_operator_default_image_tag: "{{ content_provider_dlrn_md5_hash }}"
cifmw_test_operator_tempest_include_list: |
tempest.scenario.test_network_basic_ops.TestNetworkBasicOps
#cifmw_test_operator_ansibletest_ansible_extra_vars: |
# These configs are usually pulled in from the cifmw artifacts directory, and this should eventually get passed in properly.
cifmw_test_operator_ansibletest_ansible_var_files: |
cifmw_openshift_kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
cifmw_path: "{{ cifmw_path }}"
patch_observabilityclient: true
cifmw_target_hook_host: controller
cifmw_test_operator_ansibletest_ansible_inventory: "{{ lookup('ansible.builtin.file', '/home/zuul/ci-framework-data/artifacts/zuul_inventory.yml') }}"
cifmw_build_containers_config_file: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/tcib'].src_dir }}/containers.yaml"

- job:
name: tcib-crc-podified-edpm-baremetal
Expand Down
4 changes: 2 additions & 2 deletions zuul.d/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- .coveragerc
- LICENSE
- OWNERS*
- tcib-crc-podified-edpm-baremetal:
irrelevant-files: *if
#- tcib-crc-podified-edpm-baremetal:
# irrelevant-files: *if
- tcib-podified-multinode-edpm-deployment-crc:
irrelevant-files: *if