mirror of
https://github.com/tailscale/tailscale.git
synced 2025-05-24 00:08:38 +00:00
fix the reuseDeadline time used for testing timelined operation
Signed-off-by: Kevin Liang <kevinliang@tailscale.com>
This commit is contained in:
parent
d339515ebc
commit
9cdb679a62
@ -163,16 +163,17 @@ func TestConsensusPoolExpiry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConsensusPoolExtendExpiry(t *testing.T) {
|
func TestConsensusPoolExtendValid(t *testing.T) {
|
||||||
ipp := makePool(netip.MustParsePrefix("100.64.0.0/31"))
|
ipp := makePool(netip.MustParsePrefix("100.64.0.0/31"))
|
||||||
firstIP := netip.MustParseAddr("100.64.0.0")
|
firstIP := netip.MustParseAddr("100.64.0.0")
|
||||||
secondIP := netip.MustParseAddr("100.64.0.1")
|
secondIP := netip.MustParseAddr("100.64.0.1")
|
||||||
timeOfUse := time.Now()
|
timeOfUse := time.Now()
|
||||||
afterTimeOfUse1 := timeOfUse.Add(-1 * time.Hour)
|
beforeTimeOfUse := timeOfUse.Add(-2 * time.Hour)
|
||||||
afterTimeOfUse2 := timeOfUse.Add(-2 * time.Hour)
|
afterTimeOfUse1 := timeOfUse.Add(1 * time.Hour)
|
||||||
|
afterTimeOfUse2 := timeOfUse.Add(2 * time.Hour)
|
||||||
from := tailcfg.NodeID(1)
|
from := tailcfg.NodeID(1)
|
||||||
|
|
||||||
aAddr, err := ipp.applyCheckoutAddr(from, "a.example.com", timeOfUse, timeOfUse)
|
aAddr, err := ipp.applyCheckoutAddr(from, "a.example.com", beforeTimeOfUse, timeOfUse)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -185,7 +186,7 @@ func TestConsensusPoolExtendExpiry(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
bAddr, err := ipp.applyCheckoutAddr(from, "b.example.com", afterTimeOfUse2, afterTimeOfUse2)
|
bAddr, err := ipp.applyCheckoutAddr(from, "b.example.com", timeOfUse, afterTimeOfUse2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user