All checks were successful
Test / Create distribution (push) Successful in 1m7s
Test / Sandbox (push) Successful in 2m57s
Test / ShareFS (push) Successful in 4m4s
Test / Hakurei (push) Successful in 4m8s
Test / Sandbox (race detector) (push) Successful in 5m35s
Test / Hakurei (race detector) (push) Successful in 6m51s
Test / Flake checks (push) Successful in 1m33s
This currently relies on a trusted bootloader to determine the boot device. Signed-off-by: Ophestra <cat@gensokyo.uk>
36 lines
581 B
Go
36 lines
581 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
"testing/synctest"
|
|
"time"
|
|
)
|
|
|
|
func TestRejectColdboot(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
synctest.Test(t, func(t *testing.T) {
|
|
nextColdboot := newRejectColdboot()
|
|
want := func(want bool) {
|
|
if got := nextColdboot(); got != want {
|
|
t.Fatalf("nextColdboot: %v, want %v", got, want)
|
|
}
|
|
}
|
|
|
|
synctest.Wait()
|
|
want(true)
|
|
time.Sleep(time.Hour)
|
|
synctest.Wait()
|
|
want(true)
|
|
want(true)
|
|
time.Sleep(5 * time.Minute)
|
|
synctest.Wait()
|
|
want(true)
|
|
want(false)
|
|
time.Sleep(time.Hour)
|
|
synctest.Wait()
|
|
want(false)
|
|
want(false)
|
|
})
|
|
}
|