diff --git a/internal/k8s/app_protect_resources_test.go b/internal/k8s/app_protect_resources_test.go index c01e65eafd..385fb03d5f 100644 --- a/internal/k8s/app_protect_resources_test.go +++ b/internal/k8s/app_protect_resources_test.go @@ -4,15 +4,16 @@ import ( "strings" "testing" ) -// Positive test cases -var posDstAntns = []string{"stderr", "syslog:server=localhost:9000", "syslog:server=10.1.1.2:9000", "/var/log/ap.log"} -// Negative test cases item, expected error message -var negDstAntns = [][]string{{"stdout", "Log Destination did not follow format"}, +func TestValidateAppProtectLogDestinationAnnotation(t *testing.T) { + // Positive test cases + var posDstAntns = []string{"stderr", "syslog:server=localhost:9000", "syslog:server=10.1.1.2:9000", "/var/log/ap.log"} + + // Negative test cases item, expected error message + var negDstAntns = [][]string{{"stdout", "Log Destination did not follow format"}, {"syslog:server=localhost:99999", "not a valid port number"}, {"syslog:server=999.99.99.99:5678", "is not a valid ip address"}} -func TestValidateAppProtectLogDestinationAnnotation(t *testing.T) { for _, tCase := range posDstAntns { err := ValidateAppProtectLogDestinationAnnotation(tCase) if err != nil {