Skip to content

Commit

Permalink
tests: check if vlan ID = 0 if vlan is deactivated
Browse files Browse the repository at this point in the history
Signed-off-by: canteuni <21243338+canteuni@users.noreply.github.com>
  • Loading branch information
canteuni authored and hthiery committed Oct 20, 2023
1 parent c3e58a1 commit 925e09d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_lan.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def test_datatovlan():
assert data_to_vlan(array('B', [19, 128])) == 19


def test_datatovlan_deactivated():
# Check if the data_to_vlan method returns 0 when a vlan data contains
# non-null vlan ID but the "vlan activate" bit is set to 0
assert data_to_vlan(array('B', [138, 1])) == 0


def test_vlantodata():
assert vlan_to_data(394).array == array('B', [138, 129])
assert vlan_to_data(0).array == array('B', [0, 0])
Expand Down

0 comments on commit 925e09d

Please sign in to comment.