Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Support traceflow #3022

Merged
merged 1 commit into from May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/agent/openflow/client_test.go
Expand Up @@ -367,6 +367,7 @@ func Test_client_SendTraceflowPacket(t *testing.T) {
name: "IPv6 ICMPv6",
args: args{
Packet: binding.Packet{
IsIPv6: true,
SourceMAC: srcMAC,
DestinationMAC: dstMAC,
SourceIP: net.ParseIP("1111::4444"),
Expand All @@ -381,6 +382,7 @@ func Test_client_SendTraceflowPacket(t *testing.T) {
name: "IPv6 TCP",
args: args{
Packet: binding.Packet{
IsIPv6: true,
SourceMAC: srcMAC,
DestinationMAC: dstMAC,
SourceIP: net.ParseIP("1111::4444"),
Expand All @@ -394,6 +396,7 @@ func Test_client_SendTraceflowPacket(t *testing.T) {
name: "IPv6 UDP",
args: args{
Packet: binding.Packet{
IsIPv6: true,
SourceMAC: srcMAC,
DestinationMAC: dstMAC,
SourceIP: net.ParseIP("1111::4444"),
Expand Down
18 changes: 15 additions & 3 deletions test/e2e/fixtures.go
Expand Up @@ -437,6 +437,18 @@ func deletePodWrapper(tb testing.TB, data *TestData, namespace, name string) {
// created Pods. Pods are created in parallel to reduce the time required to run the tests.
func createTestBusyboxPods(tb testing.TB, data *TestData, num int, ns string, nodeName string) (
podNames []string, podIPs []*PodIPs, cleanupFn func(),
) {
return createTestPods(tb, data, num, ns, nodeName, data.createBusyboxPodOnNode)
}

func createTestAgnhostPods(tb testing.TB, data *TestData, num int, ns string, nodeName string) (
podNames []string, podIPs []*PodIPs, cleanupFn func(),
) {
return createTestPods(tb, data, num, ns, nodeName, data.createAgnhostPodOnNode)
}

func createTestPods(tb testing.TB, data *TestData, num int, ns string, nodeName string, createFunc func(string, string, string, bool) error) (
podNames []string, podIPs []*PodIPs, cleanupFn func(),
) {
cleanupFn = func() {
var wg sync.WaitGroup
Expand All @@ -458,9 +470,9 @@ func createTestBusyboxPods(tb testing.TB, data *TestData, num int, ns string, no

createPodAndGetIP := func() (string, *PodIPs, error) {
podName := randName("test-pod-")
tb.Logf("Creating a busybox test Pod '%s' and waiting for IP", podName)
if err := data.createBusyboxPodOnNode(podName, ns, nodeName, false); err != nil {
tb.Errorf("Error when creating busybox test Pod '%s': %v", podName, err)
tb.Logf("Creating a test Pod '%s' and waiting for IP", podName)
if err := createFunc(podName, ns, nodeName, false); err != nil {
tb.Errorf("Error when creating test Pod '%s': %v", podName, err)
return "", nil, err
}
podIP, err := data.podWaitForIPs(defaultTimeout, podName, ns)
Expand Down