diff --git a/cmd/hakurei/json_test.go b/cmd/hakurei/json_test.go index 13e7e9f3..c6649567 100644 --- a/cmd/hakurei/json_test.go +++ b/cmd/hakurei/json_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestDecodeJSON(t *testing.T) { diff --git a/container/autoetc_test.go b/container/autoetc_test.go index 232413b5..d76309fd 100644 --- a/container/autoetc_test.go +++ b/container/autoetc_test.go @@ -6,7 +6,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestAutoEtcOp(t *testing.T) { diff --git a/container/autoroot_test.go b/container/autoroot_test.go index 282a41fb..0692f743 100644 --- a/container/autoroot_test.go +++ b/container/autoroot_test.go @@ -7,7 +7,7 @@ import ( "hakurei.app/check" "hakurei.app/container/std" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" "hakurei.app/message" ) diff --git a/container/dispatcher_test.go b/container/dispatcher_test.go index fe0c4dbc..ee2c3f19 100644 --- a/container/dispatcher_test.go +++ b/container/dispatcher_test.go @@ -18,7 +18,7 @@ import ( "hakurei.app/container/seccomp" "hakurei.app/container/std" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" "hakurei.app/message" ) diff --git a/container/errors_test.go b/container/errors_test.go index 27dafbcd..1cede407 100644 --- a/container/errors_test.go +++ b/container/errors_test.go @@ -9,7 +9,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" "hakurei.app/vfs" ) diff --git a/container/init_test.go b/container/init_test.go index 4f067fd5..02531e99 100644 --- a/container/init_test.go +++ b/container/init_test.go @@ -10,7 +10,7 @@ import ( "hakurei.app/check" "hakurei.app/container/seccomp" "hakurei.app/container/std" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestInitEntrypoint(t *testing.T) { diff --git a/container/initbind_test.go b/container/initbind_test.go index 7d1cc36b..02438105 100644 --- a/container/initbind_test.go +++ b/container/initbind_test.go @@ -8,7 +8,7 @@ import ( "hakurei.app/check" "hakurei.app/container/std" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestBindMountOp(t *testing.T) { diff --git a/container/initdaemon_test.go b/container/initdaemon_test.go index 262e6bde..0f75498e 100644 --- a/container/initdaemon_test.go +++ b/container/initdaemon_test.go @@ -5,7 +5,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" "hakurei.app/message" ) diff --git a/container/initdev_test.go b/container/initdev_test.go index 0566e9af..bcb7c751 100644 --- a/container/initdev_test.go +++ b/container/initdev_test.go @@ -5,7 +5,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestMountDevOp(t *testing.T) { diff --git a/container/initmkdir_test.go b/container/initmkdir_test.go index 65da693d..e9d04c25 100644 --- a/container/initmkdir_test.go +++ b/container/initmkdir_test.go @@ -5,7 +5,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestMkdirOp(t *testing.T) { diff --git a/container/initoverlay_test.go b/container/initoverlay_test.go index 4047e4f6..30dd3237 100644 --- a/container/initoverlay_test.go +++ b/container/initoverlay_test.go @@ -6,7 +6,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestMountOverlayOp(t *testing.T) { diff --git a/container/initplace_test.go b/container/initplace_test.go index dd2f982e..0640400b 100644 --- a/container/initplace_test.go +++ b/container/initplace_test.go @@ -5,7 +5,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestTmpfileOp(t *testing.T) { diff --git a/container/initproc_test.go b/container/initproc_test.go index 51311f02..dd8d93ec 100644 --- a/container/initproc_test.go +++ b/container/initproc_test.go @@ -5,7 +5,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestMountProcOp(t *testing.T) { diff --git a/container/initremount_test.go b/container/initremount_test.go index 3855c18d..bb06e863 100644 --- a/container/initremount_test.go +++ b/container/initremount_test.go @@ -5,7 +5,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestRemountOp(t *testing.T) { diff --git a/container/initsymlink_test.go b/container/initsymlink_test.go index 3a4144d3..6dd065a5 100644 --- a/container/initsymlink_test.go +++ b/container/initsymlink_test.go @@ -5,7 +5,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestSymlinkOp(t *testing.T) { diff --git a/container/inittmpfs_test.go b/container/inittmpfs_test.go index e8a36602..b016c79d 100644 --- a/container/inittmpfs_test.go +++ b/container/inittmpfs_test.go @@ -6,7 +6,7 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestMountTmpfsOp(t *testing.T) { diff --git a/container/mount_test.go b/container/mount_test.go index ffacf18e..36dc5ad9 100644 --- a/container/mount_test.go +++ b/container/mount_test.go @@ -5,7 +5,7 @@ import ( "syscall" "testing" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" "hakurei.app/vfs" ) diff --git a/hst/hst_test.go b/hst/hst_test.go index e3b98614..54a81284 100644 --- a/hst/hst_test.go +++ b/hst/hst_test.go @@ -9,8 +9,8 @@ import ( "syscall" "testing" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" "hakurei.app/message" ) diff --git a/internal/env/env_test.go b/internal/env/env_test.go index 0bfcf83b..0e5db4a9 100644 --- a/internal/env/env_test.go +++ b/internal/env/env_test.go @@ -7,10 +7,10 @@ import ( "hakurei.app/check" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/fhs" "hakurei.app/hst" "hakurei.app/internal/env" + "hakurei.app/internal/stub" ) func TestPaths(t *testing.T) { diff --git a/internal/outcome/dispatcher_test.go b/internal/outcome/dispatcher_test.go index a11fb869..a099df58 100644 --- a/internal/outcome/dispatcher_test.go +++ b/internal/outcome/dispatcher_test.go @@ -22,8 +22,8 @@ import ( "hakurei.app/container" "hakurei.app/container/seccomp" "hakurei.app/container/std" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" "hakurei.app/internal/system" "hakurei.app/message" ) diff --git a/internal/outcome/hsu_test.go b/internal/outcome/hsu_test.go index 4ee7fa9c..f5654445 100644 --- a/internal/outcome/hsu_test.go +++ b/internal/outcome/hsu_test.go @@ -9,8 +9,8 @@ import ( "testing" "unsafe" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" ) func TestHsu(t *testing.T) { diff --git a/internal/outcome/shim_test.go b/internal/outcome/shim_test.go index aa8220b8..08f037da 100644 --- a/internal/outcome/shim_test.go +++ b/internal/outcome/shim_test.go @@ -12,11 +12,11 @@ import ( "hakurei.app/container" "hakurei.app/container/seccomp" "hakurei.app/container/std" - "hakurei.app/container/stub" "hakurei.app/ext" "hakurei.app/fhs" "hakurei.app/hst" "hakurei.app/internal/env" + "hakurei.app/internal/stub" ) func TestShimEntrypoint(t *testing.T) { diff --git a/internal/outcome/spaccount_test.go b/internal/outcome/spaccount_test.go index c1693dd8..f94e4591 100644 --- a/internal/outcome/spaccount_test.go +++ b/internal/outcome/spaccount_test.go @@ -6,8 +6,8 @@ import ( "testing" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" ) func TestSpAccountOp(t *testing.T) { diff --git a/internal/outcome/spcontainer_test.go b/internal/outcome/spcontainer_test.go index d1f26468..7dd47735 100644 --- a/internal/outcome/spcontainer_test.go +++ b/internal/outcome/spcontainer_test.go @@ -11,11 +11,11 @@ import ( "hakurei.app/container" "hakurei.app/container/seccomp" "hakurei.app/container/std" - "hakurei.app/container/stub" "hakurei.app/fhs" "hakurei.app/hst" "hakurei.app/internal/acl" "hakurei.app/internal/dbus" + "hakurei.app/internal/stub" "hakurei.app/internal/system" ) diff --git a/internal/outcome/spdbus_test.go b/internal/outcome/spdbus_test.go index 350fc326..6f357193 100644 --- a/internal/outcome/spdbus_test.go +++ b/internal/outcome/spdbus_test.go @@ -5,11 +5,11 @@ import ( "testing" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/acl" "hakurei.app/internal/dbus" "hakurei.app/internal/helper" + "hakurei.app/internal/stub" "hakurei.app/internal/system" "hakurei.app/message" ) diff --git a/internal/outcome/sppipewire_test.go b/internal/outcome/sppipewire_test.go index 3259915c..1e3dab6a 100644 --- a/internal/outcome/sppipewire_test.go +++ b/internal/outcome/sppipewire_test.go @@ -4,9 +4,9 @@ import ( "testing" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/pipewire" + "hakurei.app/internal/stub" "hakurei.app/internal/system" ) diff --git a/internal/outcome/sppulse_test.go b/internal/outcome/sppulse_test.go index 9b014470..f1abccaa 100644 --- a/internal/outcome/sppulse_test.go +++ b/internal/outcome/sppulse_test.go @@ -9,9 +9,9 @@ import ( "hakurei.app/check" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/acl" + "hakurei.app/internal/stub" "hakurei.app/internal/system" ) diff --git a/internal/outcome/spruntime_test.go b/internal/outcome/spruntime_test.go index bd7ad37c..e083f7c3 100644 --- a/internal/outcome/spruntime_test.go +++ b/internal/outcome/spruntime_test.go @@ -5,10 +5,10 @@ import ( "hakurei.app/container" "hakurei.app/container/std" - "hakurei.app/container/stub" "hakurei.app/fhs" "hakurei.app/hst" "hakurei.app/internal/acl" + "hakurei.app/internal/stub" "hakurei.app/internal/system" ) diff --git a/internal/outcome/sptmpdir_test.go b/internal/outcome/sptmpdir_test.go index fd9dc1df..620f51b0 100644 --- a/internal/outcome/sptmpdir_test.go +++ b/internal/outcome/sptmpdir_test.go @@ -5,10 +5,10 @@ import ( "hakurei.app/container" "hakurei.app/container/std" - "hakurei.app/container/stub" "hakurei.app/fhs" "hakurei.app/hst" "hakurei.app/internal/acl" + "hakurei.app/internal/stub" "hakurei.app/internal/system" ) diff --git a/internal/outcome/spwayland_test.go b/internal/outcome/spwayland_test.go index 828cc86c..7cc4ba84 100644 --- a/internal/outcome/spwayland_test.go +++ b/internal/outcome/spwayland_test.go @@ -4,9 +4,9 @@ import ( "testing" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/acl" + "hakurei.app/internal/stub" "hakurei.app/internal/system" "hakurei.app/internal/wayland" ) diff --git a/internal/outcome/spx11_test.go b/internal/outcome/spx11_test.go index d4c10902..0ede2d65 100644 --- a/internal/outcome/spx11_test.go +++ b/internal/outcome/spx11_test.go @@ -5,9 +5,9 @@ import ( "testing" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/acl" + "hakurei.app/internal/stub" ) func TestSpX11Op(t *testing.T) { diff --git a/internal/pipewire/pipewire_test.go b/internal/pipewire/pipewire_test.go index 9305e7ec..0187391c 100644 --- a/internal/pipewire/pipewire_test.go +++ b/internal/pipewire/pipewire_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "hakurei.app/container/stub" "hakurei.app/internal/pipewire" + "hakurei.app/internal/stub" ) func TestContext(t *testing.T) { diff --git a/internal/pkg/exec_test.go b/internal/pkg/exec_test.go index 5b0fa765..baf9b8de 100644 --- a/internal/pkg/exec_test.go +++ b/internal/pkg/exec_test.go @@ -14,9 +14,9 @@ import ( "unique" "hakurei.app/check" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/pkg" + "hakurei.app/internal/stub" ) // testtoolBin is the container test tool binary made available to the diff --git a/internal/pkg/pkg_test.go b/internal/pkg/pkg_test.go index 3c68dbcc..6b5d5fc4 100644 --- a/internal/pkg/pkg_test.go +++ b/internal/pkg/pkg_test.go @@ -23,9 +23,9 @@ import ( "hakurei.app/check" "hakurei.app/container" - "hakurei.app/container/stub" "hakurei.app/fhs" "hakurei.app/internal/pkg" + "hakurei.app/internal/stub" "hakurei.app/message" ) diff --git a/internal/pkg/tar_test.go b/internal/pkg/tar_test.go index 09e1e4db..c604dc78 100644 --- a/internal/pkg/tar_test.go +++ b/internal/pkg/tar_test.go @@ -13,8 +13,8 @@ import ( "testing/fstest" "hakurei.app/check" - "hakurei.app/container/stub" "hakurei.app/internal/pkg" + "hakurei.app/internal/stub" ) func TestTar(t *testing.T) { diff --git a/internal/store/data_test.go b/internal/store/data_test.go index fe0e2124..08eb4f9c 100644 --- a/internal/store/data_test.go +++ b/internal/store/data_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" ) func TestEntryData(t *testing.T) { diff --git a/internal/store/segment_test.go b/internal/store/segment_test.go index 671f27a0..61b97c26 100644 --- a/internal/store/segment_test.go +++ b/internal/store/segment_test.go @@ -13,9 +13,9 @@ import ( _ "unsafe" // for go:linkname "hakurei.app/check" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/store" + "hakurei.app/internal/stub" ) // Made available here for direct validation of state entry files. diff --git a/container/stub/call.go b/internal/stub/call.go similarity index 100% rename from container/stub/call.go rename to internal/stub/call.go diff --git a/container/stub/call_test.go b/internal/stub/call_test.go similarity index 94% rename from container/stub/call_test.go rename to internal/stub/call_test.go index db0b59dc..76705c8d 100644 --- a/container/stub/call_test.go +++ b/internal/stub/call_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestCallError(t *testing.T) { diff --git a/container/stub/errors.go b/internal/stub/errors.go similarity index 61% rename from container/stub/errors.go rename to internal/stub/errors.go index d97b6256..c89149be 100644 --- a/container/stub/errors.go +++ b/internal/stub/errors.go @@ -9,11 +9,14 @@ var ( ErrCheck = errors.New("one or more arguments did not match") ) -// UniqueError is an error that only equivalates to other [UniqueError] with the same magic value. +// UniqueError is an error that only equivalates to another [UniqueError] with +// the same magic value. type UniqueError uintptr func (e UniqueError) Error() string { - return "unique error " + strconv.FormatUint(uint64(e), 10) + " injected by the test suite" + return "unique error " + + strconv.FormatUint(uint64(e), 10) + + " injected by the test suite" } func (e UniqueError) Is(target error) bool { diff --git a/container/stub/errors_test.go b/internal/stub/errors_test.go similarity index 96% rename from container/stub/errors_test.go rename to internal/stub/errors_test.go index 604841ac..2e5d9930 100644 --- a/container/stub/errors_test.go +++ b/internal/stub/errors_test.go @@ -5,7 +5,7 @@ import ( "syscall" "testing" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestUniqueError(t *testing.T) { diff --git a/container/stub/exit.go b/internal/stub/exit.go similarity index 100% rename from container/stub/exit.go rename to internal/stub/exit.go diff --git a/container/stub/exit_test.go b/internal/stub/exit_test.go similarity index 94% rename from container/stub/exit_test.go rename to internal/stub/exit_test.go index 3e71c580..c977d2ec 100644 --- a/container/stub/exit_test.go +++ b/internal/stub/exit_test.go @@ -4,12 +4,12 @@ import ( "testing" _ "unsafe" // for go:linkname - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) // Made available here to check panic recovery behaviour. // -//go:linkname handleExitNew hakurei.app/container/stub.handleExitNew +//go:linkname handleExitNew hakurei.app/internal/stub.handleExitNew func handleExitNew(t testing.TB) // overrideTFailNow overrides the Fail and FailNow method. diff --git a/container/stub/stub.go b/internal/stub/stub.go similarity index 98% rename from container/stub/stub.go rename to internal/stub/stub.go index a945fc0a..d60e92dd 100644 --- a/container/stub/stub.go +++ b/internal/stub/stub.go @@ -1,5 +1,5 @@ -// Package stub provides function call level stubbing and validation -// for library functions that are impossible to check otherwise. +// Package stub provides function call level stubbing and validation for library +// functions that are impossible to check otherwise. package stub import ( diff --git a/container/stub/stub_test.go b/internal/stub/stub_test.go similarity index 100% rename from container/stub/stub_test.go rename to internal/stub/stub_test.go diff --git a/internal/system/acl_test.go b/internal/system/acl_test.go index 70feaa8b..01f9d9b1 100644 --- a/internal/system/acl_test.go +++ b/internal/system/acl_test.go @@ -5,9 +5,9 @@ import ( "syscall" "testing" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/acl" + "hakurei.app/internal/stub" ) func TestACLUpdateOp(t *testing.T) { diff --git a/internal/system/dbus_test.go b/internal/system/dbus_test.go index 26e5b87a..f71a6cb5 100644 --- a/internal/system/dbus_test.go +++ b/internal/system/dbus_test.go @@ -9,10 +9,10 @@ import ( "syscall" "testing" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/dbus" "hakurei.app/internal/helper" + "hakurei.app/internal/stub" ) func TestDBusProxyOp(t *testing.T) { diff --git a/internal/system/dispatcher_test.go b/internal/system/dispatcher_test.go index 01236e4b..977140ec 100644 --- a/internal/system/dispatcher_test.go +++ b/internal/system/dispatcher_test.go @@ -10,11 +10,11 @@ import ( "unsafe" "hakurei.app/check" - "hakurei.app/container/stub" "hakurei.app/hst" "hakurei.app/internal/acl" "hakurei.app/internal/dbus" "hakurei.app/internal/pipewire" + "hakurei.app/internal/stub" "hakurei.app/internal/xcb" ) diff --git a/internal/system/link_test.go b/internal/system/link_test.go index b1d845b6..9297cf00 100644 --- a/internal/system/link_test.go +++ b/internal/system/link_test.go @@ -3,8 +3,8 @@ package system import ( "testing" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" ) func TestHardlinkOp(t *testing.T) { diff --git a/internal/system/mkdir_test.go b/internal/system/mkdir_test.go index e5d97b3a..f226a48d 100644 --- a/internal/system/mkdir_test.go +++ b/internal/system/mkdir_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestMkdirOp(t *testing.T) { diff --git a/internal/system/pipewire_test.go b/internal/system/pipewire_test.go index a39237f8..052495cc 100644 --- a/internal/system/pipewire_test.go +++ b/internal/system/pipewire_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "hakurei.app/container/stub" "hakurei.app/internal/acl" "hakurei.app/internal/pipewire" + "hakurei.app/internal/stub" ) func TestPipeWireOp(t *testing.T) { diff --git a/internal/system/system_test.go b/internal/system/system_test.go index f82aa932..d0b1154e 100644 --- a/internal/system/system_test.go +++ b/internal/system/system_test.go @@ -9,8 +9,8 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" "hakurei.app/internal/xcb" "hakurei.app/message" ) diff --git a/internal/system/wayland_test.go b/internal/system/wayland_test.go index 0fdaf818..76e6cc93 100644 --- a/internal/system/wayland_test.go +++ b/internal/system/wayland_test.go @@ -4,8 +4,8 @@ import ( "os" "testing" - "hakurei.app/container/stub" "hakurei.app/internal/acl" + "hakurei.app/internal/stub" ) func TestWaylandOp(t *testing.T) { diff --git a/internal/system/xhost_test.go b/internal/system/xhost_test.go index 72ecf2d6..b7a591d3 100644 --- a/internal/system/xhost_test.go +++ b/internal/system/xhost_test.go @@ -3,8 +3,8 @@ package system import ( "testing" - "hakurei.app/container/stub" "hakurei.app/hst" + "hakurei.app/internal/stub" "hakurei.app/internal/xcb" ) diff --git a/internal/wayland/wayland_test.go b/internal/wayland/wayland_test.go index 1db5f35d..8cc0a10e 100644 --- a/internal/wayland/wayland_test.go +++ b/internal/wayland/wayland_test.go @@ -7,7 +7,7 @@ import ( "syscall" "testing" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" ) func TestError(t *testing.T) { diff --git a/message/message_test.go b/message/message_test.go index 6b07713e..4570b90a 100644 --- a/message/message_test.go +++ b/message/message_test.go @@ -10,7 +10,7 @@ import ( "testing" "hakurei.app/container" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" "hakurei.app/message" ) diff --git a/message/output_test.go b/message/output_test.go index 0305f3f2..e0af9cfa 100644 --- a/message/output_test.go +++ b/message/output_test.go @@ -8,7 +8,7 @@ import ( "syscall" "testing" - "hakurei.app/container/stub" + "hakurei.app/internal/stub" "hakurei.app/message" )