aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMrArmonius <mrarmonius@gmail.com>2021-07-09 15:47:54 +0200
committerMrArmonius <mrarmonius@gmail.com>2021-07-19 18:57:40 +0200
commitda627ac39ad437bfb6be7e5f343933a0ca4e5073 (patch)
treeee2a5e87a9c872e668deaf5dea056552e177442f
parenta98556d5c1241f9150202d72ea096a775d97a582 (diff)
downloadbottin-da627ac39ad437bfb6be7e5f343933a0ca4e5073.tar.gz
bottin-da627ac39ad437bfb6be7e5f343933a0ca4e5073.zip
Script in ash to launch our test V1.0 (end-to-end) in a Consul's
container
-rw-r--r--.drone.yml6
-rw-r--r--test_automatic/config.json.test13
-rw-r--r--test_automatic/integration.go1
-rwxr-xr-xtest_automatic/start_test.sh9
4 files changed, 23 insertions, 6 deletions
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