Get net-test to work once.
This commit is contained in:
parent
00f886080f
commit
ce37f24dbd
@ -1800,7 +1800,48 @@ namespace EduNetworkBuilder
|
|||||||
|
|
||||||
foreach (NetTest NT in NetTests)
|
foreach (NetTest NT in NetTests)
|
||||||
{
|
{
|
||||||
//Here we test it.
|
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();
|
NB.UnregisterInvisibleNetwork();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user