diff --git a/vault/logical_system_test.go b/vault/logical_system_test.go index f92e8bd24..e9cabdb4f 100644 --- a/vault/logical_system_test.go +++ b/vault/logical_system_test.go @@ -2066,7 +2066,7 @@ func TestSystemBackend_rotateConfig(t *testing.T) { } req2 := logical.TestRequest(t, logical.UpdateOperation, "rotate/config") - req2.Data["max_operations"] = int64(2345678910) + req2.Data["max_operations"] = 123456789 req2.Data["interval"] = "5432h0m0s" req2.Data["enabled"] = false @@ -2081,11 +2081,20 @@ func TestSystemBackend_rotateConfig(t *testing.T) { } exp = map[string]interface{}{ - "max_operations": int64(2345678910), + "max_operations": 123456789, "interval": "5432h0m0s", "enabled": false, } + // Not pretty, but on a 64-bit machine, the response value is 64-bit, while on a 32 bit machine it'll be an int + // DeepEqual rejects it due to the type difference + if d, ok := resp.Data["max_operations"]; ok { + v, ok := d.(int64) + if ok { + resp.Data["max_operations"] = int(v) + } + } + if !reflect.DeepEqual(resp.Data, exp) { t.Fatalf("got: %#v expect: %#v", resp.Data, exp) }