]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Test SQL cache_groups option
authorNick Porter <nick@portercomputing.co.uk>
Mon, 8 Apr 2024 13:23:12 +0000 (14:23 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 8 Apr 2024 13:26:15 +0000 (14:26 +0100)
src/tests/modules/sql/groups.unlang
src/tests/modules/sql/groups_fall_through.unlang
src/tests/modules/sql_mysql/module.conf
src/tests/modules/sql_postgresql/module.conf
src/tests/modules/sql_sqlite/module.conf

index 89481cf0b8e0a0fd9e6a9a476c56728f1f66173a..6aa6622b8824e738a59f418e63add54952e87aa7 100644 (file)
@@ -45,6 +45,22 @@ if !(&reply.Reply-Message == "Hello User B") {
        test_fail
 }
 
+if (&control.SQL-Group[*] == 'groups_group_a') {
+       test_fail
+}
+
+if !(&control.SQL-Group[*] == 'groups_group_b') {
+       test_fail
+}
+
+#
+#  Although the user is in this group, the lack of Fall-Through in radgroupreply
+#  means this will never be processed when calling the sql module in authorize context.
+#
+if (&control.SQL-Group[*] == 'groups_group_c') {
+       test_fail
+}
+
 #
 #  Test paircmp group comparisons
 #
index bbb6951dd7604febac6964ab9a338c8673c4b4cd..468111386456b01d410b45afee4e06f524ae8963 100644 (file)
@@ -44,4 +44,16 @@ if !(&reply.Reply-Message == "Hello Fallthrough User") {
        test_fail
 }
 
+if !(&control.SQL-Group[*] == 'fallthrough_group_a') {
+       test_fail
+}
+
+if !(&control.SQL-Group[*] == 'fallthrough_group_b') {
+       test_fail
+}
+
+if (&control.SQL-Group[*] == 'fallthrough_group_c') {
+       test_fail
+}
+
 test_pass
index fc0183da8031d6c95476d6748c647bc69b7fb5dd..a2a4a83a12d779bed359cca8396faa88b6476a5b 100644 (file)
@@ -38,6 +38,7 @@ sql {
 
        # The group attribute specific to this instance of rlm_sql
        group_attribute = "SQL-Group"
+       cache_groups = yes
 
        # Read database-specific queries
        $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
index 83b1b12bf9e6354e8a99eea49ba8edb1892f93b3..a7fe73fb082107e65e6b66ebaac04c485850729f 100644 (file)
@@ -38,6 +38,7 @@ sql {
 
        # The group attribute specific to this instance of rlm_sql
        group_attribute = "SQL-Group"
+       cache_groups = yes
 
        # Read database-specific queries
        $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
index 7fb9dc75f89820e9bc2c4d641ad8705d254c0472..c6bbb89c1952ed0f2d52df2e037e9969e4ab78d2 100644 (file)
@@ -37,6 +37,7 @@ sql {
 
        # The group attribute specific to this instance of rlm_sql
        group_attribute = "SQL-Group"
+       cache_groups = yes
 
        # Read database-specific queries
        $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf