mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Add entity information request to system view (#4681)
* Add entity information request to system view * fixing a few comments * sharing types between plugin and logical * sharing types between plugin and logical * fixing output directory for proto * removing extra replacement * adding mount type lookup * empty entities return nil instead of error * adding some comments
This commit is contained in:
@@ -174,3 +174,28 @@ func TestSystem_mlockEnabled(t *testing.T) {
|
||||
t.Fatalf("expected: %v, got: %v", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystem_entityInfo(t *testing.T) {
|
||||
client, server := plugin.TestRPCConn(t)
|
||||
defer client.Close()
|
||||
|
||||
sys := logical.TestSystemView()
|
||||
sys.EntityVal = &logical.Entity{
|
||||
ID: "test",
|
||||
Name: "name",
|
||||
}
|
||||
|
||||
server.RegisterName("Plugin", &SystemViewServer{
|
||||
impl: sys,
|
||||
})
|
||||
|
||||
testSystemView := &SystemViewClient{client: client}
|
||||
|
||||
actual, err := testSystemView.EntityInfo("")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(sys.EntityVal, actual) {
|
||||
t.Fatalf("expected: %v, got: %v", sys.EntityVal, actual)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user