From da627ac39ad437bfb6be7e5f343933a0ca4e5073 Mon Sep 17 00:00:00 2001 From: MrArmonius Date: Fri, 9 Jul 2021 15:47:54 +0200 Subject: Script in ash to launch our test V1.0 (end-to-end) in a Consul's container --- .drone.yml | 6 ++++-- test_automatic/config.json.test | 13 +++++++++++++ test_automatic/integration.go | 1 + test_automatic/start_test.sh | 9 +++++---- 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 test_automatic/config.json.test diff --git a/.drone.yml b/.drone.yml index b83a87d..8a79d64 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,11 +14,13 @@ steps: - name: test_bottin image: consul:latest + environment: + BOTTIN_DEFAULT_ADMIN_PW: priZ4Cg0x5NkSyiIN/MpvWw4ZEy8f8s1 commands: - - ./test_automatic/start_test.sh + - ash test_automatic/start_test.sh --- kind: signature -hmac: 939fca00ff84d40e9364cd936c18c40c5becafa05e0f887bc04cf6336a4913a2 +hmac: a4455c124ee87ca8b0ef1779560703573f3a3f24d406e4cb281b9e0dab4ceeda ... diff --git a/test_automatic/config.json.test b/test_automatic/config.json.test new file mode 100644 index 0000000..bc1eeec --- /dev/null +++ b/test_automatic/config.json.test @@ -0,0 +1,13 @@ +{ + "suffix": "dc=deuxfleurs,dc=fr", + "bind": "127.0.0.1:1389", + "acl": [ + "ANONYMOUS::bind:*,ou=users,dc=deuxfleurs,dc=fr:", + "ANONYMOUS::bind:cn=admin,dc=deuxfleurs,dc=fr:", + "*,dc=deuxfleurs,dc=fr::read:*:* !userpassword", + "*::read modify:SELF:*", + "cn=admin,dc=deuxfleurs,dc=fr::read add modify delete:*:*", + "*:cn=admin,ou=groups,dc=deuxfleurs,dc=fr:read add modify delete:*:*" + ] +} + diff --git a/test_automatic/integration.go b/test_automatic/integration.go index e5a4737..d55d280 100644 --- a/test_automatic/integration.go +++ b/test_automatic/integration.go @@ -425,6 +425,7 @@ func main() { printError(err) log.Info("Clean succes") + defer os.Exit(0) return } diff --git a/test_automatic/start_test.sh b/test_automatic/start_test.sh index 38fe706..e7a1712 100755 --- a/test_automatic/start_test.sh +++ b/test_automatic/start_test.sh @@ -1,11 +1,12 @@ -#!/bin/bash +#!/bin/sh -trap "kill 0" EXIT - -export BOTTIN_DEFAULT_ADMIN_PW=$(openssl rand -base64 24) +#export BOTTIN_DEFAULT_ADMIN_PW=$(openssl rand -base64 24) echo $BOTTIN_DEFAULT_ADMIN_PW consul agent -dev > /dev/null 2>&1 & sleep 2 +cp test_automatic/config.json.test config.json ./bottin > /dev/null 2>&1 & sleep 1 ./test_automatic/integration +rm config.json +exit 0 -- cgit v1.2.3