Add a test to show the broken item
This commit is contained in:
parent
eddfb773c0
commit
ea3f2adb65
@ -1953,6 +1953,19 @@ namespace EduNetworkBuilder
|
|||||||
return didit;
|
return didit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AlreadyHasPingTest(string source, string dest)
|
||||||
|
{
|
||||||
|
foreach (NetTest NT in NetTests)
|
||||||
|
{
|
||||||
|
if (NT.TheTest == NetTestType.SuccessfullyPings)
|
||||||
|
{
|
||||||
|
if (NT.sHost == source && NT.dHost == dest) return true;
|
||||||
|
if (NT.sHost == dest && NT.dHost == source) return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int BreakNetworkPath(TraversalClass ThePath, HowToBreak How)
|
int BreakNetworkPath(TraversalClass ThePath, HowToBreak How)
|
||||||
{
|
{
|
||||||
//find the device name it belongs to
|
//find the device name it belongs to
|
||||||
@ -1971,7 +1984,16 @@ namespace EduNetworkBuilder
|
|||||||
if(NC != null)
|
if(NC != null)
|
||||||
{
|
{
|
||||||
int answer = BreakNetComponent(NC, How);
|
int answer = BreakNetComponent(NC, How);
|
||||||
if (answer>0) return answer;
|
if (answer > 0)
|
||||||
|
{
|
||||||
|
if(!AlreadyHasPingTest(ThePath.Source(), ThePath.Destination()))
|
||||||
|
{
|
||||||
|
//Add a test to show this is broken.
|
||||||
|
NetTest NT = new NetTest(ThePath.Source(), ThePath.Destination(), NetTestType.SuccessfullyPings);
|
||||||
|
NetTests.Add(NT);
|
||||||
|
}
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
|
Loading…
Reference in New Issue
Block a user