internal/pkg: compare interfaces for host net
All checks were successful
Test / Create distribution (push) Successful in 46s
Test / Sandbox (push) Successful in 2m59s
Test / ShareFS (push) Successful in 4m45s
Test / Hpkg (push) Successful in 5m4s
Test / Hakurei (push) Successful in 5m22s
Test / Sandbox (race detector) (push) Successful in 5m21s
Test / Hakurei (race detector) (push) Successful in 7m31s
Test / Flake checks (push) Successful in 1m40s

An upcoming improvement in the container init makes the current host net check return the same result for both cases. This change

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-11 00:30:32 +09:00
parent 34cb4ebd3b
commit da3848b92f
2 changed files with 66 additions and 16 deletions

View File

@@ -4,7 +4,9 @@ package pkg_test
import (
_ "embed"
"encoding/gob"
"errors"
"net"
"os"
"os/exec"
"slices"
@@ -263,6 +265,27 @@ func newTesttool() (
); err != nil {
return err
}
if ift, err := net.Interfaces(); err != nil {
return err
} else {
var f *os.File
if f, err = os.Create(t.GetWorkDir().Append(
"ift",
).String()); err != nil {
return err
} else {
err = gob.NewEncoder(f).Encode(ift)
closeErr := f.Close()
if err != nil {
return err
}
if closeErr != nil {
return closeErr
}
}
}
return os.WriteFile(t.GetWorkDir().Append(
"bin",
"testtool",