diff --git a/test/sshkit_functional_test.exs b/test/sshkit_functional_test.exs index 58723d4e..7032ecc2 100644 --- a/test/sshkit_functional_test.exs +++ b/test/sshkit_functional_test.exs @@ -17,6 +17,23 @@ defmodule SSHKitFunctionalTest do assert name == host.options[:user] end + @tag boot: [@bootconf] + test "connects as the login user and runs commands in parallel", %{hosts: [host]} do + begin_time = Time.utc_now() + [{:ok, output1, 0},{:ok, output2, 0},{:ok, output3, 0}] = + [host, host, host] + |> SSHKit.context() + |> SSHKit.run("sleep 2; id -un", :parallel) + end_time = Time.utc_now() + run_time = Time.diff(end_time, begin_time, :second) + + assert run_time < 3 + assert String.trim(stdout(output1)) == host.options[:user] + assert String.trim(stdout(output2)) == host.options[:user] + assert String.trim(stdout(output3)) == host.options[:user] + + end + @tag boot: [@bootconf] test "runs commands and returns their output and exit status", %{hosts: [host]} do context = SSHKit.context(host)