示例#1
0
        private void StartTest(TestStatus test)
        {
            ProcessStatus ps = test as ProcessStatus;

            if (ps != null)
            {
                StartProcess(ps, true);
                return;
            }
            DnsResolveStatus rs = test as DnsResolveStatus;

            if (rs != null)
            {
                StartDnsResolve(rs);
                return;
            }
            MultiProcessStatus mps = test as MultiProcessStatus;

            if (mps != null)
            {
                StartMultiPorcess(mps);
                return;
            }
            Debug.Assert(false);
        }
示例#2
0
 private void StartMultiPorcess(MultiProcessStatus mps)
 {
     foreach (var ps in mps.Processes)
     {
         StartProcess(ps, false);
     }
     mps.ProgressIndicator.Start();
 }
示例#3
0
        private void RunAllTests()
        {
            CleanupAfterPreviousTests();
            string hostname = textBoxDomain.Text;

            Tests = new List <TestStatus>();
            Tests.Add(new DnsResolveStatus("myip.opendns.com"));
            // a weak test for a valid hostname
            if (hostname.Contains("."))
            {
                Uri host;
                if (Uri.TryCreate(hostname, UriKind.Absolute, out host))
                {
                    hostname = host.DnsSafeHost;
                }
                Tests.Add(new ProcessStatus("tracert", hostname));
            }

            Tests.Add(new ProcessStatus("tracert", "208.67.222.222"));
            Tests.Add(new ProcessStatus("tracert", "208.67.220.220"));
            Tests.Add(new ProcessStatus("nslookup", "-type=txt debug.opendns.com. 208.67.222.222"));
            Tests.Add(new ProcessStatus("nslookup", "-type=txt -port=5353 debug.opendns.com. 208.67.222.222"));
            Tests.Add(new ProcessStatus("nslookup", "-type=txt debug.opendns.com"));
            Tests.Add(new ProcessStatus("nslookup", "-class=chaos -type=txt hostname.bind. 4.2.2.1"));
            Tests.Add(new ProcessStatus("nslookup", "-class=chaos -type=txt hostname.bind. 192.33.4.12"));
            Tests.Add(new ProcessStatus("nslookup", "-class=chaos -type=txt hostname.bind. 204.61.216.4"));
            Tests.Add(new ProcessStatus("nslookup", "whoami.ultradns.net udns1.ultradns.net"));
            var mps = new MultiProcessStatus("pings");

            Tests.Add(mps);
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.219.99", "(www.opendns.com)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.219.1", "(palo alto router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.216.1", "(seattle router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.69.36.1", "(chicago router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.217.1", "(new york router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.69.32.1", "(ashburn router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.69.34.1", "(london router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 209.244.5.114", "(level3 west coast)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 209.244.7.33", "(level3 east coast)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 192.153.156.3", "(att west coast)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 207.252.96.3", "(att east coast)"));
            Tests.Add(new ProcessStatus("ipconfig", "/all"));
            Tests.Add(new ProcessStatus("systeminfo", null, true));
            Tests.Add(new ProcessStatus("tasklist", null));
            LayoutProcessesInfo();
            foreach (var test in Tests)
            {
                StartTest(test);
            }

            UiDisable();
        }
示例#4
0
        public void process_Exited(object sender, System.EventArgs e)
        {
            if (this.InvokeRequired)
            {
                var myDelegate = new process_ExitedDelegate(process_Exited);
                this.BeginInvoke(myDelegate, new object[] { sender, e });
                return;
            }

            var proc = sender as Process;

            Debug.Assert(proc != null);
            foreach (var test in Tests)
            {
                MultiProcessStatus mps = test as MultiProcessStatus;
                if (mps != null)
                {
                    foreach (var tmp in mps.Processes)
                    {
                        if (tmp.Process == proc)
                        {
                            tmp.Stop();
                            if (mps.AllFinished())
                            {
                                mps.Stop();
                            }
                        }
                    }
                    continue;
                }
                ProcessStatus ps = test as ProcessStatus;
                if (null == ps)
                {
                    continue;
                }
                if (proc != ps.Process)
                {
                    continue;
                }
                ps.Stop();
            }

            NotifyUiTestFinished();
        }
示例#5
0
 private void StartMultiPorcess(MultiProcessStatus mps)
 {
     foreach (var ps in mps.Processes)
         StartProcess(ps, false);
     mps.ProgressIndicator.Start();
 }
示例#6
0
        private void RunAllTests()
        {
            CleanupAfterPreviousTests();
            string hostname = textBoxDomain.Text;
            Tests = new List<TestStatus>();
            Tests.Add(new DnsResolveStatus("myip.opendns.com"));
            // a weak test for a valid hostname
            if (hostname.Contains("."))
            {
                Uri host;
                if (Uri.TryCreate(hostname, UriKind.Absolute, out host))
                    hostname = host.DnsSafeHost;
                Tests.Add(new ProcessStatus("tracert", hostname));

            }

            Tests.Add(new ProcessStatus("tracert", "208.67.222.222"));
            Tests.Add(new ProcessStatus("tracert", "208.67.220.220"));
            Tests.Add(new ProcessStatus("nslookup", "-type=txt debug.opendns.com. 208.67.222.222"));
            Tests.Add(new ProcessStatus("nslookup", "-type=txt -port=5353 debug.opendns.com. 208.67.222.222"));
            Tests.Add(new ProcessStatus("nslookup", "-type=txt debug.opendns.com"));
            Tests.Add(new ProcessStatus("nslookup", "-class=chaos -type=txt hostname.bind. 4.2.2.1"));
            Tests.Add(new ProcessStatus("nslookup", "-class=chaos -type=txt hostname.bind. 192.33.4.12"));
            Tests.Add(new ProcessStatus("nslookup", "-class=chaos -type=txt hostname.bind. 204.61.216.4"));
            Tests.Add(new ProcessStatus("nslookup", "whoami.ultradns.net udns1.ultradns.net"));
            var mps = new MultiProcessStatus("pings");
            Tests.Add(mps);
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.219.99", "(www.opendns.com)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.219.1", "(palo alto router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.216.1", "(seattle router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.69.36.1", "(chicago router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.67.217.1", "(new york router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.69.32.1", "(ashburn router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 208.69.34.1", "(london router)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 209.244.5.114", "(level3 west coast)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 209.244.7.33", "(level3 east coast)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 192.153.156.3", "(att west coast)"));
            mps.Processes.Add(new ProcessStatus("ping", "-n 5 207.252.96.3", "(att east coast)"));
            Tests.Add(new ProcessStatus("ipconfig", "/all"));
            Tests.Add(new ProcessStatus("systeminfo", null, true));
            Tests.Add(new ProcessStatus("tasklist", null));
            LayoutProcessesInfo();
            foreach (var test in Tests)
                StartTest(test);

            UiDisable();
        }