1
0
forked from rosa/hakurei

internal/uevent: optionally pass UUID during coldboot

This enables rejection of non-coldboot synthetic events.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-06 11:43:16 +09:00
parent a69273ab2a
commit cd0beeaf8e
4 changed files with 184 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ func TestColdboot(t *testing.T) {
}
})
err := uevent.Coldboot(t.Context(), d, visited, func(err error) error {
err := uevent.Coldboot(t.Context(), d, nil, visited, func(err error) error {
t.Errorf("handleWalkErr: %v", err)
return err
})
@@ -219,7 +219,7 @@ func TestColdbootError(t *testing.T) {
}
}
if err := uevent.Coldboot(ctx, d, visited, handleWalkErr); !reflect.DeepEqual(err, wantErr) {
if err := uevent.Coldboot(ctx, d, new(uevent.UUID), visited, handleWalkErr); !reflect.DeepEqual(err, wantErr) {
t.Errorf("Coldboot: error = %v, want %v", err, wantErr)
}
})