Merge branch 'develop' into coretk-enhance/scaling

This commit is contained in:
Huy Pham 2020-02-20 10:03:19 -08:00
commit 83842fe9be
5 changed files with 77 additions and 21 deletions

View file

@ -74,6 +74,9 @@ bootfrr()
fi
bootdaemon "zebra"
if grep -q "^ip route " $FRR_CONF; then
bootdaemon "staticd"
fi
for r in rip ripng ospf6 ospf bgp babel; do
if grep -q "^router \\<$${}{r}\\>" $FRR_CONF; then
bootdaemon "$${}{r}d"
@ -93,3 +96,10 @@ if [ "$1" != "zebra" ]; then
fi
confcheck
bootfrr
# reset interfaces
% for ifc, _, _ , _ in interfaces:
ip link set dev ${ifc.name} down
sleep 1
ip link set dev ${ifc.name} up
% endfor

View file

@ -291,10 +291,7 @@ class BasicRangeModel(WirelessModel):
label="transmission delay (usec)",
),
Configuration(
_id="error",
_type=ConfigDataTypes.STRING,
default="0",
label="error rate (%)",
_id="error", _type=ConfigDataTypes.STRING, default="0", label="loss (%)"
),
]
@ -573,10 +570,10 @@ class WayPoint:
return not self == other
def __lt__(self, other: "WayPoint") -> bool:
result = self.time < other.time
if result:
result = self.nodenum < other.nodenum
return result
if self.time == other.time:
return self.nodenum < other.nodenum
else:
return self.time < other.time
class WayPointMobility(WirelessModel):

View file

@ -0,0 +1,17 @@
import pytest
from core.location.mobility import WayPoint
class TestMobility:
@pytest.mark.parametrize(
"wp1, wp2, expected",
[
(WayPoint(10.0, 1, [0, 0], 1.0), WayPoint(1.0, 2, [0, 0], 1.0), False),
(WayPoint(1.0, 1, [0, 0], 1.0), WayPoint(10.0, 2, [0, 0], 1.0), True),
(WayPoint(1.0, 1, [0, 0], 1.0), WayPoint(1.0, 2, [0, 0], 1.0), True),
(WayPoint(1.0, 2, [0, 0], 1.0), WayPoint(1.0, 1, [0, 0], 1.0), False),
],
)
def test_waypoint_lessthan(self, wp1, wp2, expected):
assert (wp1 < wp2) == expected