diff --git a/internal/driver/ioscompanion/device_test.go b/internal/driver/ioscompanion/device_test.go index dfbf706..6a58be9 100644 --- a/internal/driver/ioscompanion/device_test.go +++ b/internal/driver/ioscompanion/device_test.go @@ -83,6 +83,25 @@ func TestNewDeviceWiresRunnerOnlyMode(t *testing.T) { } } +// TestNewDeviceWiresEveryBringUpsAddressPicker keeps the device driver whole. +// bringUpRunner reads its picker from a field rather than calling the package +// function, and NewDevice left that field nil, so the only thing standing +// between a device run and a nil call was which restart path happened to run. +func TestNewDeviceWiresEveryBringUpsAddressPicker(t *testing.T) { + address := startLoopbackListener(t) + options := testDeviceOptions(address, newDeviceCompanion()) + options.HardwareUDID = "00008140-PICKER" + d, err := NewDevice(context.Background(), options) + if err != nil { + t.Fatalf("NewDevice: %v", err) + } + defer d.Close() + + if err := d.bringUpRunner(context.Background()); err != nil { + t.Fatalf("bringUpRunner: %v", err) + } +} + func TestNewDeviceRequiresIdentifiers(t *testing.T) { if _, err := NewDevice(context.Background(), DeviceOptions{CoreDeviceID: "x"}); err == nil { t.Fatal("missing HardwareUDID must error")