123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ---
- - name: OMNIA_1.2_MS_TC_001
- hosts: localhost
- connection: local
- vars_files:
- - ../input_params/base_vars.yml
- - test_vars/test_acct_vars.yml
- gather_subset:
- - 'min'
- tags: VERIFY_OMNIA_02
- tasks:
- - name: Check OS Version
- assert:
- that:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- success_msg: "{{ check_os_success_msg }}"
- fail_msg: "{{ check_os_fail_msg }}"
- tags: Check_OS
- # OMNIA_1.2_acct_TC_001
- # Test case to Verify the enable acct service
- - name: Enable the acct service
- shell: systemctl enable --now acct
- register: acct_enable
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Verify acct service whether enabled or not
- assert:
- that:
- - acct_enable.stderr | regex_search( "{{ acct_enabled }}")
- success_msg: "{{ acct_enable_success_msg }}"
- fail_msg: "{{ acct_disable_fail_msg }}"
- # OMNIA_1.2_acct_TC_002
- # Test case to Check and Start acct Service
- - name: Check the acct service status
- shell: systemctl status acct.service
- register: acct_status
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Verify acct service is started or not
- assert:
- that:
- - acct_status.stdout | regex_search( "{{ acct_active }}")
- success_msg: "{{ acct_service_success_msg }}"
- fail_msg: "{{ acct_service_fail_msg }}"
- # OMNIA_1.2_acct_TC_003
- # Test case to Verify the Package Installation
- - name: Check the acct Package Installation
- shell: rpm -qa | grep -i acct
- register: acct_package
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Verify acct Package whether installed or not
- assert:
- that:
- - acct_package.stdout | regex_search( "acct-6.6.4-2.25.x86_64")
- success_msg: "{{ acct_package_success_msg }}"
- fail_msg: "{{ acct_package_fail_msg }}"
- # OMNIA_1.2_acct_TC_004
- # Test case to Verify the disable acct service
- - name: Disable the acct service
- shell: systemctl disable acct.service
- register: acct_disable
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Enable the acct service
- shell: systemctl enable --now acct
- register: acct_enable
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Verify acct service whether disabled or not
- assert:
- that:
- - acct_disable.stderr | regex_search( "{{ acct_disabled }}")
- success_msg: "{{ acct_disable_success_msg }}"
- fail_msg: "{{ acct_disable_fail_msg }}"
- # OMNIA_1.2_acct_TC_005
- # Test case to Verify ac and sa version
- - name: Check the ac version
- shell: ac -V
- register: ac_version
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Check the as version
- shell: sa -V
- register: sa_version
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Verify ac version
- assert:
- that:
- - ac_version.stdout | regex_search( "{{ acct_ac_version }}")
- success_msg: "{{ acct_ac_version_success_msg }}"
- fail_msg: "{{ acct_ac_version_fail_msg }}"
- - name: Verify sa version
- assert:
- that:
- - sa_version.stdout | regex_search( "{{ acct_sa_version }}")
- success_msg: "{{ acct_sa_version_success_msg }}"
- fail_msg: "{{ acct_sa_version_fail_msg }}"
- # OMNIA_1.2_acct_TC_006
- # Test case to Check Package details of ac and sa utility
- - name: find the complete path of ac
- shell: which ac
- register: ac_path
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: check the package details of ac utility
- shell: rpm -qf {{ ac_path.stdout }}
- register: ac_utility
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Verify package details of ac utility
- assert:
- that:
- - ac_utility.stdout | regex_search( "{{ acct_ac_sa_utility }}")
- success_msg: "{{ acct_ac_utility_success_msg }}"
- fail_msg: "{{ acct_ac_utility_fail_msg }}"
- - name: find the complete path of sa
- shell: which sa
- register: sa_path
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: check the package details of sa utility
- shell: rpm -qf {{ sa_path.stdout }}
- register: sa_utility
- when:
- - 'ansible_distribution == "{{ os_name_leap }}"'
- - name: Verify package details of sa utility
- assert:
- that:
- - sa_utility.stdout | regex_search( "{{ acct_ac_sa_utility }}")
- success_msg: "{{ acct_sa_utility_success_msg }}"
- fail_msg: "{{ acct_sa_utility_fail_msg }}"
|