| | 78 | # Test the parse_stp_root_bridge_address function. |
|---|
| | 79 | |
|---|
| | 80 | def test_parse_stp_root_bridge_address |
|---|
| | 81 | |
|---|
| | 82 | root_bridge = "80001234567890AB" |
|---|
| | 83 | |
|---|
| | 84 | root_bridge_components = parse_stp_root_bridge_address(root_bridge) |
|---|
| | 85 | |
|---|
| | 86 | assert(root_bridge_components[1] == "8000", "Root bridge priority for #{root_bridge} should be 8000") |
|---|
| | 87 | assert(root_bridge_components[2] == "1234567890AB", "Root bridge address for #{root_bridge} should be 1234567890AB") |
|---|
| | 88 | |
|---|
| | 89 | end |
|---|
| | 90 | |
|---|
| | 91 | |
|---|
| | 92 | # Test the validate_stp_root_bridge_address function. |
|---|
| | 93 | |
|---|
| | 94 | def test_validate_stp_root_bridge_address |
|---|
| | 95 | |
|---|
| | 96 | assert(validate_stp_root_bridge_address('80001234567890AB') == :true, "Root bridge 80001234567890 should be valid") |
|---|
| | 97 | assert(validate_stp_root_bridge_address('0000000000000000') == :true, "Root bridge 00000000000000 should be valid") |
|---|
| | 98 | assert(validate_stp_root_bridge_address('000000000000000') == :false, "Root bridge 000000000000000 should not be valid") |
|---|
| | 99 | assert(validate_stp_root_bridge_address('00000000000000000') == :false, "Root bridge 00000000000000000 should not be valid") |
|---|
| | 100 | assert(validate_stp_root_bridge_address('0') == :false, "Root bridge 0 should not be valid") |
|---|
| | 101 | |
|---|
| | 102 | end |
|---|
| | 103 | |
|---|
| | 104 | |
|---|