Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abtreece committed Sep 23, 2024
1 parent 644be7c commit db61f80
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/confd/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

const Version = "0.21.0-dev"
const Version = "0.30.0"

// We want to replace this variable at build time with "-ldflags -X main.GitSHA=xxx", where const is not supported.
var GitSHA = ""
6 changes: 4 additions & 2 deletions test/integration/consul/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/database/port -d '3306'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/database/username -d 'confd'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/upstream/app1 -d '10.0.1.10:8080'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/upstream/app2 -d '10.0.1.11:8080'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/nested/east/app1 -d '10.0.1.10:8080'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/nested/west/app2 -d '10.0.1.11:8080'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/nested/production/app1 -d '10.0.1.10:8080'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/nested/production/app2 -d '10.0.1.11:8080'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/nested/staging/app1 -d '172.16.1.10:8080'
curl -sX PUT http://$CONSUL_HOST:8500/v1/kv/prefix/nested/staging/app2 -d '172.16.1.11:8080'

# Run confd
confd --onetime --log-level debug --confdir ./test/integration/confdir --backend consul --node $CONSUL_HOST:8500
2 changes: 1 addition & 1 deletion test/integration/expect/check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -x
set -ex

diff /tmp/confd-basic-test.conf test/integration/expect/basic.conf
diff /tmp/confd-exists-test.conf test/integration/expect/exists-test.conf
Expand Down
9 changes: 5 additions & 4 deletions test/integration/vault-approle/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export HOSTNAME="localhost"

vault secrets enable -version 1 -path kv-v1 kv

vault write kv-v1/exists key=foobar
#vault write kv-v1/key key=foobar
vault write kv-v1/database host=127.0.0.1 port=3306 username=confd password=p@sSw0rd
vault write kv-v1/upstream app1=10.0.1.10:8080 app2=10.0.1.11:8080
vault write kv-v1/nested/east app1=10.0.1.10:8080
vault write kv-v1/nested/west app2=10.0.1.11:8080
vault write kv-v1/nested/production app1=10.0.1.10:8080 app2=10.0.1.11:8080
vault write kv-v1/nested/staging app1=172.16.1.10:8080 app2=172.16.1.11:8080

vault auth enable -path=test approle

Expand All @@ -25,10 +25,11 @@ export SECRET_ID=$(vault write -f -field=secret_id auth/test/role/my-role/secret

# Run confd
confd --onetime --log-level debug \
--confdir ./test/integration/vault-approle/confdir \
--confdir ./test/integration/confdir \
--backend vault \
--auth-type app-role \
--role-id $ROLE_ID \
--secret-id $SECRET_ID \
--path=test \
--prefix "kv-v1" \
--node $VAULT_ADDR

0 comments on commit db61f80

Please sign in to comment.