Adding a shiro.ini configuration in order to test bad password using compose setup.
This commit is contained in:
parent
67b37d5a42
commit
fdd94e9bea
3 changed files with 35 additions and 2 deletions
5
.aurora-config/security.ini
Normal file
5
.aurora-config/security.ini
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[users]
|
||||||
|
aurora = secret, admin
|
||||||
|
|
||||||
|
[roles]
|
||||||
|
admin = *
|
|
@ -65,6 +65,12 @@ services:
|
||||||
CLUSTER_NAME: test-cluster
|
CLUSTER_NAME: test-cluster
|
||||||
ZK_ENDPOINTS: "192.168.33.2:2181"
|
ZK_ENDPOINTS: "192.168.33.2:2181"
|
||||||
MESOS_MASTER: "zk://192.168.33.2:2181/mesos"
|
MESOS_MASTER: "zk://192.168.33.2:2181/mesos"
|
||||||
|
EXTRA_SCHEDULER_ARGS: >
|
||||||
|
-http_authentication_mechanism=BASIC
|
||||||
|
-shiro_realm_modules=INI_AUTHNZ
|
||||||
|
-shiro_ini_path=/etc/aurora/security.ini
|
||||||
|
volumes:
|
||||||
|
- ./.aurora-config:/etc/aurora
|
||||||
networks:
|
networks:
|
||||||
aurora_cluster:
|
aurora_cluster:
|
||||||
ipv4_address: 192.168.33.7
|
ipv4_address: 192.168.33.7
|
||||||
|
|
|
@ -85,6 +85,29 @@ func TestNonExistentEndpoint(t *testing.T) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBadCredentials(t *testing.T) {
|
||||||
|
r, err := realis.NewClient(realis.SchedulerUrl("http://192.168.33.7:8081"),
|
||||||
|
realis.BasicAuth("incorrect", "password"))
|
||||||
|
defer r.Close()
|
||||||
|
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
job := realis.NewJob().
|
||||||
|
Environment("prod").
|
||||||
|
Role("vagrant").
|
||||||
|
Name("create_thermos_job_test").
|
||||||
|
ExecutorName(aurora.AURORA_EXECUTOR_NAME).
|
||||||
|
ExecutorData(string(thermosPayload)).
|
||||||
|
CPU(.5).
|
||||||
|
RAM(64).
|
||||||
|
Disk(100).
|
||||||
|
IsService(true).
|
||||||
|
InstanceCount(2).
|
||||||
|
AddPorts(1)
|
||||||
|
|
||||||
|
assert.Error(t, r.CreateJob(job))
|
||||||
|
}
|
||||||
|
|
||||||
func TestThriftBinary(t *testing.T) {
|
func TestThriftBinary(t *testing.T) {
|
||||||
r, err := realis.NewClient(realis.SchedulerUrl("http://192.168.33.7:8081"),
|
r, err := realis.NewClient(realis.SchedulerUrl("http://192.168.33.7:8081"),
|
||||||
realis.BasicAuth("aurora", "secret"),
|
realis.BasicAuth("aurora", "secret"),
|
||||||
|
@ -92,6 +115,7 @@ func TestThriftBinary(t *testing.T) {
|
||||||
realis.ThriftBinary())
|
realis.ThriftBinary())
|
||||||
|
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
defer r.Close()
|
||||||
|
|
||||||
role := "all"
|
role := "all"
|
||||||
taskQ := &aurora.TaskQuery{
|
taskQ := &aurora.TaskQuery{
|
||||||
|
@ -103,8 +127,6 @@ func TestThriftBinary(t *testing.T) {
|
||||||
|
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
r.Close()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestThriftJSON(t *testing.T) {
|
func TestThriftJSON(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue