mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 10:19:54 +00:00
explicitly test TCPConnectAnalyze unconditional fallthrough behavior (#1226)
This commit is contained in:
@@ -86,6 +86,40 @@ func TestAnalyzeTCPConnect(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "unknown status",
|
||||
info: &collect.NetworkStatusResult{
|
||||
Status: "test value",
|
||||
},
|
||||
hostAnalyzer: &troubleshootv1beta2.TCPConnectAnalyze{
|
||||
Outcomes: []*troubleshootv1beta2.Outcome{
|
||||
{
|
||||
Fail: &troubleshootv1beta2.SingleOutcome{
|
||||
When: "connection-refused",
|
||||
Message: "Connection was refused",
|
||||
},
|
||||
},
|
||||
{
|
||||
Pass: &troubleshootv1beta2.SingleOutcome{
|
||||
When: "connected",
|
||||
Message: "Connection was successful",
|
||||
},
|
||||
},
|
||||
{
|
||||
Warn: &troubleshootv1beta2.SingleOutcome{
|
||||
Message: "Unexpected TCP connection status",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
result: []*AnalyzeResult{
|
||||
{
|
||||
Title: "TCP Connection Attempt",
|
||||
IsWarn: true,
|
||||
Message: "Unexpected TCP connection status",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user