From d16da6da8c4880d90dc35fa9006806f7c0395d7f Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 3 Oct 2025 02:26:14 +0900 Subject: system: enforce absolute paths This is less error-prone, and is quite easy to integrate considering internal/app has already migrated to container.Absolute. Closes #11. Signed-off-by: Ophestra --- system/dbus_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'system/dbus_test.go') diff --git a/system/dbus_test.go b/system/dbus_test.go index 1ae217bd..f20f984a 100644 --- a/system/dbus_test.go +++ b/system/dbus_test.go @@ -82,7 +82,7 @@ func TestDBusProxyOp(t *testing.T) { Op: "dbus", Err: ErrDBusConfig, Msg: "attempted to create message bus proxy args without session bus config", } - if f, err := sys.ProxyDBus(nil, new(dbus.Config), "", ""); !reflect.DeepEqual(err, wantErr) { + if f, err := sys.ProxyDBus(nil, new(dbus.Config), nil, nil); !reflect.DeepEqual(err, wantErr) { t.Errorf("ProxyDBus: error = %v, want %v", err, wantErr) } else if f != nil { t.Errorf("ProxyDBus: f = %p", f) @@ -98,10 +98,10 @@ func TestDBusProxyOp(t *testing.T) { }() sys.MustProxyDBus( - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus", &dbus.Config{ + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"session\x00"}, Filter: true, - }, "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket", &dbus.Config{ + }, m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"system\x00"}, Filter: true, }) @@ -128,8 +128,8 @@ func TestDBusProxyOp(t *testing.T) { // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"system\x00"}, Filter: true, }, - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus", - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket"); !reflect.DeepEqual(err, wantErr) { + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus"), + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket")); !reflect.DeepEqual(err, wantErr) { t.Errorf("ProxyDBus: error = %v", err) } else if f != nil { t.Errorf("ProxyDBus: f = %p", f) @@ -146,10 +146,10 @@ func TestDBusProxyOp(t *testing.T) { {"full", 0xcafebabe, func(_ *testing.T, sys *I) { sys.MustProxyDBus( - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus", &dbus.Config{ + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"session\x00"}, Filter: true, - }, "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket", &dbus.Config{ + }, m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"system\x00"}, Filter: true, }) -- cgit v1.3.1