From 23f32061e8e58336da95a17f6ccdf7eca15b5bc3 Mon Sep 17 00:00:00 2001 From: arbulu89 Date: Tue, 4 Apr 2023 17:01:58 +0200 Subject: [PATCH 1/2] Convert meta_attributes to list --- internal/factsengine/gatherers/cibadmin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/factsengine/gatherers/cibadmin.go b/internal/factsengine/gatherers/cibadmin.go index 68a62b32..c0a74075 100644 --- a/internal/factsengine/gatherers/cibadmin.go +++ b/internal/factsengine/gatherers/cibadmin.go @@ -47,7 +47,7 @@ func (g *CibAdminGatherer) Gather(factsRequests []entities.FactRequest) ([]entit elementsToList := map[string]bool{"primitive": true, "clone": true, "master": true, "group": true, "nvpair": true, "op": true, "rsc_location": true, "rsc_order": true, - "rsc_colocation": true, "cluster_property_set": true} + "rsc_colocation": true, "cluster_property_set": true, "meta_attributes": true} factValueMap, err := parseXMLToFactValueMap(cibadmin, elementsToList) if err != nil { From 34230e48aaedad793839a1d8558e4078ab4a9b57 Mon Sep 17 00:00:00 2001 From: arbulu89 Date: Wed, 5 Apr 2023 08:37:07 +0200 Subject: [PATCH 2/2] Add meta_attributes scenario test --- .../factsengine/gatherers/cibadmin_test.go | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/internal/factsengine/gatherers/cibadmin_test.go b/internal/factsengine/gatherers/cibadmin_test.go index 8cccb947..d76561c5 100644 --- a/internal/factsengine/gatherers/cibadmin_test.go +++ b/internal/factsengine/gatherers/cibadmin_test.go @@ -107,6 +107,12 @@ func (suite *CibAdminTestSuite) TestCibAdminGather() { Argument: "cib.configuration.resources.primitive.0", CheckID: "check4", }, + { + Name: "meta_attributes", + Gatherer: "cibadmin", + Argument: "cib.configuration.rsc_defaults.meta_attributes", + CheckID: "check5", + }, } factResults, err := p.Gather(factRequests) @@ -164,6 +170,37 @@ func (suite *CibAdminTestSuite) TestCibAdminGather() { }, CheckID: "check4", }, + { + Name: "meta_attributes", + Value: &entities.FactValueList{ + Value: []entities.FactValue{ + &entities.FactValueMap{ + Value: map[string]entities.FactValue{ + "id": &entities.FactValueString{Value: "rsc-options"}, + "nvpair": &entities.FactValueList{ + Value: []entities.FactValue{ + &entities.FactValueMap{ + Value: map[string]entities.FactValue{ + "id": &entities.FactValueString{Value: "rsc-options-resource-stickiness"}, + "name": &entities.FactValueString{Value: "resource-stickiness"}, + "value": &entities.FactValueInt{Value: 1000}, + }, + }, + &entities.FactValueMap{ + Value: map[string]entities.FactValue{ + "id": &entities.FactValueString{Value: "rsc-options-migration-threshold"}, + "name": &entities.FactValueString{Value: "migration-threshold"}, + "value": &entities.FactValueInt{Value: 5000}, + }, + }, + }, + }, + }, + }, + }, + }, + CheckID: "check5", + }, } suite.NoError(err)