mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
command/seal: test should use the token
This commit is contained in:
@@ -16,7 +16,9 @@ func (c *Sys) SealStatus() (*SealStatusResponse, error) {
|
||||
func (c *Sys) Seal() error {
|
||||
r := c.c.NewRequest("PUT", "/v1/sys/seal")
|
||||
resp, err := c.c.RawRequest(r)
|
||||
defer resp.Body.Close()
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,15 @@ import (
|
||||
)
|
||||
|
||||
func TestSeal(t *testing.T) {
|
||||
core, _, _ := vault.TestCoreUnsealed(t)
|
||||
core, _, token := vault.TestCoreUnsealed(t)
|
||||
ln, addr := http.TestServer(t, core)
|
||||
defer ln.Close()
|
||||
|
||||
ui := new(cli.MockUi)
|
||||
c := &SealCommand{
|
||||
Meta: Meta{
|
||||
Ui: ui,
|
||||
ClientToken: token,
|
||||
Ui: ui,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user