Get net-test to work once.

This commit is contained in:
Tim Young 2017-08-16 11:05:24 -05:00
parent 00f886080f
commit ce37f24dbd

View File

@ -1798,9 +1798,50 @@ namespace EduNetworkBuilder
NonVisualProcessPacketsOnce(); //loop until we "timeout" or all packets are done.
DumpInvisibleNetMessages();
foreach (NetTest NT in NetTests)
{
IPAddress destination;
NetworkDevice src = null;
//Here we do any pings or actions
switch (NT.TheTest)
{
case NetTestType.FailedPing:
case NetTestType.SuccessfullyPings:
case NetTestType.SuccessfullyPingsAgain:
//We need to generate a ping request
src = GetDeviceFromName(NT.sHost);
if (src == null) continue;
destination = DNSLookup(src, NT.dHost);
if (destination == null || destination.GetIPString == NB.ZeroIPString)
destination = new IPAddress(NT.dHost);
src.PingFromHere(destination);
break;
case NetTestType.SuccessfullyArps:
src = GetDeviceFromName(NT.sHost);
if (src == null) continue;
destination = DNSLookup(src, NT.dHost);
if (destination == null || destination.GetIPString == NB.ZeroIPString)
destination = new IPAddress(NT.dHost);
src.AskArpFromHere(destination);
break;
case NetTestType.SuccessfullyTraceroutes:
src = GetDeviceFromName(NT.sHost);
if (src == null) continue;
destination = DNSLookup(src, NT.dHost);
if (destination == null || destination.GetIPString == NB.ZeroIPString)
destination = new IPAddress(NT.dHost);
src.TracerouteFromHere(destination);
break;
}
NonVisualProcessPacketsOnce(); //loop until we "timeout" or all packets are done.
DumpInvisibleNetMessages();
}
foreach (NetTest NT in NetTests)
{
//Here we test it.
bool WasComplete = NT.TestComplete(this);
Console.WriteLine(NT.GetDescription(NetTestVerbosity.full) + " done: " + WasComplete.ToString());
}
NB.UnregisterInvisibleNetwork();