Skip to content

Commit

Permalink
update testing to consul-1.6.0 settings
Browse files Browse the repository at this point in the history
  • Loading branch information
abaez committed Sep 16, 2019
1 parent fabc61c commit b9ce925
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.2
---
consul:
image: consul:1.0.6
image: consul:1.6.0
ports:
- 8500
volumes:
Expand Down
13 changes: 10 additions & 3 deletions testing/consul.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"acl_datacenter": "test",
"acl_master_token": "9ae5fe1a-6b38-47e5-a0e7-f06b8b2fa645",
"bootstrap": true,
"acl": {
"enabled": true,
"enable_key_list_policy": true,
"tokens": {
"master": "9ae5fe1a-6b38-47e5-a0e7-f06b8b2fa645"
}
},
"bootstrap_expect": 1,
"data_dir": "/tmp/consul",
"datacenter": "test",
"server": true,
"bind_addr": "{{ GetPrivateIP }}",
"client_addr": "0.0.0.0",
"enable_script_checks": true
}
4 changes: 2 additions & 2 deletions tests/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setUp(self, status, session, event, acl, health, coordinate, kv, catalog, ag
self.host = '127.0.0.1'
self.port = 8500
self.dc = CONSUL_CONFIG['datacenter']
self.token = CONSUL_CONFIG['acl_master_token']
self.token = CONSUL_CONFIG['acl']['tokens']['master']

self.acl = acl
self.adapter = adapter
Expand Down Expand Up @@ -98,7 +98,7 @@ def test_health_initialization(self):
def test_coordinate_initialization(self):
self.assertTrue(
self.coordinate.called_once_with(self.base_uri, self.adapter, self.dc,
self.token))
self.token))

def test_session_initialization(self):
self.assertTrue(
Expand Down
4 changes: 2 additions & 2 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setUp(self):
self.consul = consulate.Consul(
host=os.environ['CONSUL_HOST'],
port=os.environ['CONSUL_PORT'],
token=CONSUL_CONFIG['acl_master_token'])
token=CONSUL_CONFIG['acl']['tokens']['master'])
self.forbidden_consul = consulate.Consul(
host=os.environ['CONSUL_HOST'],
port=os.environ['CONSUL_PORT'],
Expand All @@ -53,7 +53,7 @@ def tearDown(self):
self.consul.agent.service.deregister(services[name]['ID'])

for acl in self.consul.acl.list():
if acl['ID'] == CONSUL_CONFIG['acl_master_token']:
if acl['ID'] == CONSUL_CONFIG['acl']['tokens']['master']:
continue
try:
uuid.UUID(acl['ID'])
Expand Down

0 comments on commit b9ce925

Please sign in to comment.