Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing mixed ensa version checks #365

Closed
wants to merge 1 commit into from
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
25 changes: 25 additions & 0 deletions test/fixtures/catalog/mixed_ensa_opt1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
id: "mixed_ensa_opt1"
name: Check not differentiating on ensa version
group: Sapcontrol - HA
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec odio nec nunc tincidunt tincidunt
remediation: |
## Abstract

metadata:
target_type: cluster
cluster_type: ascs_ers
ensa_version:
- ensa1
- ensa2
fs_type:
- classic
- simplemount

facts:
- name: jedi
gatherer: wandalorian
argument: -o

expectations:
- name: some_expectation
expect: facts.jedi == values.expected_value
22 changes: 22 additions & 0 deletions test/fixtures/catalog/mixed_ensa_opt2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
id: "mixed_ensa_opt2"
name: Check not differentiating on ensa version
group: Sapcontrol - HA
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec odio nec nunc tincidunt tincidunt
remediation: |
## Abstract

metadata:
target_type: cluster
cluster_type: ascs_ers
fs_type:
- classic
- simplemount

facts:
- name: jedi
gatherer: wandalorian
argument: -o

expectations:
- name: some_expectation
expect: facts.jedi == values.expected_value
24 changes: 24 additions & 0 deletions test/wanda/catalog_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ defmodule Wanda.CatalogTest do
assert Enum.any?(catalog, fn %Check{id: id} -> id == "with_metadata" end)
end

test "this should find mixed_ensa_opt1 but it does not" do
catalog =
Catalog.get_catalog(%{
"target_type" => "cluster",
"cluster_type" => "ascs_ers",
"ensa_version" => "mixed_versions",
"filesystem_type" => "resource_managed"
})

refute Enum.any?(catalog, fn %Check{id: id} -> id == "mixed_ensa_opt1" end)
end

test "option without ensa versions defined working" do
catalog =
Catalog.get_catalog(%{
"target_type" => "cluster",
"cluster_type" => "ascs_ers",
"ensa_version" => "mixed_versions",
"filesystem_type" => "resource_managed"
})

assert Enum.any?(catalog, fn %Check{id: id} -> id == "mixed_ensa_opt2" end)
end

test "should load a check from a yaml file properly" do
assert {:ok,
%Check{
Expand Down
Loading