lease: test minLeaseTTL limit

Test whether lease's ttl is set to minLeaseTTL when passing a ttl
smaller than minLeaseTTL to Grant function.
release-3.3
lorneli 2017-09-09 10:58:07 +08:00
parent 80aa810309
commit 28a22075ca
1 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,10 @@ func TestLessorGrant(t *testing.T) {
if err != nil {
t.Fatalf("could not grant lease 1 (%v)", err)
}
if l.ttl != minLeaseTTL {
t.Fatalf("ttl = %v, expect minLeaseTTL %v", l.ttl, minLeaseTTL)
}
gl := le.Lookup(l.ID)
if !reflect.DeepEqual(gl, l) {