Skip to content

Commit acaa9c6

Browse files
authored
tests: fix vlan parsing test when state=suspended (#845)
Signed-off-by: Claudio Lorina <[email protected]> Signed-off-by: Claudio Lorina <[email protected]>
1 parent 312a01d commit acaa9c6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/integration/test_parsing_vlan.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ def validate_vlan_tbl(df: pd.DataFrame):
1010
'''Validate the VLAN table for all values'''
1111

1212
assert (df.vlan != 0).all()
13-
if not (df.query('vlan != 1').interfaces.str.len() != 0).all():
13+
if not (df.query('vlan != 1 or state != "suspended"').interfaces.str.len()
14+
!= 0).all():
1415
warnings.warn('Some VLANs not assigned to any interface')
15-
assert (df.state.isin(['active', 'unsupported'])).all()
16+
assert (df.state.isin(['active', 'unsupported', 'suspended'])).all()
1617
assert (df.vlanName != '').all()
1718

1819

@@ -27,7 +28,8 @@ def validate_interfaces(df: pd.DataFrame, datadir: str):
2728
'''
2829

2930
# Create a new df of namespace/hostname/vrf to oif mapping
30-
only_oifs = df[['namespace', 'hostname', 'vlan', 'interfaces']] \
31+
only_oifs = df[df.state != 'suspended'][
32+
['namespace', 'hostname', 'vlan', 'interfaces']] \
3133
.explode('interfaces') \
3234
.dropna() \
3335
.query('interfaces != ""') \

0 commit comments

Comments
 (0)