This is an automated email from the ASF dual-hosted git repository.

ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git


The following commit(s) were added to refs/heads/master by this push:
     new c8987b80 [YUNIKORN-2852] Add e2e tests for group names in placement 
rule filter (#908)
c8987b80 is described below

commit c8987b8002b62c43afdce753056c98acd7d4cd91
Author: rrajesh <[email protected]>
AuthorDate: Fri Sep 6 10:10:48 2024 -0500

    [YUNIKORN-2852] Add e2e tests for group names in placement rule filter 
(#908)
    
    Closes: #908
    
    Signed-off-by: Craig Condit <[email protected]>
---
 test/e2e/configmap/configmap_test.go | 59 ++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/test/e2e/configmap/configmap_test.go 
b/test/e2e/configmap/configmap_test.go
index 15cfb095..6f3649c9 100644
--- a/test/e2e/configmap/configmap_test.go
+++ b/test/e2e/configmap/configmap_test.go
@@ -24,6 +24,7 @@ import (
        "io"
        "time"
 
+       "github.com/onsi/ginkgo/v2"
        "github.com/onsi/gomega"
        v1 "k8s.io/api/core/v1"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -209,6 +210,64 @@ partitions:
                gomega.Ω(invalidConfigErr).Should(gomega.HaveOccurred())
        })
 
+       ginkgo.It("Configure the scheduler with a valid group name in placement 
rule filter", func() {
+               validConfig := `
+partitions:
+  - name: default
+    placementrules:
+      - name: fixed
+        value: root_Test-a_b_#_c_#_d_/_e@dom:ain
+        create: true
+        filter:
+          type: allow
+          groups:
+            - group1
+            - group_Test-a_b_#_c_#_d_/_e@dom:ain.com
+    queues:
+      - name: root
+        submitacl: '*'
+`
+               data := map[string]string{"queues.yaml": validConfig}
+               validConfigMap := &v1.ConfigMap{
+                       ObjectMeta: metav1.ObjectMeta{
+                               Name:      constants.ConfigMapName,
+                               Namespace: 
configmanager.YuniKornTestConfig.YkNamespace,
+                       },
+                       Data: data,
+               }
+               cm, err := kClient.UpdateConfigMap(validConfigMap, 
configmanager.YuniKornTestConfig.YkNamespace)
+               gomega.Ω(err).ShouldNot(gomega.HaveOccurred())
+               gomega.Ω(cm).ShouldNot(gomega.BeNil())
+       })
+
+       ginkgo.It("Configure the scheduler with an invalid group name in 
placement rule filter", func() {
+               invalidConfig := `
+partitions:
+  - name: default
+    placementrules:
+      - name: fixed
+        value: root_Test-a_b_#_c_#_d_/_e@dom:ain
+        create: true
+        filter:
+          type: allow
+          groups:
+            - group_inva!lid
+    queues:
+      - name: root
+        submitacl: '*'
+`
+               data := map[string]string{"queues.yaml": invalidConfig}
+               invalidConfigMap := &v1.ConfigMap{
+                       ObjectMeta: metav1.ObjectMeta{
+                               Name:      constants.ConfigMapName,
+                               Namespace: 
configmanager.YuniKornTestConfig.YkNamespace,
+                       },
+                       Data: data,
+               }
+               _, err := kClient.UpdateConfigMap(invalidConfigMap, 
configmanager.YuniKornTestConfig.YkNamespace)
+               gomega.Ω(err).Should(gomega.HaveOccurred())
+       })
+
        AfterEach(func() {
                tests.DumpClusterInfoIfSpecFailed(suiteName, 
[]string{"default"})
                yunikorn.RestoreConfigMapWrapper(oldConfigMap)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to