aboutsummaryrefslogtreecommitdiff
path: root/test_automatic
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 /test_automatic
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
Diffstat (limited to 'test_automatic')
-rw-r--r--test_automatic/config.json.test13
-rw-r--r--test_automatic/integration.go1
-rwxr-xr-xtest_automatic/start_test.sh9
3 files changed, 19 insertions, 4 deletions
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