You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-msvsphere.ci/molecule/koji_tools/verify.yml

49 lines
1.5 KiB

---
- name: Verify
hosts: all
become: true
vars:
repo_path: /usr/local/koji-tools
tasks:
- include_tasks: ../resources/tests/common/tasks/package_installed.yml
vars:
package_name: "{{ item }}"
with_items:
- git
- python3-cryptography
- name: Collect koji-tools repository directory stats
ansible.builtin.stat:
path: "{{ repo_path }}"
register: repo_path_stats
- name: Verify koji-tools repository directory stats
ansible.builtin.assert:
that: |
repo_path_stats.stat.exists and
repo_path_stats.stat.mode == '0755' and
repo_path_stats.stat.pw_name == 'root' and
repo_path_stats.stat.gr_name == 'root'
- name: Get koji-tools git commit hash
ansible.builtin.command: "git -C {{ repo_path }} log --format='%H' -n 1"
register: git_log
- name: Verify koji-tools git commit hash
ansible.builtin.assert:
that: |
git_log.stdout == '2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38'
fail_msg: koji-tools git commit hash does not match expected 2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38
success_msg: koji-tools git commit hash matches expected 2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38
- name: Execute koji-ssl-admin
ansible.builtin.command: "{{ (repo_path, 'src/bin/koji-ssl-admin' ) | path_join }} -h"
register: koji_ssl_admin_status
- name: Check koji-ssl-admin exit code
ansible.builtin.assert:
that: |
koji_ssl_admin_status.rc == 0