command: unit tests pass

This commit is contained in:
Mitchell Hashimoto 2015-03-29 16:20:34 -07:00
parent e9a3a34c27
commit db65fd7b95
4 changed files with 12 additions and 4 deletions

View File

@ -32,6 +32,10 @@ func TestBackend_basic(t *testing.T) {
}
func testStartConsulServer(t *testing.T) (map[string]interface{}, *os.Process) {
if _, err := exec.LookPath("consul"); err != nil {
t.Skipf("consul not found: %s", err)
}
td, err := ioutil.TempDir("", "vault")
if err != nil {
t.Fatalf("err: %s", err)

View File

@ -9,9 +9,10 @@ import (
)
func TestMounts(t *testing.T) {
core, _ := vault.TestCoreUnsealed(t)
core, _, token := vault.TestCoreUnsealed(t)
ln, addr := http.TestServer(t, core)
defer ln.Close()
http.TestServerAuth(t, addr, token)
ui := new(cli.MockUi)
c := &MountsCommand{

View File

@ -9,9 +9,10 @@ import (
)
func TestRead(t *testing.T) {
core, _ := vault.TestCoreUnsealed(t)
core, _, token := vault.TestCoreUnsealed(t)
ln, addr := http.TestServer(t, core)
defer ln.Close()
http.TestServerAuth(t, addr, token)
ui := new(cli.MockUi)
c := &ReadCommand{

View File

@ -10,9 +10,10 @@ import (
)
func TestWrite(t *testing.T) {
core, _ := vault.TestCoreUnsealed(t)
core, _, token := vault.TestCoreUnsealed(t)
ln, addr := http.TestServer(t, core)
defer ln.Close()
http.TestServerAuth(t, addr, token)
ui := new(cli.MockUi)
c := &WriteCommand{
@ -46,9 +47,10 @@ func TestWrite(t *testing.T) {
}
func TestWrite_arbitrary(t *testing.T) {
core, _ := vault.TestCoreUnsealed(t)
core, _, token := vault.TestCoreUnsealed(t)
ln, addr := http.TestServer(t, core)
defer ln.Close()
http.TestServerAuth(t, addr, token)
stdinR, stdinW := io.Pipe()
ui := new(cli.MockUi)