Skip to content

Commit

Permalink
e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TiberiuGC committed Dec 10, 2024
1 parent a7ff8ad commit 36c0886
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
16 changes: 15 additions & 1 deletion integration/tests/crud/creategetdelete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const (
deleteNg = "ng-delete"
taintsNg1 = "ng-taints-1"
taintsNg2 = "ng-taints-2"
maxPodsMNG1 = "mng-max-pods-1"
maxPodsMNG2 = "mng-max-pods-2"
scaleSingleNg = "ng-scale-single"
scaleMultipleNg = "ng-scale-multiple"

Expand Down Expand Up @@ -872,6 +874,8 @@ var _ = Describe("(Integration) Create, Get, Scale & Delete", func() {
clientset := makeClientset()
nodeListN1 := tests.ListNodes(clientset, taintsNg1)
nodeListN2 := tests.ListNodes(clientset, taintsNg2)
mngNodeListN1 := tests.ListNodes(clientset, maxPodsMNG1)
mngNodeListN2 := tests.ListNodes(clientset, maxPodsMNG2)

tests.AssertNodeTaints(nodeListN1, []corev1.Taint{
{
Expand All @@ -896,12 +900,22 @@ var _ = Describe("(Integration) Create, Get, Scale & Delete", func() {
},
})

By("asserting that maxPods is set correctly")
By("asserting that maxPods is set correctly for AL2 nodegroup")
expectedMaxPods := 123
for _, node := range nodeListN1.Items {
maxPods, _ := node.Status.Allocatable.Pods().AsInt64()
Expect(maxPods).To(Equal(int64(expectedMaxPods)))
}

By("asserting that maxPods is set correctly for AL2023 nodegroups")
for _, node := range mngNodeListN1.Items {
maxPods, _ := node.Status.Allocatable.Pods().AsInt64()
Expect(maxPods).To(Equal(int64(expectedMaxPods)))
}
for _, node := range mngNodeListN2.Items {
maxPods, _ := node.Status.Allocatable.Pods().AsInt64()
Expect(maxPods).To(Equal(int64(expectedMaxPods)))
}
})

It("should be able to create a new GPU nodegroup", func() {
Expand Down
40 changes: 27 additions & 13 deletions integration/tests/crud/testdata/taints-max-pods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@ metadata:
name: <generated>

nodeGroups:
- name: ng-taints-1
taints:
key1: val1:NoSchedule
key2: :NoExecute
maxPodsPerNode: 123
- name: ng-taints-2
volumeSize: 35
taints:
- key: key1
value: value1
effect: NoSchedule
- key: key2
effect: NoExecute
- name: ng-taints-1
taints:
key1: val1:NoSchedule
key2: :NoExecute
maxPodsPerNode: 123
- name: ng-taints-2
volumeSize: 35
taints:
- key: key1
value: value1
effect: NoSchedule
- key: key2
effect: NoExecute

managedNodeGroups:
- name: mng-max-pods-1
desiredCapacity: 1
maxPodsPerNode: 123
- name: mng-max-pods-2
desiredCapacity: 1
overrideBootstrapCommand: |
apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
kubelet:
config:
maxPods: 123

0 comments on commit 36c0886

Please # to comment.