Skip to content

Commit

Permalink
e2e: simplify the test for DirectToGameServer PodPolicy
Browse files Browse the repository at this point in the history
Can't find a good way to send UDP traffic directly to a pod. This is not something that
k8s does out of the box and requires a product like Calico or similar that uses BGP to
provide direct access to pods. Removing the udp call and making the test much simpler
  • Loading branch information
daniellee committed Apr 29, 2024
1 parent 074b383 commit cc9cf8f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/e2e/gameserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,17 +862,12 @@ func TestGameServerDirectToGameServerPort(t *testing.T) {
assert.FailNow(t, "Could not get a GameServer ready", err.Error())
}

// To test sending UDP traffic directly to a pod, a product like Calico which uses BGP is needed
// so this only tests that the port is set correctly.
port := readyGs.Spec.Ports[0]
assert.Equal(t, agonesv1.DirectToGameServer, port.PortPolicy)
assert.Empty(t, port.HostPort)
assert.EqualValues(t, 7777, port.ContainerPort)

reply, err := framework.SendGameServerUDP(t, readyGs, "Hello World !")
if err != nil {
t.Fatalf("Could ping GameServer: %v", err)
}

assert.Equal(t, "ACK: Hello World !\n", reply)
}

func TestGameServerTcpProtocol(t *testing.T) {
Expand Down

0 comments on commit cc9cf8f

Please sign in to comment.