def test_cluster_check_netscaler_sslcertificates_ok(): assert list( netscaler_sslcertificates.cluster_check_netscaler_sslcertificates( "cert1", PARAMS, { 'node1': SECTION, 'node2': { 'cert3': 123, }, }, )) == [ Result(state=state.OK, summary='[node1]: certificate valid for: 1123 days'), Metric('daysleft', 1123.0), ]
def test_cluster_check_netscaler_sslcertificates_crit(): assert list( netscaler_sslcertificates.cluster_check_netscaler_sslcertificates( "cert2", PARAMS, { 'node1': SECTION, 'node2': SECTION, }, )) == [ Result( state=state.CRIT, summary='[node1]: certificate valid for: 7 days (warn/crit below 30 days/10 days)'), Metric('daysleft', 7.0), Result( state=state.CRIT, summary='[node2]: certificate valid for: 7 days (warn/crit below 30 days/10 days)'), Metric('daysleft', 7.0), ]