From: Nick Porter Date: Thu, 11 Jan 2024 18:27:47 +0000 (+0000) Subject: Use triggers to detect readiness for LDAP sync tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f6737a6add399e495eee61ce6d733f9db9c62b5;p=thirdparty%2Ffreeradius-server.git Use triggers to detect readiness for LDAP sync tests Already working for rfc4533 - no reason they should have issues for other directories. --- diff --git a/src/tests/ldap_sync/active_directory/all.mk b/src/tests/ldap_sync/active_directory/all.mk index 567c60246dd..2f9cc27fcc2 100644 --- a/src/tests/ldap_sync/active_directory/all.mk +++ b/src/tests/ldap_sync/active_directory/all.mk @@ -36,15 +36,14 @@ $(OUTPUT)/%: $(DIR)/% | $(TEST).trigger_clear $(TEST).radiusd_kill $(TEST).radiu ${Q}rm -f $(OUT_DIR)/$(OUT).out # Wait for the sync to start before applying changes -# ${Q}i=0; while [ $$i -lt 100 ] ; \ -# do if [ -e $(OUT_DIR)/sync_started ]; \ -# then \ -# break; \ -# fi; \ -# sleep .1; \ -# i=$$((i+1)); \ -# done; - ${Q}sleep 1 + ${Q}i=0; while [ $$i -lt 100 ] ; \ + do if [ -e $(OUT_DIR)/sync_started ]; \ + then \ + break; \ + fi; \ + sleep .1; \ + i=$$((i+1)); \ + done; ${Q}$< ${Q}i=0; while [ $$i -lt 600 ] ; \ diff --git a/src/tests/ldap_sync/active_directory/config/radiusd.conf b/src/tests/ldap_sync/active_directory/config/radiusd.conf index 78dbfd92b7e..c9eac7b2ca5 100644 --- a/src/tests/ldap_sync/active_directory/config/radiusd.conf +++ b/src/tests/ldap_sync/active_directory/config/radiusd.conf @@ -124,9 +124,9 @@ server test { &SMB-Account-CTRL = 'userAccountControl' } -# trigger { -# start = "/usr/bin/touch ${run_dir}/sync_started" -# } + trigger { + start = "/usr/bin/touch ${run_dir}/sync_started" + } } sync { diff --git a/src/tests/ldap_sync/persistent_search/all.mk b/src/tests/ldap_sync/persistent_search/all.mk index 1c5dee42cb4..54dc3a85aef 100644 --- a/src/tests/ldap_sync/persistent_search/all.mk +++ b/src/tests/ldap_sync/persistent_search/all.mk @@ -32,15 +32,14 @@ $(OUTPUT)/%: $(DIR)/% | $(TEST).trigger_clear $(TEST).radiusd_kill $(TEST).radiu ${Q}rm -f $(OUT_DIR)/$(OUT).out # Wait for the sync to start before applying changes -# ${Q}i=0; while [ $$i -lt 100 ] ; \ -# do if [ -e $(OUT_DIR)/sync_started ] ; \ -# then \ -# break; \ -# fi; \ -# sleep .1; \ -# i=$$((i+1)); \ -# done; - ${Q}sleep 1 + ${Q}i=0; while [ $$i -lt 100 ] ; \ + do if [ -e $(OUT_DIR)/sync_started ] ; \ + then \ + break; \ + fi; \ + sleep .1; \ + i=$$((i+1)); \ + done; ${Q}ldapmodify $(ARGV) -f $< > /dev/null ${Q}i=0; while [ $$i -lt 600 ] ; \ diff --git a/src/tests/ldap_sync/persistent_search/config/radiusd.conf b/src/tests/ldap_sync/persistent_search/config/radiusd.conf index 525e4aabbc9..808e517c789 100644 --- a/src/tests/ldap_sync/persistent_search/config/radiusd.conf +++ b/src/tests/ldap_sync/persistent_search/config/radiusd.conf @@ -143,9 +143,9 @@ server test { &Password.With-Header = 'userPassword' } -# trigger { -# start = "/usr/bin/touch ${run_dir}/sync_started" -# } + trigger { + start = "/usr/bin/touch ${run_dir}/sync_started" + } } sync {