ipn/ipnlocal, tka: Implement TKA synchronization with the control plane
Signed-off-by: Tom DNetto <tom@tailscale.com>
This commit is contained in:
@@ -214,6 +214,9 @@ func (c *FS) AUM(hash AUMHash) (AUM, error) {
|
||||
|
||||
info, err := c.get(hash)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return AUM{}, os.ErrNotExist
|
||||
}
|
||||
return AUM{}, err
|
||||
}
|
||||
if info.AUM == nil {
|
||||
|
||||
@@ -58,6 +58,18 @@ func TestTailchonk_ChildAUMs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTailchonk_AUMMissing(t *testing.T) {
|
||||
for _, chonk := range []Chonk{&Mem{}, &FS{base: t.TempDir()}} {
|
||||
t.Run(fmt.Sprintf("%T", chonk), func(t *testing.T) {
|
||||
var notExists AUMHash
|
||||
notExists[:][0] = 42
|
||||
if _, err := chonk.AUM(notExists); err != os.ErrNotExist {
|
||||
t.Errorf("chonk.AUM(notExists).err = %v, want %v", err, os.ErrNotExist)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestTailchonkMem_Orphans(t *testing.T) {
|
||||
chonk := Mem{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user