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 { func (c *Sys) Seal() error {
r := c.c.NewRequest("PUT", "/v1/sys/seal") r := c.c.NewRequest("PUT", "/v1/sys/seal")
resp, err := c.c.RawRequest(r) resp, err := c.c.RawRequest(r)
if err == nil {
defer resp.Body.Close() defer resp.Body.Close()
}
return err return err
} }

View File

@@ -9,13 +9,14 @@ import (
) )
func TestSeal(t *testing.T) { func TestSeal(t *testing.T) {
core, _, _ := vault.TestCoreUnsealed(t) core, _, token := vault.TestCoreUnsealed(t)
ln, addr := http.TestServer(t, core) ln, addr := http.TestServer(t, core)
defer ln.Close() defer ln.Close()
ui := new(cli.MockUi) ui := new(cli.MockUi)
c := &SealCommand{ c := &SealCommand{
Meta: Meta{ Meta: Meta{
ClientToken: token,
Ui: ui, Ui: ui,
}, },
} }