traefik-certs-dumper/tests/README.md
2019-04-20 10:02:37 +02:00

1.5 KiB

Integration testing

Preperation

  1. Create valid ACME file /tmp/acme.json
  2. Start backends using docker
    docker run -d -p 8500:8500 --name consul consul
    docker run -d -p 2181:2181 --name zookeeper zookeeper
    docker run -d -p 2379:2379 --name etcd quay.io/coreos/etcd:v3.3.12 etcd --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2380
    
  3. Build tests
    export GO111MODULE=on
    go build
    
  4. Initialize backends
    ./tests
    
  5. Run certs dumper without watching
    ../traefik-certs-dumper dump --source.file=/tmp/acme.json
    ../traefik-certs-dumper dump --source consul --source.kv.endpoints=localhost:8500
    ../traefik-certs-dumper dump --source etcd --source.kv.endpoints=localhost:2379
    ../traefik-certs-dumper dump --source boltdb --source.kv.endpoints=/tmp/my.db
    ../traefik-certs-dumper dump --source zookeeper --source.kv.endpoints=localhost:2181
    
  6. Run certs dumper with watching
    ../traefik-certs-dumper dump --watch --source.file=/tmp/acme.json
    ../traefik-certs-dumper dump --watch --source consul --source.kv.endpoints=localhost:8500
    ../traefik-certs-dumper dump --watch --source etcd --source.kv.endpoints=localhost:2379
    ../traefik-certs-dumper dump --watch --source zookeeper --source.kv.endpoints=localhost:2181
    
    While watching is enabled, run ./tests again for KV backends or manipulate /tmp/acme.json for file backend that change events are triggered.