K8sbykeshed / k8s-service-validator

Kubernetes Network Service Validator
22 stars 10 forks source link

Add identifiers for different tests in the result message #40

Open yzaccc opened 3 years ago

yzaccc commented 3 years ago

We run different sets of tests with ./svc-test, with the pretty format test result below, it's hard to tell what's the tests' purpose from the result message, ex. testing connections for clusterIPort nodePort or loadbalancer.

Amplify the result message for each test, and add a summary message for the results of all tests.

reachability: correct:16, incorrect:0, result=true

52 <nil>
expected:

-       x-55117/pod-1   x-55117/pod-2   x-55117/pod-3   x-55117/pod-4
x-55117/pod-1   .       .       .       .
x-55117/pod-2   .       .       .       .
x-55117/pod-3   .       .       .       .
x-55117/pod-4   .       .       .       .

176 <nil>
observed:

-       x-55117/pod-1   x-55117/pod-2   x-55117/pod-3   x-55117/pod-4
x-55117/pod-1   .       .       .       .
x-55117/pod-2   .       .       .       .
x-55117/pod-3   .       .       .       .
x-55117/pod-4   .       .       .       .

176 <nil>
comparison:

-       x-55117/pod-1   x-55117/pod-2   x-55117/pod-3   x-55117/pod-4
x-55117/pod-1   .       .       .       .
x-55117/pod-2   .       .       .       .
x-55117/pod-3   .       .       .       .
x-55117/pod-4   .       .       .       .

178 <nil>
{"level":"info","ts":1636589916.03517,"caller":"matrix/helper.go:60","msg":"VALIDATION SUCCESSFUL"}
PASS