Skip to content

Commit

Permalink
Merge pull request #245 from atc0005/add-perfdata-success-test-case
Browse files Browse the repository at this point in the history
Add check_cert plugin perfdata success test case
  • Loading branch information
atc0005 authored Mar 28, 2024
2 parents 90c4832 + e8c32c8 commit f209983
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions perfdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,29 @@ func TestParsePerfDataSucceedsForValidInput(t *testing.T) {
},
},
},
"check_cert plugin lifetime metrics single quoted with all semicolon separators": {
input: `'life_remaining_intermediate'=48%;;;; 'life_remaining_leaf'=32%;;;;`,
result: []nagios.PerformanceData{
{
Label: "life_remaining_intermediate",
Value: "48",
UnitOfMeasurement: "%",
Warn: "",
Crit: "",
Min: "",
Max: "",
},
{
Label: "life_remaining_leaf",
Value: "32",
UnitOfMeasurement: "%",
Warn: "",
Crit: "",
Min: "",
Max: "",
},
},
},
}

for name, tt := range tests {
Expand All @@ -609,6 +632,8 @@ func TestParsePerfDataSucceedsForValidInput(t *testing.T) {
t.Fatalf("failed to parse perfdata input: %v", err)
}

t.Logf("perfDataResults: %v", perfDataResults)

testParsePerfDataCollection(t, perfDataResults, tt.result)

})
Expand Down

0 comments on commit f209983

Please sign in to comment.