Commit 03040d2164
Verified · cmc
Layout: unified · split
internal/control/keyexpiry_test.go +6
| @@ -47,6 +47,12 @@ func TestKeysAddTTLAndList(t *testing.T) { | ||
| 47 | 47 | if _, _, code := run(authorizedKey(t, "x"), "keys", "add", "--ttl", "soon"); code != protocol.ExitUsage { |
| 48 | 48 | t.Fatalf("bad ttl: exit %d", code) |
| 49 | 49 | } |
| 50 | if _, _, code := run(authorizedKey(t, "x"), "keys", "add", "--ttl", "0h"); code != protocol.ExitUsage { | |
| 51 | t.Fatalf("zero ttl: exit %d", code) | |
| 52 | } | |
| 53 | if _, _, code := run(authorizedKey(t, "x"), "keys", "add", "--ttl", "-1h"); code != protocol.ExitUsage { | |
| 54 | t.Fatalf("negative ttl: exit %d", code) | |
| 55 | } | |
| 50 | 56 | |
| 51 | 57 | keys, err := st.ListSSHKeys(uid) |
| 52 | 58 | if err != nil || len(keys) != 2 { |