Skip to content

Commit

Permalink
change variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafal Wegrzycki authored and rafwegv committed Sep 21, 2020
1 parent e896ae4 commit 8ffdeb3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/k8s/app_protect_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8ffdeb3

Please sign in to comment.