Skip to content

Commit b9ce925

Browse files
committed
update testing to consul-1.6.0 settings
1 parent fabc61c commit b9ce925

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%YAML 1.2
22
---
33
consul:
4-
image: consul:1.0.6
4+
image: consul:1.6.0
55
ports:
66
- 8500
77
volumes:

testing/consul.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
{
2-
"acl_datacenter": "test",
3-
"acl_master_token": "9ae5fe1a-6b38-47e5-a0e7-f06b8b2fa645",
4-
"bootstrap": true,
2+
"acl": {
3+
"enabled": true,
4+
"enable_key_list_policy": true,
5+
"tokens": {
6+
"master": "9ae5fe1a-6b38-47e5-a0e7-f06b8b2fa645"
7+
}
8+
},
9+
"bootstrap_expect": 1,
510
"data_dir": "/tmp/consul",
611
"datacenter": "test",
712
"server": true,
13+
"bind_addr": "{{ GetPrivateIP }}",
14+
"client_addr": "0.0.0.0",
815
"enable_script_checks": true
916
}

tests/api_tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setUp(self, status, session, event, acl, health, coordinate, kv, catalog, ag
3535
self.host = '127.0.0.1'
3636
self.port = 8500
3737
self.dc = CONSUL_CONFIG['datacenter']
38-
self.token = CONSUL_CONFIG['acl_master_token']
38+
self.token = CONSUL_CONFIG['acl']['tokens']['master']
3939

4040
self.acl = acl
4141
self.adapter = adapter
@@ -98,7 +98,7 @@ def test_health_initialization(self):
9898
def test_coordinate_initialization(self):
9999
self.assertTrue(
100100
self.coordinate.called_once_with(self.base_uri, self.adapter, self.dc,
101-
self.token))
101+
self.token))
102102

103103
def test_session_initialization(self):
104104
self.assertTrue(

tests/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def setUp(self):
3333
self.consul = consulate.Consul(
3434
host=os.environ['CONSUL_HOST'],
3535
port=os.environ['CONSUL_PORT'],
36-
token=CONSUL_CONFIG['acl_master_token'])
36+
token=CONSUL_CONFIG['acl']['tokens']['master'])
3737
self.forbidden_consul = consulate.Consul(
3838
host=os.environ['CONSUL_HOST'],
3939
port=os.environ['CONSUL_PORT'],
@@ -53,7 +53,7 @@ def tearDown(self):
5353
self.consul.agent.service.deregister(services[name]['ID'])
5454

5555
for acl in self.consul.acl.list():
56-
if acl['ID'] == CONSUL_CONFIG['acl_master_token']:
56+
if acl['ID'] == CONSUL_CONFIG['acl']['tokens']['master']:
5757
continue
5858
try:
5959
uuid.UUID(acl['ID'])

0 commit comments

Comments
 (0)