示例#1
0
        public NomadAgentProcess(NomadAgentConfiguration configuration, ITestOutputHelper output)
        {
            _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _output        = output ?? throw new ArgumentNullException(nameof(output));
            InitConfigFile();
            InitStartInfo();
            CleanDataDir();

            OutputDataReceived += NomadAgentProcess_OutputDataReceived;
            ErrorDataReceived  += NomadAgentProcess_ErrorDataReceived;
        }
示例#2
0
        internal NomadAgentProcess NewServer(Action <NomadAgentConfiguration> configure = null)
        {
            var type   = GetType();
            var config = new NomadAgentConfiguration
            {
                Region  = "test-region",
                Name    = $"{type.Name}_{NomadAgentConfiguration.Count}",
                DataDir = $"{Path.GetTempPath()}nomaddir_{type.Name}_{NomadAgentConfiguration.Count}",
                Ports   = BasePorts.Add(NomadAgentConfiguration.Count),
            };

            configure?.Invoke(config);
            var process = new NomadAgentProcess(config, _output);

            process.Start();
            return(process);
        }