Merge pull request #139 from bpgray/fix-config-tests
* fix-config-tests: add anonymous acl with kv store and discovery permissions
This commit is contained in:
@@ -16,7 +16,7 @@ install:
|
||||
script:
|
||||
- ./src/test/bash/travis_run_consul.sh
|
||||
- '[ "${TRAVIS_PULL_REQUEST}" != "false" ] || ./mvnw --settings .settings.xml deploy -nsu -Dmaven.test.redirectTestOutputToFile=true'
|
||||
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] || ./mvnw --settings .settings.xml install -nsu -Dmaven.test.redirectTestOutputToFile=true'
|
||||
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] || ./mvnw --settings .settings.xml install -nsu -Dmaven.test.redirectTestOutputToFile=true'
|
||||
env:
|
||||
global:
|
||||
- GIT_NAME="Spencer Gibb"
|
||||
|
||||
30
pom.xml
30
pom.xml
@@ -121,36 +121,6 @@
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/ConsulDiscoveryClientAclTests.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>ci</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/ConsulPropertySourceLocatorTests.java</exclude>
|
||||
<exclude>**/ConsulDiscoveryClientAclTests.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
BASEDIR=`dirname $0`/../../..
|
||||
${BASEDIR}/consul agent -server -bootstrap-expect 1 -advertise 127.0.0.1 -data-dir /tmp/consul -ui-dir ${BASEDIR}/src/test/resources/consul_ui & #-config-dir ${BASEDIR}/src/test/resources/consul_config &
|
||||
${BASEDIR}/consul agent -server -bootstrap-expect 1 -advertise 127.0.0.1 -data-dir /tmp/consul -ui-dir ${BASEDIR}/src/test/resources/consul_ui -config-dir ${BASEDIR}/src/test/resources/consul_config &
|
||||
# wait for consul to elect a leader before sending acl
|
||||
#sleep 5
|
||||
#curl -X PUT -d @`dirname $0`/../../test/resources/consul_acl/consul_discovery_client_acl.json http://localhost:8500/v1/acl/create?token=2ee647bd-bd69-4118-9f34-b9a6e9e60746
|
||||
sleep 5
|
||||
curl -X PUT -d @`dirname $0`/../../test/resources/consul_acl/consul_anonymous_acl.json http://localhost:8500/v1/acl/create?token=2ee647bd-bd69-4118-9f34-b9a6e9e60746
|
||||
curl -X PUT -d @`dirname $0`/../../test/resources/consul_acl/consul_discovery_client_acl.json http://localhost:8500/v1/acl/create?token=2ee647bd-bd69-4118-9f34-b9a6e9e60746
|
||||
|
||||
20
src/test/resources/consul_acl/consul_anonymous_acl.json
Normal file
20
src/test/resources/consul_acl/consul_anonymous_acl.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"ID": "anonymous",
|
||||
"Name": "anonymous",
|
||||
"Type": "client",
|
||||
"Rules": "{
|
||||
\"key\": {
|
||||
\"\": {
|
||||
\"policy\": \"write\"
|
||||
}
|
||||
},
|
||||
\"service\": {
|
||||
\"\": {
|
||||
\"policy\": \"write\"
|
||||
},
|
||||
\"testConsulDiscoveryAcl\": {
|
||||
\"policy\": \"read\"
|
||||
}
|
||||
}
|
||||
}"
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
"datacenter": "local",
|
||||
"acl_datacenter": "local",
|
||||
"acl_master_token": "2ee647bd-bd69-4118-9f34-b9a6e9e60746",
|
||||
"acl_default_policy": "write"
|
||||
"acl_default_policy": "deny"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user