-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added specific negative scenario test case
- Loading branch information
1 parent
038083b
commit 84a97e6
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
tests/integration/targets/omevv_baseline_profile/tests/invalid_specific.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Dell OpenManage Ansible modules | ||
# Copyright (C) 2024 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
|
||
# GNU General Public License v3.0+ (see COPYING or | ||
# https://www.gnu.org/licenses/gpl-3.0.txt) | ||
--- | ||
- name: Test that we have an OMEVV host, OMEVV username and OMEVV password | ||
ansible.builtin.fail: | ||
msg: 'Please define the following variables: hostname, | ||
vcenter_username and vcenter_password.' | ||
when: 'hostname is not defined or vcenter_username is not defined or | ||
vcenter_password is not defined' | ||
|
||
- name: Set prerequisite | ||
ansible.builtin.include_tasks: _helper.yml | ||
vars: | ||
repository_profile_1_trigger: 1 | ||
|
||
- block: | ||
- name: Negative - Invalid cluster name | ||
dellemc.openmanage.omevv_baseline_profile: | ||
state: present | ||
name: "Profile Name" | ||
cluster: "Invalid cluster" | ||
repository_profile: "OMAM_Firm_Repo" | ||
days: "sunday" | ||
time: "23:00" | ||
register: invalid_cluster | ||
ignore_errors: true | ||
|
||
- name: Verify task status - Negative - Invalid cluster name | ||
ansible.builtin.assert: | ||
that: | ||
- invalid_cluster.failed | ||
- not invalid_cluster.changed | ||
- 'invalid_cluster.msg == "Invalid cluster names: Invalid cluster. | ||
Please provide valid cluster(s)."' | ||
|
||
- name: Negative - Invalid repository name | ||
dellemc.openmanage.omevv_baseline_profile: | ||
state: present | ||
name: "Profile Name" | ||
cluster: "OMAM-Cluster-1" | ||
repository_profile: "Invalid repository" | ||
days: "sunday" | ||
time: "23:00" | ||
register: invalid_repository | ||
ignore_errors: true | ||
|
||
- name: Verify task status - Negative - Invalid cluster name | ||
ansible.builtin.assert: | ||
that: | ||
- invalid_repository.failed | ||
- not invalid_repository.changed | ||
- 'invalid_repository.msg == "Invalid repository profile: Invalid | ||
repository. Please provide a valid profile."' | ||
|
||
- name: Negative - Invalid time | ||
dellemc.openmanage.omevv_baseline_profile: | ||
state: present | ||
name: "Profile Name" | ||
cluster: "OMAM-Cluster-1" | ||
repository_profile: "OMAM_Firm_Repo" | ||
days: "sunday" | ||
time: "25:00" | ||
register: invalid_time | ||
ignore_errors: true | ||
|
||
- name: Verify task status - Negative - Invalid time | ||
ansible.builtin.assert: | ||
that: | ||
- invalid_time.failed | ||
- not invalid_time.changed | ||
- 'invalid_repository.msg == ""Invalid value for time. Enter the value | ||
in positive integer."' | ||
|
||
always: | ||
- name: Post clean up | ||
ansible.builtin.include_tasks: _cleanup.yml | ||
vars: | ||
delete_repository_profile_1_trigger: 1 | ||
|
||
module_defaults: | ||
dellemc.openmanage.omevv_baseline_profile: | ||
validate_certs: "{{ validate_certs }}" | ||
hostname: "{{ hostname | ansible.utils.ipwrap }}" | ||
vcenter_username: "{{ vcenter_username }}" | ||
vcenter_password: "{{ vcenter_password }}" | ||
vcenter_uuid: "{{ uuid }}" |