7e1b55
From f7997ed0b7d5b915c0184bf8e8864ff935cd6232 Mon Sep 17 00:00:00 2001
7e1b55
From: Florence Blanc-Renaud <flo@redhat.com>
7e1b55
Date: Fri, 16 Jul 2021 15:21:48 +0200
7e1b55
Subject: [PATCH] webui tests: fix algo for finding available idrange
7e1b55
7e1b55
The webui tests for ID range evaluate a potentially free id range
7e1b55
by looking for existing ranges and picking a range = max value
7e1b55
+ 1 million.
7e1b55
7e1b55
With the addition of subuid range this algorithm produces values
7e1b55
over the limit because the subuid range goes from
7e1b55
2,147,483,648 to 4,294,836,224 and the max base id is 4,294,967,295.
7e1b55
7e1b55
Ignore the subuid range when picking a potential range.
7e1b55
Fixes: https://pagure.io/freeipa/issue/8919
7e1b55
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
7e1b55
---
7e1b55
 ipatests/test_webui/task_range.py | 6 ++++++
7e1b55
 1 file changed, 6 insertions(+)
7e1b55
7e1b55
diff --git a/ipatests/test_webui/task_range.py b/ipatests/test_webui/task_range.py
7e1b55
index db34f6f11..f0664d35a 100644
7e1b55
--- a/ipatests/test_webui/task_range.py
7e1b55
+++ b/ipatests/test_webui/task_range.py
7e1b55
@@ -64,6 +64,12 @@ class range_tasks(UI_driver):
7e1b55
         max_rid = 0
7e1b55
 
7e1b55
         for idrange in idranges:
7e1b55
+            # IPA.TEST_subid_range is automatically created near the end
7e1b55
+            # of the allowed ids, taking from 2,147,483,648 to 4,294,836,224
7e1b55
+            # Ignore this range when looking for available ids otherwise
7e1b55
+            # we won't find any value < max baseid 4,294,967,295
7e1b55
+            if idrange['cn'][0].endswith("_subid_range"):
7e1b55
+                continue
7e1b55
             size = int(idrange['ipaidrangesize'][0])
7e1b55
             base_id = int(idrange['ipabaseid'][0])
7e1b55
 
7e1b55
-- 
7e1b55
2.31.1
7e1b55