Skip to content

Commit

Permalink
Add verbose option to awaitFinish of network_pods
Browse files Browse the repository at this point in the history
Signed-off-by: Maayan Friedman <maafried@redhat.com>
  • Loading branch information
maayanf24 authored and tpantelis committed Oct 19, 2020
1 parent 83d79b9 commit 4253d87
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/e2e/framework/network_pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ func (np *NetworkPod) AwaitReady() {
}

func (np *NetworkPod) AwaitFinish() {
np.AwaitFinishVerbose(true)
}

func (np *NetworkPod) AwaitFinishVerbose(verbose bool) {
pods := KubeClients[np.Config.Cluster].CoreV1().Pods(np.framework.Namespace)

_, np.TerminationErrorMsg, np.TerminationError = AwaitResultOrError(fmt.Sprintf("await pod %q finished", np.Pod.Name), func() (interface{}, error) {
Expand All @@ -142,7 +146,11 @@ func (np *NetworkPod) AwaitFinish() {
np.TerminationCode = np.Pod.Status.ContainerStatuses[0].State.Terminated.ExitCode
np.TerminationMessage = np.Pod.Status.ContainerStatuses[0].State.Terminated.Message

Logf("Pod %q output:\n%s", np.Pod.Name, removeDupDataplaneLines(np.TerminationMessage))
if verbose {
Logf("Pod %q output:\n%s", np.Pod.Name, removeDupDataplaneLines(np.TerminationMessage))
} else {
fmt.Printf("%s", removeDupDataplaneLines(np.TerminationMessage))
}
}
}

Expand Down

0 comments on commit 4253d87

Please sign in to comment.