diff --git a/DistTestCore/Marketplace/GethCompanionNodeInfo.cs b/DistTestCore/Marketplace/GethCompanionNodeInfo.cs index 6c4b8e8..3230d2a 100644 --- a/DistTestCore/Marketplace/GethCompanionNodeInfo.cs +++ b/DistTestCore/Marketplace/GethCompanionNodeInfo.cs @@ -1,5 +1,4 @@ using KubernetesWorkflow; -using Logging; using NethereumWorkflow; namespace DistTestCore.Marketplace @@ -15,13 +14,12 @@ namespace DistTestCore.Marketplace public RunningContainer RunningContainer { get; } public GethAccount[] Accounts { get; } - public NethereumInteraction StartInteraction(BaseLog log, GethAccount account) + public NethereumInteraction StartInteraction(TestLifecycle lifecycle, GethAccount account) { - var ip = RunningContainer.Pod.Cluster.HostAddress; - var port = RunningContainer.ServicePorts[0].Number; + var address = lifecycle.Configuration.GetAddress(RunningContainer); var privateKey = account.PrivateKey; - var creator = new NethereumInteractionCreator(log, ip, port, privateKey); + var creator = new NethereumInteractionCreator(lifecycle.Log, address.Host, address.Port, privateKey); return creator.CreateWorkflow(); } } diff --git a/DistTestCore/Marketplace/GethCompanionNodeStarter.cs b/DistTestCore/Marketplace/GethCompanionNodeStarter.cs index a71c661..2008e9c 100644 --- a/DistTestCore/Marketplace/GethCompanionNodeStarter.cs +++ b/DistTestCore/Marketplace/GethCompanionNodeStarter.cs @@ -50,7 +50,7 @@ namespace DistTestCore.Marketplace { Time.WaitUntil(() => { - var interaction = node.StartInteraction(lifecycle.Log, node.Accounts.First()); + var interaction = node.StartInteraction(lifecycle, node.Accounts.First()); return interaction.IsSynced(marketplace.Marketplace.Address, marketplace.Marketplace.Abi); }, TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(3)); } diff --git a/KubernetesWorkflow/K8sController.cs b/KubernetesWorkflow/K8sController.cs index 539b2b2..f094134 100644 --- a/KubernetesWorkflow/K8sController.cs +++ b/KubernetesWorkflow/K8sController.cs @@ -59,10 +59,15 @@ namespace KubernetesWorkflow public string ExecuteCommand(RunningPod pod, string containerName, string command, params string[] args) { - log.Debug($"{containerName}: {command} ({string.Join(",", args)})"); + var cmdAndArgs = $"{containerName}: {command} ({string.Join(",", args)})"; + log.Debug(cmdAndArgs); + var runner = new CommandRunner(client, K8sTestNamespace, pod, containerName, command, args); runner.Run(); - return runner.GetStdOut(); + var result = runner.GetStdOut(); + + log.Debug($"{cmdAndArgs} = '{result}'"); + return result; } public void DeleteAllResources()