All checks were successful
Test / Create distribution (push) Successful in 1m15s
Test / Sandbox (push) Successful in 3m8s
Test / Hakurei (push) Successful in 4m17s
Test / ShareFS (push) Successful in 4m20s
Test / Sandbox (race detector) (push) Successful in 5m34s
Test / Hakurei (race detector) (push) Successful in 6m40s
Test / Flake checks (push) Successful in 1m26s
This is not a great way to implement cold boot, but I already have the implementation lying around. Signed-off-by: Ophestra <cat@gensokyo.uk>
29 lines
427 B
Go
29 lines
427 B
Go
package uevent_test
|
|
|
|
import (
|
|
"os"
|
|
"sync"
|
|
"testing"
|
|
|
|
"hakurei.app/internal/uevent"
|
|
)
|
|
|
|
func TestEnumerate(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
var wg sync.WaitGroup
|
|
defer wg.Wait()
|
|
|
|
events := make(chan *uevent.Message, 1<<10)
|
|
wg.Go(func() {
|
|
for msg := range events {
|
|
t.Log(msg)
|
|
}
|
|
})
|
|
|
|
if err := uevent.Enumerate(os.DirFS("/sys"), nil, events); err != nil {
|
|
t.Fatalf("Enumerate: error = %v", err)
|
|
}
|
|
close(events)
|
|
}
|