mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Fix mah broken tests
This commit is contained in:
@@ -17,8 +17,8 @@ func TestSysPolicies(t *testing.T) {
|
||||
|
||||
var actual map[string]interface{}
|
||||
expected := map[string]interface{}{
|
||||
"policies": []interface{}{"response-wrapping", "default", "root"},
|
||||
"keys": []interface{}{"response-wrapping", "default", "root"},
|
||||
"policies": []interface{}{"default", "response-wrapping", "root"},
|
||||
"keys": []interface{}{"default", "response-wrapping", "root"},
|
||||
}
|
||||
testResponseStatus(t, resp, 200)
|
||||
testResponseBody(t, resp, &actual)
|
||||
@@ -62,8 +62,8 @@ func TestSysWritePolicy(t *testing.T) {
|
||||
|
||||
var actual map[string]interface{}
|
||||
expected := map[string]interface{}{
|
||||
"policies": []interface{}{"response-wrapping", "default", "foo", "root"},
|
||||
"keys": []interface{}{"response-wrapping", "default", "foo", "root"},
|
||||
"policies": []interface{}{"default", "foo", "response-wrapping", "root"},
|
||||
"keys": []interface{}{"default", "foo", "response-wrapping", "root"},
|
||||
}
|
||||
testResponseStatus(t, resp, 200)
|
||||
testResponseBody(t, resp, &actual)
|
||||
@@ -100,8 +100,8 @@ func TestSysDeletePolicy(t *testing.T) {
|
||||
|
||||
var actual map[string]interface{}
|
||||
expected := map[string]interface{}{
|
||||
"policies": []interface{}{"response-wrapping", "default", "root"},
|
||||
"keys": []interface{}{"response-wrapping", "default", "root"},
|
||||
"policies": []interface{}{"default", "response-wrapping", "root"},
|
||||
"keys": []interface{}{"default", "response-wrapping", "root"},
|
||||
}
|
||||
testResponseStatus(t, resp, 200)
|
||||
testResponseBody(t, resp, &actual)
|
||||
|
||||
@@ -610,8 +610,8 @@ func TestSystemBackend_policyList(t *testing.T) {
|
||||
}
|
||||
|
||||
exp := map[string]interface{}{
|
||||
"keys": []string{"response-wrapping", "default", "root"},
|
||||
"policies": []string{"response-wrapping", "default", "root"},
|
||||
"keys": []string{"default", "response-wrapping", "root"},
|
||||
"policies": []string{"default", "response-wrapping", "root"},
|
||||
}
|
||||
if !reflect.DeepEqual(resp.Data, exp) {
|
||||
t.Fatalf("got: %#v expect: %#v", resp.Data, exp)
|
||||
@@ -663,8 +663,8 @@ func TestSystemBackend_policyCRUD(t *testing.T) {
|
||||
}
|
||||
|
||||
exp = map[string]interface{}{
|
||||
"keys": []string{"response-wrapping", "default", "foo", "root"},
|
||||
"policies": []string{"response-wrapping", "default", "foo", "root"},
|
||||
"keys": []string{"default", "foo", "response-wrapping", "root"},
|
||||
"policies": []string{"default", "foo", "response-wrapping", "root"},
|
||||
}
|
||||
if !reflect.DeepEqual(resp.Data, exp) {
|
||||
t.Fatalf("got: %#v expect: %#v", resp.Data, exp)
|
||||
@@ -698,8 +698,8 @@ func TestSystemBackend_policyCRUD(t *testing.T) {
|
||||
}
|
||||
|
||||
exp = map[string]interface{}{
|
||||
"keys": []string{"response-wrapping", "default", "root"},
|
||||
"policies": []string{"response-wrapping", "default", "root"},
|
||||
"keys": []string{"default", "response-wrapping", "root"},
|
||||
"policies": []string{"default", "response-wrapping", "root"},
|
||||
}
|
||||
if !reflect.DeepEqual(resp.Data, exp) {
|
||||
t.Fatalf("got: %#v expect: %#v", resp.Data, exp)
|
||||
|
||||
@@ -138,7 +138,7 @@ func TestPolicyStore_Predefined(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if len(out) != 2 || out[0] != "response-wrapping" || out[1] != "default" {
|
||||
if len(out) != 2 || out[0] != "default" || out[1] != "response-wrapping" {
|
||||
t.Fatalf("bad: %v", out)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user