diff --git a/pkg/agent/openflow/network_policy.go b/pkg/agent/openflow/network_policy.go index 5c57eb1d86d..ebcfd2be57e 100644 --- a/pkg/agent/openflow/network_policy.go +++ b/pkg/agent/openflow/network_policy.go @@ -71,7 +71,7 @@ var ( MatchServiceGroupID = types.NewMatchKey(binding.ProtocolIP, types.ServiceGroupIDAddr, "reg7[0..31]") MatchIGMPProtocol = types.NewMatchKey(binding.ProtocolIGMP, types.IGMPAddr, "igmp") MatchLabelID = types.NewMatchKey(binding.ProtocolIP, types.LabelIDAddr, "tun_id") - MatchTCPFlag = types.NewMatchKey(binding.ProtocolTCP, types.TCPFlagAddr, "tcp_flags") + MatchTCPFlags = types.NewMatchKey(binding.ProtocolTCP, types.TCPFlagsAddr, "tcp_flags") Unsupported = types.NewMatchKey(binding.ProtocolIP, types.UnSupported, "unknown") // metricFlowIdentifier is used to identify metric flows in metric table. @@ -713,31 +713,34 @@ func (c *client) NewDNSPacketInConjunction(id uint32) error { Protocol: &protocolUDP, Port: &dnsPort, } + + c.featureNetworkPolicy.conjMatchFlowLock.Lock() + defer c.featureNetworkPolicy.conjMatchFlowLock.Unlock() + ctxChanges := conj.serviceClause.addServiceFlows(c.featureNetworkPolicy, []v1beta2.Service{udpService}, &dnsPriority, true, false) tcpService := v1beta2.Service{ Protocol: &protocolTCP, Port: &dnsPort, } - tcpServiceMatch := &conjunctiveMatch{ - tableID: conj.serviceClause.ruleTable.GetID(), - matchPairs: []matchPair{ - getServiceMatchPairs(tcpService, c.featureNetworkPolicy.ipProtocols, true)[0][0], - { - matchKey: MatchTCPFlag, - matchValue: TCPFlag{ - // URG|ACK|PSH|RST|SYN|FIN| - Flag: 0b011000, - Mask: 0b011000, + preDNSTCPMatchPairs := getServiceMatchPairs(tcpService, c.featureNetworkPolicy.ipProtocols, true) + for _, preTcpMatchPair := range preDNSTCPMatchPairs { + tcpServiceMatch := &conjunctiveMatch{ + tableID: conj.serviceClause.ruleTable.GetID(), + matchPairs: []matchPair{ + preTcpMatchPair[0], + { + matchKey: MatchTCPFlags, + matchValue: TCPFlag{ + // URG|ACK|PSH|RST|SYN|FIN| + Flag: 0b011000, + Mask: 0b011000, + }, }, }, - }, - priority: &dnsPriority, + priority: &dnsPriority, + } + ctxChange := conj.serviceClause.addConjunctiveMatchFlow(c.featureNetworkPolicy, tcpServiceMatch, false, false) + ctxChanges = append(ctxChanges, ctxChange) } - - c.featureNetworkPolicy.conjMatchFlowLock.Lock() - defer c.featureNetworkPolicy.conjMatchFlowLock.Unlock() - ctxChanges := conj.serviceClause.addServiceFlows(c.featureNetworkPolicy, []v1beta2.Service{udpService}, &dnsPriority, true, false) - ctxChange := conj.serviceClause.addConjunctiveMatchFlow(c.featureNetworkPolicy, tcpServiceMatch, false, false) - ctxChanges = append(ctxChanges, ctxChange) if err := c.featureNetworkPolicy.applyConjunctiveMatchFlows(ctxChanges); err != nil { return err } diff --git a/pkg/agent/openflow/pipeline.go b/pkg/agent/openflow/pipeline.go index 9fc3cab331c..6376d3cdce1 100644 --- a/pkg/agent/openflow/pipeline.go +++ b/pkg/agent/openflow/pipeline.go @@ -2014,12 +2014,10 @@ func (f *featureNetworkPolicy) addFlowMatch(fb binding.FlowBuilder, matchKey *ty fb = fb.MatchProtocol(matchKey.GetOFProtocol()) case MatchLabelID: fb = fb.MatchTunnelID(uint64(matchValue.(uint32))) - case MatchTCPFlag: + case MatchTCPFlags: fb = fb.MatchProtocol(matchKey.GetOFProtocol()) - if matchValue != nil { - tcpFlag := matchValue.(TCPFlag) - fb = fb.MatchTCPFlag(tcpFlag.Flag, tcpFlag.Mask) - } + tcpFlag := matchValue.(TCPFlag) + fb = fb.MatchTCPFlags(tcpFlag.Flag, tcpFlag.Mask) } return fb } diff --git a/pkg/agent/types/networkpolicy.go b/pkg/agent/types/networkpolicy.go index 574d02150e5..66db9c09ff2 100644 --- a/pkg/agent/types/networkpolicy.go +++ b/pkg/agent/types/networkpolicy.go @@ -57,7 +57,7 @@ const ( ServiceGroupIDAddr IGMPAddr LabelIDAddr - TCPFlagAddr + TCPFlagsAddr UnSupported ) diff --git a/pkg/ovs/openflow/interfaces.go b/pkg/ovs/openflow/interfaces.go index 4777a4efaff..6bb9a3d003f 100644 --- a/pkg/ovs/openflow/interfaces.go +++ b/pkg/ovs/openflow/interfaces.go @@ -280,7 +280,7 @@ type FlowBuilder interface { MatchConjID(value uint32) FlowBuilder MatchDstPort(port uint16, portMask *uint16) FlowBuilder MatchSrcPort(port uint16, portMask *uint16) FlowBuilder - MatchTCPFlag(flag, mask uint16) FlowBuilder + MatchTCPFlags(flag, mask uint16) FlowBuilder MatchICMPType(icmpType byte) FlowBuilder MatchICMPCode(icmpCode byte) FlowBuilder MatchICMPv6Type(icmp6Type byte) FlowBuilder diff --git a/pkg/ovs/openflow/ofctrl_builder.go b/pkg/ovs/openflow/ofctrl_builder.go index 578f40b5315..8d9bd573d5e 100644 --- a/pkg/ovs/openflow/ofctrl_builder.go +++ b/pkg/ovs/openflow/ofctrl_builder.go @@ -598,7 +598,7 @@ func (b *ofFlowBuilder) MatchSrcPort(port uint16, portMask *uint16) FlowBuilder return b } -func (b *ofFlowBuilder) MatchTCPFlag(flag, mask uint16) FlowBuilder { +func (b *ofFlowBuilder) MatchTCPFlags(flag, mask uint16) FlowBuilder { b.matchers = append(b.matchers, fmt.Sprintf("tcp_flags=%b/%b", uint8(flag), uint8(mask))) b.Match.TcpFlags = &flag b.Match.TcpFlagsMask = &mask diff --git a/pkg/ovs/openflow/ofctrl_packetin.go b/pkg/ovs/openflow/ofctrl_packetin.go index 612481a8b39..931426d8aeb 100644 --- a/pkg/ovs/openflow/ofctrl_packetin.go +++ b/pkg/ovs/openflow/ofctrl_packetin.go @@ -65,7 +65,20 @@ func GetTCPPacketFromIPMessage(ipPkt util.Message) (tcpPkt *protocol.TCP, err er func GetTCPDataWithoutOptions(tcpPkt *protocol.TCP) (data []byte, err error) { // TCP.HdrLen is 4-octet unit indicating the length of TCP header including options. tcpOptionsLen := (tcpPkt.HdrLen - tcpStandardHdrLen) * 4 - // Trim TCP option end mark which has 1 byte for kind, 1 byte for length and no value. + // Trim TCP option end mark. From RFC 793: + // Specific Option Definitions + // End of Option List + // +--------+ + // |00000000| + // +--------+ + // Kind=0 + // + // This option code indicates the end of the option list. This + // might not coincide with the end of the TCP header according to + // the Data Offset field. This is used at the end of all options, + // not the end of each option, and need only be used if the end of + // the options would not otherwise coincide with the end of the TCP + // header. if tcpPkt.Data[tcpOptionsLen] == tcpOptionEndKind { tcpOptionsLen += 2 } diff --git a/pkg/ovs/openflow/testing/mock_openflow.go b/pkg/ovs/openflow/testing/mock_openflow.go index 54dec6fa2a7..5ed3ce76866 100644 --- a/pkg/ovs/openflow/testing/mock_openflow.go +++ b/pkg/ovs/openflow/testing/mock_openflow.go @@ -2058,18 +2058,18 @@ func (mr *MockFlowBuilderMockRecorder) MatchSrcPort(arg0, arg1 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchSrcPort", reflect.TypeOf((*MockFlowBuilder)(nil).MatchSrcPort), arg0, arg1) } -// MatchTCPFlag mocks base method -func (m *MockFlowBuilder) MatchTCPFlag(arg0, arg1 uint16) openflow.FlowBuilder { +// MatchTCPFlags mocks base method +func (m *MockFlowBuilder) MatchTCPFlags(arg0, arg1 uint16) openflow.FlowBuilder { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MatchTCPFlag", arg0, arg1) + ret := m.ctrl.Call(m, "MatchTCPFlags", arg0, arg1) ret0, _ := ret[0].(openflow.FlowBuilder) return ret0 } -// MatchTCPFlag indicates an expected call of MatchTCPFlag -func (mr *MockFlowBuilderMockRecorder) MatchTCPFlag(arg0, arg1 interface{}) *gomock.Call { +// MatchTCPFlags indicates an expected call of MatchTCPFlags +func (mr *MockFlowBuilderMockRecorder) MatchTCPFlags(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchTCPFlag", reflect.TypeOf((*MockFlowBuilder)(nil).MatchTCPFlag), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchTCPFlags", reflect.TypeOf((*MockFlowBuilder)(nil).MatchTCPFlags), arg0, arg1) } // MatchTunMetadata mocks base method @@ -2950,4 +2950,4 @@ func (m *MockPacketOutBuilder) SetUDPSrcPort(arg0 uint16) openflow.PacketOutBuil func (mr *MockPacketOutBuilderMockRecorder) SetUDPSrcPort(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUDPSrcPort", reflect.TypeOf((*MockPacketOutBuilder)(nil).SetUDPSrcPort), arg0) -} \ No newline at end of file +} diff --git a/test/e2e/antreapolicy_test.go b/test/e2e/antreapolicy_test.go index 3a55effbf43..97fbdd879a2 100644 --- a/test/e2e/antreapolicy_test.go +++ b/test/e2e/antreapolicy_test.go @@ -1554,7 +1554,7 @@ func testANPGroupServiceRefDelete(t *testing.T) { k8sUtils.Validate(allPods, reachability, []int32{80}, ProtocolTCP) _, wrong, _ := reachability.Summary() if wrong != 0 { - t.Errorf("failure -- %d wrong results", wrong) + t.Errorf("Failure -- %d wrong results", wrong) reachability.PrintSummary(true, true, true) } // Delete services, pods should be connected. @@ -1565,7 +1565,7 @@ func testANPGroupServiceRefDelete(t *testing.T) { k8sUtils.Validate(allPods, reachability2, []int32{80}, ProtocolTCP) _, wrong, _ = reachability2.Summary() if wrong != 0 { - t.Errorf("failure -- %d wrong results", wrong) + t.Errorf("Failure -- %d wrong results", wrong) reachability2.PrintSummary(true, true, true) } // Cleanup test resources. @@ -2262,10 +2262,10 @@ func testRejectServiceTraffic(t *testing.T, data *TestData) { log.Tracef("Probing: %s -> %s:%d", tc.clientPod.PodName(), tc.destAddr, tc.destPort) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "antrea-e2e", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -2287,10 +2287,10 @@ func testRejectServiceTraffic(t *testing.T, data *TestData) { log.Tracef("Probing: %s -> %s:%d", tc.clientPod.PodName(), tc.destAddr, tc.destPort) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "antrea-e2e", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -2353,10 +2353,10 @@ func testRejectNoInfiniteLoop(t *testing.T, data *TestData) { log.Tracef("Probing: %s -> %s:%d", tc.clientPod.PodName(), tc.destAddr, tc.destPort) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "antrea-e2e", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -2515,7 +2515,7 @@ func testANPMultipleAppliedTo(t *testing.T, data *TestData, singleRule bool) { k8sUtils.Validate(allPods, reachability, []int32{80}, ProtocolTCP) _, wrong, _ := reachability.Summary() if wrong != 0 { - t.Errorf("failure -- %d wrong results", wrong) + t.Errorf("Failure -- %d wrong results", wrong) reachability.PrintSummary(true, true, true) } @@ -2534,7 +2534,7 @@ func testANPMultipleAppliedTo(t *testing.T, data *TestData, singleRule bool) { k8sUtils.Validate(allPods, reachability, []int32{80}, ProtocolTCP) _, wrong, _ = reachability.Summary() if wrong != 0 { - t.Errorf("failure -- %d wrong results", wrong) + t.Errorf("Failure -- %d wrong results", wrong) reachability.PrintSummary(true, true, true) } @@ -2548,7 +2548,7 @@ func testANPMultipleAppliedTo(t *testing.T, data *TestData, singleRule bool) { k8sUtils.Validate(allPods, reachability, []int32{80}, ProtocolTCP) _, wrong, _ = reachability.Summary() if wrong != 0 { - t.Errorf("failure -- %d wrong results", wrong) + t.Errorf("Failure -- %d wrong results", wrong) reachability.PrintSummary(true, true, true) } @@ -3215,10 +3215,10 @@ func testFQDNPolicy(t *testing.T) { log.Tracef("Probing: %s -> %s", tc.clientPod.PodName(), tc.destAddr) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "pod", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3306,10 +3306,10 @@ func testFQDNPolicyInClusterService(t *testing.T) { log.Tracef("Probing: %s -> %s", tc.clientPod.PodName(), tc.destAddr) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "pod", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3355,10 +3355,10 @@ func testFQDNPolicyTCP(t *testing.T) { log.Tracef("Probing: %s -> %s(%s)", tc.clientPod.PodName(), tc.destAddr, destIP) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "pod", tc.clientPod.PodName(), destIP, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3426,10 +3426,10 @@ func testToServices(t *testing.T) { log.Tracef("Probing: %s -> %s", tc.clientPod.PodName(), tc.destAddr) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "pod", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3513,10 +3513,10 @@ func testServiceAccountSelector(t *testing.T, data *TestData) { log.Tracef("Probing: %s -> %s:%d", tc.clientPod.PodName(), tc.destAddr, tc.destPort) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "antrea-e2e", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3575,10 +3575,10 @@ func testACNPNodeSelectorEgress(t *testing.T) { log.Tracef("Probing: %s -> %s", tc.clientPod.PodName(), tc.destAddr) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "pod", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3650,10 +3650,10 @@ func testACNPNodeSelectorIngress(t *testing.T, data *TestData) { log.Tracef("Probing: %s -> %s", tc.clientPod.PodName(), tc.destAddr) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "antrea-e2e", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolTCP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3722,10 +3722,10 @@ func testACNPICMPSupport(t *testing.T, data *TestData) { log.Tracef("Probing: %s -> %s", tc.clientPod.PodName(), tc.destAddr) connectivity, err := k8sUtils.ProbeAddr(tc.clientPod.Namespace(), "antrea-e2e", tc.clientPod.PodName(), tc.destAddr, tc.destPort, ProtocolICMP) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != tc.expectedConnectivity { - t.Errorf("failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for probe: Source %s/%s --> Dest %s:%d connectivity: %v, expected: %v", tc.clientPod.Namespace(), tc.clientPod.PodName(), tc.destAddr, tc.destPort, connectivity, tc.expectedConnectivity) } } @@ -3812,7 +3812,7 @@ sleep 3600 connectivity = DecideProbeResult(stderr, 3) } if connectivity != Rejected { - t.Errorf("failure -- wrong results for probe: Source 1.1.1.1 --> Dest %s:%d connectivity: %v, expected: Rej", nodeIP(idx), nodePort, connectivity) + t.Errorf("Failure -- wrong results for probe: Source 1.1.1.1 --> Dest %s:%d connectivity: %v, expected: Rej", nodeIP(idx), nodePort, connectivity) } } failOnError(k8sUtils.DeleteACNP(builder.Name), t) @@ -4035,7 +4035,7 @@ func executeTestsWithData(t *testing.T, testList []*TestCase, data *TestData) { _, wrong, _ := step.Reachability.Summary() if wrong != 0 { - t.Errorf("failure -- %d wrong results", wrong) + t.Errorf("Failure -- %d wrong results", wrong) reachability.PrintSummary(true, true, true) } } @@ -4062,10 +4062,10 @@ func doProbe(t *testing.T, data *TestData, p *CustomProbe, protocol AntreaPolicy log.Tracef("Probing: %s -> %s", p.SourcePod.Pod.PodName(), p.DestPod.Pod.PodName()) connectivity, err := k8sUtils.Probe(p.SourcePod.Pod.Namespace(), p.SourcePod.Pod.PodName(), p.DestPod.Pod.Namespace(), p.DestPod.Pod.PodName(), p.Port, protocol) if err != nil { - t.Errorf("failure -- could not complete probe: %v", err) + t.Errorf("Failure -- could not complete probe: %v", err) } if connectivity != p.ExpectConnectivity { - t.Errorf("failure -- wrong results for custom probe: Source %s/%s --> Dest %s/%s connectivity: %v, expected: %v", + t.Errorf("Failure -- wrong results for custom probe: Source %s/%s --> Dest %s/%s connectivity: %v, expected: %v", p.SourcePod.Pod.Namespace(), p.SourcePod.Pod.PodName(), p.DestPod.Pod.Namespace(), p.DestPod.Pod.PodName(), connectivity, p.ExpectConnectivity) } }