diff --git a/LibMpcTest/LibMpcTest.cs b/LibMpcTest/LibMpcTest.cs index 447b5bc..cff4c18 100644 --- a/LibMpcTest/LibMpcTest.cs +++ b/LibMpcTest/LibMpcTest.cs @@ -22,8 +22,6 @@ namespace LibMpcTest _mpc = new Mpc(new IPEndPoint(IPAddress.Loopback, 6600)); - Console.Out.WriteLine(_server.LogError); - var connected = Task.Run(async () => await _mpc.ConnectAsync()).Result; if (connected) { diff --git a/LibMpcTest/MpdServerTest.cs b/LibMpcTest/MpdServerTest.cs index e3b638f..40e0118 100644 --- a/LibMpcTest/MpdServerTest.cs +++ b/LibMpcTest/MpdServerTest.cs @@ -30,8 +30,10 @@ namespace LibMpcTest Console.Out.WriteLine($"Starting Server: {Process.StartInfo.FileName} {Process.StartInfo.Arguments}"); Process.Start(); - LogOutput = Process.StandardOutput.ReadToEnd(); - LogError = Process.StandardError.ReadToEnd(); + + Console.Out.WriteLine("mpd:"); + Console.Out.WriteLine($"out: {Process.StandardOutput.ReadToEnd()}"); + Console.Out.WriteLine($"err: {Process.StandardError.ReadToEnd()}"); if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { @@ -45,9 +47,9 @@ namespace LibMpcTest { StartInfo = new ProcessStartInfo { - FileName = "/bin/netstat", + FileName = "/bin/bash", WorkingDirectory = "/bin/", - Arguments = "-ntpl", + Arguments = "-c \"sudo /bin/netstat -ntpl\"", UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, @@ -91,14 +93,14 @@ namespace LibMpcTest private class Server { public static Server Linux = new Server( - fileName: "/usr/bin/mpd", - workingDirectory: "/usr/bin/", - arguments: string.Join(" ", Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf"), "-v")); + fileName: "/bin/bash", + workingDirectory: "/bin/", + arguments: $"-c \"sudo /usr/bin/mpd {Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf")} -v\""); public static Server Windows = new Server( fileName: Path.Combine(AppContext.BaseDirectory, "Server", "mpd.exe"), workingDirectory: Path.Combine(AppContext.BaseDirectory, "Server"), - arguments: string.Join(" ", Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf"), "-v")); + arguments: $"{Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf")} -v"); private Server(string fileName, string workingDirectory, string arguments) {