[travis] test parent selection rules (#4423)

This commit has five scenarios to test the four Mesh Impacting
Criteria and one Child Impacting Criterion (version).
This commit is contained in:
Rongli Sun
2020-02-25 14:34:53 -08:00
committed by Jonathan Hui
parent 835d9e2505
commit b339a8946b
8 changed files with 448 additions and 46 deletions
+8
View File
@@ -34,6 +34,14 @@ from enum import IntEnum
import ipaddress
# Map of 2 bits of parent priority.
pp_map = {1: 1, 0: 0, 3: -1, 2: -2}
# Get the signed parent priority from the byte that parent priority is in.
def map_pp(self, pp_byte):
return pp_map[((pp_byte & 0xC0) >> 6)]
def expect_the_same_class(self, other):
if not isinstance(other, self.__class__):