command/seal: test should use the token

This commit is contained in:
Mitchell Hashimoto
2015-03-31 11:46:55 -07:00
parent d666e79a3a
commit edde6ed160
2 changed files with 6 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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,
},
}