include src/tests/radiusd.mk
$(eval $(call RADIUSD_SERVICE,radiusd,$(OUTPUT)))
+$(TEST).trigger_clear:
+ $(Q)rm -f $(BUILD_DIR)/tests/ldap_sync/active_directory/sync_started
+
#
# There is a delay of up to 30 seconds looking for the output file
# as samba only sends results of persistent LDAP searches on a polled
# basis. Real Active Directory sends the results immediately.
#
-$(OUTPUT)/%: $(DIR)/% | $(TEST).radiusd_kill $(TEST).radiusd_start
+$(OUTPUT)/%: $(DIR)/% | $(TEST).trigger_clear $(TEST).radiusd_kill $(TEST).radiusd_start
$(eval TARGET := $(notdir $<))
$(eval EXPECTED := $(patsubst %.sh,%.out,$<))
$(eval FOUND := $(patsubst %.sh,%.out,$@))
$(Q)echo "LDAPSYNC-TEST active_directory $(TARGET)"
$(Q)[ -f $(dir $@)/radiusd.pid ] || exit 1
$(Q)rm -f $(OUT_DIR)/$(OUT).out
- $(Q)sleep 1
+
+# 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)$<
$(Q)i=0; while [ $$i -lt 600 ] ; \
do if [ -e $(OUT_DIR)/$(OUT).out ] ; \
}
}
+# Dummy global trigger section to enable triggers
+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}"
&Proto.radius.User-Name = 'sAMAccountName'
&Tmp-Integer-0 = 'userAccountControl'
}
+
+ trigger {
+ start = "/usr/bin/touch ${run_dir}/sync_started"
+ }
}
sync {
include src/tests/radiusd.mk
$(eval $(call RADIUSD_SERVICE,radiusd,$(OUTPUT)))
-$(OUTPUT)/%: $(DIR)/% | $(TEST).radiusd_kill $(TEST).radiusd_start
+$(TEST).trigger_clear:
+ $(Q)rm -f $(BUILD_DIR)/tests/ldap_sync/persistent_search/sync_started
+
+$(OUTPUT)/%: $(DIR)/% | $(TEST).trigger_clear $(TEST).radiusd_kill $(TEST).radiusd_start
$(eval TARGET := $(notdir $<))
$(eval EXPECTED := $(patsubst %.ldif,%.out,$<))
$(eval FOUND := $(patsubst %.ldif,%.out,$@))
$(Q)echo "LDAPSYNC-TEST persistent_search $(TARGET)"
$(Q)[ -f $(dir $@)/radiusd.pid ] || exit 1
$(Q)rm -f $(OUT_DIR)/$(OUT).out
- $(Q)sleep 1
+
+# 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)ldapmodify $(ARGV) -f $< > /dev/null
$(Q)i=0; while [ $$i -lt 600 ] ; \
do if [ -e $(OUT_DIR)/$(OUT).out ] ; \
}
}
+# Dummy global trigger section to enable triggers
+trigger {
+}
+
policy {
linelogprep {
&request.Tmp-String-8 := &LDAP-Sync.DN
&Proto.radius.User-Name = 'uid'
&Password.With-Header = 'userPassword'
}
+
+ trigger {
+ start = "/usr/bin/touch ${run_dir}/sync_started"
+ }
}
sync {
include src/tests/radiusd.mk
$(eval $(call RADIUSD_SERVICE,radiusd,$(OUTPUT)))
-$(OUTPUT)/%: $(DIR)/% | $(TEST).radiusd_kill $(TEST).radiusd_start
+$(TEST).trigger_clear:
+ $(Q)rm -f $(BUILD_DIR)/tests/ldap_sync/rfc4533/sync_started
+
+$(OUTPUT)/%: $(DIR)/% | $(TEST).trigger_clear $(TEST).radiusd_kill $(TEST).radiusd_start
$(eval TARGET := $(notdir $<))
$(eval EXPECTED := $(patsubst %.ldif,%.out,$<))
$(eval FOUND := $(patsubst %.ldif,%.out,$@))
$(Q)echo "LDAPSYNC-TEST rfc4533 $(TARGET)"
$(Q)[ -f $(dir $@)/radiusd.pid ] || exit 1
$(Q)rm -f $(OUT_DIR)/$(OUT).out
- $(Q)sleep 1
+
+# 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)ldapmodify $(ARGV) -f $< > /dev/null
$(Q)i=0; while [ $$i -lt 600 ] ; \
do if [ -e $(OUT_DIR)/$(OUT).out ] ; \
}
}
+# Dummy global trigger section to enable triggers
+trigger {
+}
+
policy {
linelogprep {
&request.Tmp-String-8 := &LDAP-Sync.DN
&Proto.radius.User-Name = 'uid'
&Password.With-Header = 'userPassword'
}
+
+ trigger {
+ start = "/usr/bin/touch ${run_dir}/sync_started"
+ }
}
sync {