Example #1
0
        public void Lync_FabricExitedHandlerShouldNotCrash()
        {
            using (var deployment = LyncScenarioTestHelper.CreateDeployment("Lync_FabricExitedCrashTest"))
            {
                using (var hostInfo = new LyncScenarioTestHelper.LyncHostInfo(deployment.Nodes.First(), Enumerable.Empty <Type>(), true))
                {
                    // let the host come up
                    LogHelper.Log("Starting processes");
                    hostInfo.StartProcess(deployment.TestOutputPath, "exitnotification_crash");

                    // kill the fabric node
                    LogHelper.Log("Killing fabric.exe");
                    deployment.Nodes.First().Dispose();

                    // assert that the host received the notification
                    Assert.IsTrue(MiscUtility.WaitUntil(() => hostInfo.QueryHasFabricExited(), TimeSpan.FromSeconds(5), 200));

                    // wait for a little while
                    Thread.Sleep(2000);

                    // assert that the host is still up and has not crashed
                    Assert.IsFalse(hostInfo.Process.HasExited);

                    LogHelper.Log("Stopping Host");
                    hostInfo.StopProcess();
                }
            }
        }
Example #2
0
        public void Lync_FabricExitedNotification()
        {
            const int hostCount       = 10;
            bool      hasFabricExited = false;

            using (var deployment = LyncScenarioTestHelper.CreateDeployment("Lync_FabricExitedNotification"))
            {
                var lyncHostList = new List <LyncScenarioTestHelper.LyncHostInfo>();
                for (int i = 0; i < hostCount; i++)
                {
                    lyncHostList.Add(new LyncScenarioTestHelper.LyncHostInfo(deployment.Nodes.First(), Enumerable.Empty <Type>(), false));
                }

                // let the host come up
                LogHelper.Log("Starting processes");
                for (int i = 0; i < hostCount; i++)
                {
                    lyncHostList[i].StartProcess(deployment.TestOutputPath, "exitnotification_" + i.ToString());
                }

                // kill the fabric node
                LogHelper.Log("Killing fabric.exe");
                deployment.Nodes.First().Dispose();

                // assert that the host received the notification
                MiscUtility.WaitUntil(() =>
                {
                    LogHelper.Log("Querying host");
                    hasFabricExited = Enumerable.All(lyncHostList, e => e.QueryHasFabricExited());
                    return(hasFabricExited);
                }, TimeSpan.FromSeconds(5), 200);

                LogHelper.Log("Stopping Host");
                lyncHostList.ForEach(e => e.StopProcess());

                LogHelper.Log("Dispose");
                lyncHostList.ForEach(e => e.Dispose());
            }

            Assert.IsTrue(hasFabricExited);
        }
Example #3
0
 public static void Initialize(TestContext context)
 {
     Lync_ActivationDeactivationTest.deployment = LyncScenarioTestHelper.CreateDeployment("Lync_ActivationDeactivation");
 }