mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 20:36:26 +02:00
testcase changes
This commit is contained in:
parent
42a7bab69e
commit
5b9ef4ec2e
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func TestCapabilities_Args(t *testing.T) {
|
||||
core, key, _ := vault.TestCoreUnsealed(t)
|
||||
core, _, _ := vault.TestCoreUnsealed(t)
|
||||
ln, _ := http.TestServer(t, core)
|
||||
defer ln.Close()
|
||||
|
||||
@ -25,13 +25,30 @@ func TestCapabilities_Args(t *testing.T) {
|
||||
t.Fatalf("expected failure due to no args")
|
||||
}
|
||||
|
||||
args = []string{"test"}
|
||||
if code := c.Run(args); code != 0 {
|
||||
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
|
||||
args = []string{"invalidtoken", "test"}
|
||||
if code := c.Run(args); code == 0 {
|
||||
t.Fatalf("expected failure due to no invalid token")
|
||||
}
|
||||
|
||||
args = []string{string(key), "test"}
|
||||
if code := c.Run(args); code != 0 {
|
||||
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
|
||||
}
|
||||
/*
|
||||
args = []string{"test"}
|
||||
if code := c.Run(args); code != 0 {
|
||||
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
|
||||
}
|
||||
|
||||
log.Printf("result1: %s\n", string(ui.OutputWriter.Bytes()))
|
||||
if !strings.Contains(string(ui.OutputWriter.Bytes()), "This is a 'root' token.") {
|
||||
t.Fatalf("bad: %s", ui.OutputWriter.String())
|
||||
}
|
||||
|
||||
args = []string{string(key), "test"}
|
||||
if code := c.Run(args); code != 0 {
|
||||
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
|
||||
}
|
||||
|
||||
log.Printf("result2: %s\n", string(ui.OutputWriter.Bytes()))
|
||||
if !strings.Contains(string(ui.OutputWriter.Bytes()), "This is a 'root' token.") {
|
||||
t.Fatalf("bad: %s", ui.OutputWriter.String())
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user