From 70b6ab3a9ff4b6e2c91811bbd5fe6e8c78471ea3 Mon Sep 17 00:00:00 2001 From: mlan Date: Mon, 18 Jan 2021 23:03:06 +0100 Subject: [PATCH] - [test](test) Export TST_REPO and TST_VER. --- Makefile | 12 ++++++++++-- demo/.env | 2 +- demo/Makefile | 11 ++--------- demo/docker-compose.yml | 1 + src/acme/entry.d/50-acme-monitor-tlscert | 2 +- test/Makefile | 23 ++++++++++++++--------- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index c66b4a7..d5810a8 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +# Makefile +# +# build +# + -include *.mk #BLD_ARG ?= --build-arg DIST=ubuntu --build-arg REL=18.04 --build-arg ARCH=i386 @@ -5,13 +10,16 @@ BLD_ARG ?= BLD_REPO ?= mlan/kopano BLD_VER ?= latest BLD_TGT ?= full + SRC_CMD ?= src/kopano/bin/kopano-webaddr.sh -VV SRC_VER ?= $(shell $(SRC_CMD)) -IMG_REPO ?= $(BLD_REPO) -IMG_VER ?= $(BLD_VER) + +TST_REPO ?= $(BLD_REPO) +TST_VER ?= $(BLD_VER) TST_ENV ?= -C test TST_TGTE ?= $(addprefix test-,all diff down env htop imap lmtp logs mail pop3 pull sh sv up) TST_TGTI ?= test_% test-up_% +export TST_REPO TST_VER _version = $(if $(findstring $(BLD_TGT),$(1)),\ $(if $(findstring latest,$(2)),latest $(1) $(SRC_VER) $(1)-$(SRC_VER),$(2) $(1)-$(2)),\ $(if $(findstring latest,$(2)),$(1) $(1)-$(SRC_VER),$(1)-$(2))) diff --git a/demo/.env b/demo/.env index da46563..ee1d84a 100644 --- a/demo/.env +++ b/demo/.env @@ -1,5 +1,5 @@ COMPOSE_PROJECT_NAME=demo -SYSLOG_LEVEL=6 +SYSLOG_LEVEL=7 LOG_LEVEL=6 AD_DEBUG=stats AD_ADM_CN=admin diff --git a/demo/Makefile b/demo/Makefile index 5379332..4b876c8 100644 --- a/demo/Makefile +++ b/demo/Makefile @@ -287,15 +287,8 @@ mta-test_auth: docker-compose exec mta doveadm auth test $(AD_USR_CN) $(AD_USR_PW) mta-test_imap: mta-hostaddr - curl imap://$(myhost) -X CAPABILITY $(CURL_DBG) - curl imap://$(myhost) -u $(AD_USR_CN):$(AD_USR_PW) $(CURL_DBG) - -mta-test_rimap: - docker-compose exec mta curl imap://app -X CAPABILITY - docker-compose exec mta curl imap://app -u $(AD_USR_CN):$(AD_USR_PW) - -mta-test_ldap: mta-debugtools - docker-compose exec mta ldapsearch -H ldap://auth:389 -xLLL -s base namingContexts + curl imaps://$(myhost)/inbox -s --ssl --anyauth -k -X "fetch 1 all" \ + -u $(AD_USR_CN):$(AD_USR_PW) db-init: diff --git a/demo/docker-compose.yml b/demo/docker-compose.yml index 3cc8ac9..84c9069 100644 --- a/demo/docker-compose.yml +++ b/demo/docker-compose.yml @@ -63,6 +63,7 @@ services: - MESSAGE_SIZE_LIMIT=${MESSAGE_SIZE_LIMIT-25600000} - LDAP_HOST=auth - VIRTUAL_TRANSPORT=lmtp:app:2003 +# - VIRTUAL_TRANSPORT=lmtp:unix:private/transport - SMTP_RELAY_HOSTAUTH=${SMTP_RELAY_HOSTAUTH-} - SMTP_TLS_SECURITY_LEVEL=${SMTP_TLS_SECURITY_LEVEL-} - SMTP_TLS_WRAPPERMODE=${SMTP_TLS_WRAPPERMODE-no} diff --git a/src/acme/entry.d/50-acme-monitor-tlscert b/src/acme/entry.d/50-acme-monitor-tlscert index c2c74c2..051a583 100755 --- a/src/acme/entry.d/50-acme-monitor-tlscert +++ b/src/acme/entry.d/50-acme-monitor-tlscert @@ -7,7 +7,7 @@ # # -# Setup ACME monitor and arrange certificate sym-links +# Setup ACME monitor and arrange certificate symbolic links # acme_monitor_tls_cert acme_symlink_tls_cert diff --git a/test/Makefile b/test/Makefile index e44eaf6..9eec063 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,8 +1,13 @@ +# Makefile +# +# test +# + -include *.mk -IMG_REPO ?= mlan/kopano -IMG_VER ?= latest -_ver = $(if $(findstring latest,$(1)),$(2),$(1)-$(2)) +TST_REPO ?= mlan/kopano +TST_VER ?= latest +_ver = $(if $(findstring latest,$(1)),$(2),$(2)-$(1)) NET_NAME ?= test-net NET_ENV ?= --network $(NET_NAME) @@ -146,12 +151,12 @@ test-up_0: test-up-net # run containers see if there are logs and stop. # # - docker run -d --name $(APP_NAME) $(IMG_REPO):$(call _ver,$(IMG_VER),core) + docker run -d --name $(APP_NAME) $(TST_REPO):$(call _ver,$(TST_VER),core) sleep $(TST_W8L1) docker container logs $(APP_NAME) | grep 'docker-entrypoint.sh' docker rm -fv $(APP_NAME) sleep $(TST_W8S1) - docker run -d --name $(APP_NAME) $(IMG_REPO):$(call _ver,$(IMG_VER),full) + docker run -d --name $(APP_NAME) $(TST_REPO):$(call _ver,$(TST_VER),full) sleep $(TST_W8L1) docker container logs $(APP_NAME) | grep 'docker-entrypoint.sh' docker rm -fv $(APP_NAME) @@ -174,7 +179,7 @@ test-up_1: test-up-net test-up-deps_1 test-up-auth_1 # recv: curl imap://app # # - docker run -d $(APP_ENV) $(APP_VOL) $(IMG_REPO):$(call _ver,$(IMG_VER),core) + docker run -d $(APP_ENV) $(APP_VOL) $(TST_REPO):$(call _ver,$(TST_VER),core) test-up_2: test-up-net test-up-deps_2 test-up-auth_2 # @@ -187,7 +192,7 @@ test-up_2: test-up-net test-up-deps_2 test-up-auth_2 # recv: curl imaps://app # # - docker run -d $(APPS_ENV) $(APP_VOL) $(IMG_REPO):$(call _ver,$(IMG_VER),core) + docker run -d $(APPS_ENV) $(APP_VOL) $(TST_REPO):$(call _ver,$(TST_VER),core) test-up_3: test-up-net test-up-deps_3 test-up-auth_3 acme/acme.json # @@ -201,7 +206,7 @@ test-up_3: test-up-net test-up-deps_3 test-up-auth_3 acme/acme.json # web: curl http://app # # - docker run -d $(APPA_ENV) $(APP_VOL) $(IMG_REPO):$(call _ver,$(IMG_VER),full) + docker run -d $(APPA_ENV) $(APP_VOL) $(TST_REPO):$(call _ver,$(TST_VER),full) test-up: test-up_1 @@ -246,7 +251,7 @@ test-up-deps_%: test-up-auth_%: sleep $(TST_W8L1) - docker run $(TAW_ENV) $(IMG_REPO):$(call _ver,$(IMG_VER),core) \ + docker run $(TAW_ENV) $(TST_REPO):$(call _ver,$(TST_VER),core) \ zcat /usr/share/doc/kopano/kopano.ldif.gz \ | docker exec -i $(AUT_NAME) ldapadd -Q echo "$$LDIF_ADD_DATA" | docker exec -i $(AUT_NAME) ldapadd -Q