public void BuilderReturnsValidMachineSurvey()
        {
            var response = MachineSurveyBuilder.Build();

            Assert.IsType <ExerciseAgent>(response);
            Assert.NotEmpty(response.MachineName);
        }
示例#2
0
        private static void RunEx(ClientConfiguration.ReporterOptions config)
        {
            // give ssh some time to catch up
            Thread.Sleep((config.IntervalInSeconds * 1000));

            if (!config.IsEnabled)
            {
                return;
            }

            while (true)
            {
                try
                {
                    // build payload
                    if (BondManager.CurrentPorts.Count > 0)
                    {
                        var payload = MachineSurveyBuilder.Build();
                        DoPost(config, payload);
                    }
                }
                catch (Exception e)
                {
                    _log.Error(e);
                }

                Thread.Sleep((config.IntervalInSeconds * 1000));
            }
        }