From: Nick Porter Date: Thu, 11 Jan 2024 17:46:04 +0000 (+0000) Subject: Remove Tmp- attributes from LDAP sync tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75cbc815a6b46b2e41880fc0b7fbce62044544ee;p=thirdparty%2Ffreeradius-server.git Remove Tmp- attributes from LDAP sync tests --- diff --git a/src/tests/ldap_sync/active_directory/config/radiusd.conf b/src/tests/ldap_sync/active_directory/config/radiusd.conf index 225562b6816..78dbfd92b7e 100644 --- a/src/tests/ldap_sync/active_directory/config/radiusd.conf +++ b/src/tests/ldap_sync/active_directory/config/radiusd.conf @@ -40,10 +40,6 @@ trigger { } policy { - linelogprep { - &control.Tmp-String-0 := "%{Packet-Type} %{LDAP-Sync.DN} %{LDAP-Sync.Entry-DN} %{Proto.radius.User-Name} %{Tmp-Integer-0} %{Tmp-String-0}" - } - $INCLUDE ${maindir}/policy.d/ } @@ -55,7 +51,7 @@ client localhost { modules { linelog { - format = "%{control.Tmp-String-0}" + format = "%{Packet-Type} %{LDAP-Sync.DN} %{LDAP-Sync.Entry-DN} %{Proto.radius.User-Name} %{SMB-Account-CTRL} %{User-Category}" destination = file file { @@ -125,7 +121,7 @@ server test { update { &Proto.radius.User-Name = 'sAMAccountName' - &Tmp-Integer-0 = 'userAccountControl' + &SMB-Account-CTRL = 'userAccountControl' } # trigger { @@ -140,8 +136,8 @@ server test { update { &Proto.radius.User-Name = 'sAMAccountName' - &Tmp-Integer-0 = 'userAccountControl' - &Tmp-String-0 = 'isDeleted' + &SMB-Account-CTRL = 'userAccountControl' + &User-Category = 'isDeleted' } } } @@ -153,12 +149,10 @@ server test { } recv Add { - linelogprep linelog } recv Modify { - linelogprep linelog } @@ -167,10 +161,9 @@ server test { # The DN changes for each deleted object - normalise the variable bit # so we can check the output # - if (&LDAP-Sync[0].Entry-DN =~ /(CN=.+:)[a-f0-9-]+(,CN=Deleted Objects,DC=example,DC=com)/) { - &request.LDAP-Sync[0].Entry-DN := "%{1}oldid%{2}" + if (&LDAP-Sync.Entry-DN =~ /(CN=.+:)[a-f0-9-]+(,CN=Deleted Objects,DC=example,DC=com)/) { + &request.LDAP-Sync.Entry-DN := "%{1}oldid%{2}" } - linelogprep linelog } diff --git a/src/tests/ldap_sync/persistent_search/config/radiusd.conf b/src/tests/ldap_sync/persistent_search/config/radiusd.conf index 5020fdf8857..525e4aabbc9 100644 --- a/src/tests/ldap_sync/persistent_search/config/radiusd.conf +++ b/src/tests/ldap_sync/persistent_search/config/radiusd.conf @@ -41,18 +41,17 @@ trigger { policy { linelogprep { - &request.Tmp-String-8 := &LDAP-Sync.DN - if (&Tmp-String-8 == "ou=people,dc=example,dc=com") { - &control.Tmp-String-9 := "people" + if (&LDAP-Sync.DN == 'ou=people,dc=example,dc=com') { + &control.LDAP-Sync.DN := 'people' } else { - &control.Tmp-String-9 := "group" + &control.LDAP-Sync.DN := 'group' } - &control.Tmp-String-0 := "%{Packet-Type} %{LDAP-Sync.DN} %{LDAP-Sync.Entry-DN} %{LDAP-Sync.Original-DN} %{Proto.radius.User-Name}" + &Linelog-Entry := "%{Packet-Type} %{LDAP-Sync.DN} %{LDAP-Sync.Entry-DN} %{LDAP-Sync.Original-DN} %{Proto.radius.User-Name}" } grouplog { - foreach &Tmp-String-1 { - &control.Tmp-String-0 := "Group member %{Foreach-Variable-0}" + foreach &Stripped-User-Name { + &Linelog-Entry := "Group member %{Foreach-Variable-0}" linelog } } @@ -68,11 +67,11 @@ client localhost { modules { linelog { - format = "%{control.Tmp-String-0}" + format = &Linelog-Entry destination = file file { - filename = ${run_dir}/%{control.Tmp-String-9}%{Packet-Type}%{Proto.radius.User-Name}%{Tmp-String-2}.out + filename = ${run_dir}/%{control.LDAP-Sync.DN}%{Packet-Type}%{Proto.radius.User-Name}%{User-Category}.out } } @@ -112,6 +111,10 @@ modules { server test { namespace = ldap_sync + dictionary { + string Linelog-Entry + } + listen { transport = ldap @@ -151,8 +154,8 @@ server test { scope = "sub" update { - &Tmp-String-1 += "member" - &Tmp-String-2 = 'cn' + &Stripped-User-Name += "member" + &User-Category = 'cn' } } } diff --git a/src/tests/ldap_sync/rfc4533/config/radiusd.conf b/src/tests/ldap_sync/rfc4533/config/radiusd.conf index f2d19554502..7b21fb50429 100644 --- a/src/tests/ldap_sync/rfc4533/config/radiusd.conf +++ b/src/tests/ldap_sync/rfc4533/config/radiusd.conf @@ -41,18 +41,17 @@ trigger { policy { linelogprep { - &request.Tmp-String-8 := &LDAP-Sync.DN - if (&Tmp-String-8 == "ou=people,dc=example,dc=com") { - &control.Tmp-String-9 := "people" + if (&LDAP-Sync.DN == 'ou=people,dc=example,dc=com') { + &control.LDAP-Sync.DN := 'people' } else { - &control.Tmp-String-9 := "group" + &control.LDAP-Sync.DN := 'group' } - &control.Tmp-String-0 := "%{Packet-Type} %{LDAP-Sync.DN} %{LDAP-Sync.Entry-DN} %{Proto.radius.User-Name}" + &Linelog-Entry := "%{Packet-Type} %{LDAP-Sync.DN} %{LDAP-Sync.Entry-DN} %{Proto.radius.User-Name}" } grouplog { - foreach &Tmp-String-1 { - &control.Tmp-String-0 := "Group member %{Foreach-Variable-0}" + foreach &Stripped-User-Name { + &Linelog-Entry := "Group member %{Foreach-Variable-0}" linelog } } @@ -90,16 +89,16 @@ modules { } linelog { - format = "%{control.Tmp-String-0}" + format = &Linelog-Entry destination = file file { - filename = ${run_dir}/%{control.Tmp-String-9}%{Packet-Type}%{Proto.radius.User-Name}%{Tmp-String-2}.out + filename = ${run_dir}/%{control.LDAP-Sync.DN}%{Packet-Type}%{Proto.radius.User-Name}%{User-Category}.out } } linelog cookielog { - format = "Cookie = %{control.Tmp-String-0}" + format = "Cookie = %{Linelog-Entry}" destination = file file { @@ -143,6 +142,10 @@ modules { server test { namespace = ldap_sync + dictionary { + string Linelog-Entry + } + listen { transport = ldap cookie_changes = 2 @@ -182,8 +185,8 @@ server test { scope = "sub" update { - &Tmp-String-1 += "member" - &Tmp-String-2 = 'cn' + &Stripped-User-Name += "member" + &User-Category = 'cn' } } } @@ -196,7 +199,7 @@ server test { } store Cookie { - &control.Tmp-String-0 := &LDAP-Sync.Cookie + &Linelog-Entry := &LDAP-Sync.Cookie cookielog }