Skip to content

Commit

Permalink
Test cpp-simple image (#3497)
Browse files Browse the repository at this point in the history
* Test cpp-simple image

* remove ImagePullPolicy
  • Loading branch information
Kalaiselvi84 authored Nov 10, 2023
1 parent 334a45d commit 9e4400b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/e2e/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,37 @@ func TestRustGameServerReady(t *testing.T) {
// Assert that the GameServer is in the expected state
assert.Equal(t, agonesv1.GameServerStateReady, readyGs.Status.State)
}

func TestCppSimpleGameServerReady(t *testing.T) {
t.Parallel()
gs := &agonesv1.GameServer{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "cpp-simple-",
},
Spec: agonesv1.GameServerSpec{
Ports: []agonesv1.GameServerPort{{
Name: "default",
PortPolicy: agonesv1.Dynamic,
ContainerPort: 7654,
Protocol: corev1.ProtocolUDP,
}},
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "cpp-simple",
Image: "us-docker.pkg.dev/agones-images/examples/cpp-simple-server:0.15",
},
},
},
},
},
}

// Use the e2e framework's function to create the GameServer and wait until it's ready
readyGs, err := framework.CreateGameServerAndWaitUntilReady(t, framework.Namespace, gs)
require.NoError(t, err)

// Assert that the GameServer is in the expected state
assert.Equal(t, agonesv1.GameServerStateReady, readyGs.Status.State)
}

0 comments on commit 9e4400b

Please sign in to comment.