Exemplo n.º 1
0
        public void Initialize()
        {
            // NUnit [Platform] attribute doesn't differentiate MacOSX/Linux
            if (Peach.Core.Platform.GetOS() != Peach.Core.Platform.OS.OSX)
            {
                Assert.Ignore("Only supported on MacOSX");
            }

            ColoredConsoleTarget consoleTarget = new ColoredConsoleTarget();

            consoleTarget.Layout = "${date:format=HH\\:MM\\:ss} ${logger} ${message}";

            LoggingConfiguration config = new LoggingConfiguration();

            config.AddTarget("console", consoleTarget);

            LoggingRule rule = new LoggingRule("*", LogLevel.Debug, consoleTarget);

            config.LoggingRules.Add(rule);

            LogManager.Configuration = config;

            // Ensure only 1 instance of the platform tests runs at a time
            si = SingleInstance.CreateInstance("Peach.Core.Test.OS.OSX.dll");
            si.Lock();
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            ColoredConsoleTarget consoleTarget = new ColoredConsoleTarget();

            consoleTarget.Layout = "${date:format=HH\\:MM\\:ss} ${logger} ${message}";

            LoggingConfiguration config = new LoggingConfiguration();

            config.AddTarget("console", consoleTarget);

            LoggingRule rule = new LoggingRule("*", LogLevel.Debug, consoleTarget);

            config.LoggingRules.Add(rule);

            LogManager.Configuration = config;

            // Ensure only 1 instance of the platform tests runs at a time
            si = SingleInstance.CreateInstance("Peach.Core.Test.OS.OSX.dll");
            si.Lock();
        }
Exemplo n.º 3
0
        public void ServiceTest()
        {
            if (!Peach.Core.OS.Windows.Privilege.IsUserAdministrator())
            {
                Assert.Ignore("User is not an administrator.");
            }

            try
            {
                using (var si = SingleInstance.CreateInstance("Peach.Core.Test.OS.Windows.WinSystemTests"))
                {
                    si.Lock();

                    var dbg = new SystemDebuggerInstance()
                    {
                        service = "iphlpsvc"
                    };
                    dbg.StartDebugger();

                    for (int i = 0; i < 10; ++i)
                    {
                        Assert.True(dbg.IsRunning);
                        System.Threading.Thread.Sleep(100);
                    }

                    dbg.StopDebugger();

                    Assert.Null(dbg.crashInfo);
                }
            }
            finally
            {
                using (ServiceController srv = new ServiceController("iphlpsvc"))
                {
                    if (srv.Status == ServiceControllerStatus.Stopped)
                    {
                        srv.Start();
                    }
                }
            }
        }
 public void SetUp()
 {
     si = SingleInstance.CreateInstance("Peach.Core.Test.Monitors.ProcessKillerMonitorTests");
     si.Lock();
 }
Exemplo n.º 5
0
 public void SetUp()
 {
     si = SingleInstance.CreateInstance("Peach.Core.Test.Agent.AgentTests");
     si.Lock();
 }