From: Nick Porter Date: Mon, 24 Oct 2022 08:58:56 +0000 (+0100) Subject: Amend Active Directory persistent search tests for parallel runs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5e818b0c212200dbcb9c6236da39df86bd51578;p=thirdparty%2Ffreeradius-server.git Amend Active Directory persistent search tests for parallel runs --- diff --git a/src/tests/ldap_sync/active_directory/01_add.sh b/src/tests/ldap_sync/active_directory/01_add.sh index f154a407a6c..572fe7fa775 100755 --- a/src/tests/ldap_sync/active_directory/01_add.sh +++ b/src/tests/ldap_sync/active_directory/01_add.sh @@ -1,4 +1,5 @@ #!/bin/sh +# OUT:Modifyfred if [ -z $ACTIVE_DIRECTORY_TEST_SERVER ]; then echo ACTIVE_DIRECTORY_TEST_SERVER not defined diff --git a/src/tests/ldap_sync/active_directory/02_del.out b/src/tests/ldap_sync/active_directory/02_del.out index a8369d1fc59..0a7923758e0 100644 --- a/src/tests/ldap_sync/active_directory/02_del.out +++ b/src/tests/ldap_sync/active_directory/02_del.out @@ -1 +1 @@ -Delete CN=Deleted Objects,dc=example,dc=com CN=fred\0ADEL:oldid,CN=Deleted Objects,DC=example,DC=com fred 514 TRUE +Delete CN=Deleted Objects,dc=example,dc=com CN=bob\0ADEL:oldid,CN=Deleted Objects,DC=example,DC=com bob 514 TRUE diff --git a/src/tests/ldap_sync/active_directory/02_del.sh b/src/tests/ldap_sync/active_directory/02_del.sh index 90115aad6eb..fd71fea019f 100755 --- a/src/tests/ldap_sync/active_directory/02_del.sh +++ b/src/tests/ldap_sync/active_directory/02_del.sh @@ -1,4 +1,5 @@ #!/bin/sh +# OUT:Deletebob if [ -z $ACTIVE_DIRECTORY_TEST_SERVER ]; then echo ACTIVE_DIRECTORY_TEST_SERVER not defined @@ -13,7 +14,12 @@ if [ "$ACTIVE_DIRECTORY_TEST_SERVER" != "127.0.0.1" ]; then CMDSTART="ssh root@$ACTIVE_DIRECTORY_TEST_SERVER " fi -${CMDSTART}samba-tool group delete dummy > /dev/null -${CMDSTART}samba-tool computer delete test_workstation > /dev/null -${CMDSTART}samba-tool user disable fred > /dev/null -${CMDSTART}samba-tool user delete fred > /dev/null +# Add some entries we can then delete +${CMDSTART}samba-tool group add dummy2 > /dev/null +${CMDSTART}samba-tool computer create test_workstation2 > /dev/null +${CMDSTART}samba-tool user create bob asdf_1234 > /dev/null + +${CMDSTART}samba-tool group delete dummy2 > /dev/null +${CMDSTART}samba-tool computer delete test_workstation2 > /dev/null +${CMDSTART}samba-tool user disable bob > /dev/null +${CMDSTART}samba-tool user delete bob > /dev/null diff --git a/src/tests/ldap_sync/active_directory/all.mk b/src/tests/ldap_sync/active_directory/all.mk index 1d65437d094..34b161b1117 100644 --- a/src/tests/ldap_sync/active_directory/all.mk +++ b/src/tests/ldap_sync/active_directory/all.mk @@ -25,15 +25,16 @@ $(OUTPUT)/%: $(DIR)/% | $(TEST).radiusd_kill $(TEST).radiusd_start $(eval TARGET := $(notdir $<)) $(eval EXPECTED := $(patsubst %.sh,%.out,$<)) $(eval FOUND := $(patsubst %.sh,%.out,$@)) - $(eval ARGV := $(shell grep "#.*ARGV:" $< | cut -f2)) + $(eval OUT := $(shell grep "#.*OUT:" $< | cut -f2 -d ':')) $(eval OUT_DIR := $(BUILD_DIR)/tests/ldap_sync/active_directory) $(Q)echo "LDAPSYNC-TEST active_directory $(TARGET)" $(Q)[ -f $(dir $@)/radiusd.pid ] || exit 1 - $(Q)rm -f $(OUT_DIR)/linelog.out + $(Q)rm -f $(OUT_DIR)/$(OUT).out + $(Q)sleep 1 $(Q)$< - $(Q)i=0; while [ $$i -lt 300 ] ; \ - do if [ -e $(OUT_DIR)/linelog.out ] ; \ + $(Q)i=0; while [ $$i -lt 600 ] ; \ + do if [ -e $(OUT_DIR)/$(OUT).out ] ; \ then \ break; \ fi; \ @@ -41,7 +42,7 @@ $(OUTPUT)/%: $(DIR)/% | $(TEST).radiusd_kill $(TEST).radiusd_start i=$$((i+1)); \ done ; $(Q)sleep .5 - $(Q)mv $(OUT_DIR)/linelog.out $(FOUND) + $(Q)mv $(OUT_DIR)/$(OUT).out $(FOUND) $(Q)if [ -e "$(EXPECTED)" ] && ! cmp -s $(FOUND) $(EXPECTED); then \ echo "LDAP_SYNC FAILED $@"; \ diff --git a/src/tests/ldap_sync/active_directory/config/radiusd.conf b/src/tests/ldap_sync/active_directory/config/radiusd.conf index 9d58a96b436..0135f6e9823 100644 --- a/src/tests/ldap_sync/active_directory/config/radiusd.conf +++ b/src/tests/ldap_sync/active_directory/config/radiusd.conf @@ -60,7 +60,7 @@ modules { destination = file file { - filename = "${run_dir}/linelog.out" + filename = "${run_dir}/%{Packet-Type}%{Proto.radius.User-Name}.out" } }