Skip to content

Commit

Permalink
updated db_migrator tests for switchport mode with PORTCHANNEL input …
Browse files Browse the repository at this point in the history
…and expected output
  • Loading branch information
MuhammadUmarAsad committed Feb 23, 2023
1 parent 92f8a2c commit dd4828a
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
38 changes: 38 additions & 0 deletions tests/db_migrator_input/config_db/switchport-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,44 @@
"tagging_mode": "untagged"
}
},
"PORTCHANNEL": {
"PortChannel0001": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mode": "access",
"mtu": "9100"
},
"PortChannel0002": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mode": "trunk",
"mtu": "9100"
},
"PortChannel0003": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mode": "trunk",
"mtu": "9100"
},
"PortChannel0004": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mode": "routed",
"mtu": "9100"
}
},
"PORTCHANNEL_MEMBER": {
"PortChannel0001|Ethernet24": {},
"PortChannel0002|Ethernet28": {}
},
"VERSIONS|DATABASE": {
"VERSION": "version_4_0_1"
}
Expand Down
45 changes: 45 additions & 0 deletions tests/db_migrator_input/config_db/switchport-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,53 @@
},
"Vlan5|Ethernet8": {
"tagging_mode": "untagged"
},
"Vlan3|PortChannel0003": {
"tagging_mode": "untagged"
},
"Vlan8|PortChannel0002": {
"tagging_mode": "tagged"
},
"Vlan9|PortChannel0002": {
"tagging_mode": "tagged"
}
},
"PORTCHANNEL": {
"PortChannel0001": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mode": "access",
"mtu": "9100"
},
"PortChannel0002": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mode": "trunk",
"mtu": "9100"
},
"PortChannel0003": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mtu": "9100"
},
"PortChannel0004": {
"admin_status": "up",
"fast_rate": "false",
"lacp_key": "auto",
"min_links": "1",
"mtu": "9100"
}
},
"PORTCHANNEL_MEMBER": {
"PortChannel0001|Ethernet24": {},
"PortChannel0002|Ethernet28": {}
},
"VERSIONS|DATABASE": {
"VERSION": "version_4_0_1"
}
Expand Down
3 changes: 1 addition & 2 deletions tests/db_migrator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ def test_switchport_mode_migrator(self):
advance_version_for_expected_database(dbmgtr.configDB, expected_db.cfgdb, 'version_4_0_1')

assert dbmgtr.configDB.get_table('PORT') == expected_db.cfgdb.get_table('PORT')
assert dbmgtr.configDB.get_table('VLAN') == expected_db.cfgdb.get_table('VLAN')
assert dbmgtr.configDB.get_table('VLAN_MEMBER') == expected_db.cfgdb.get_table('VLAN_MEMBER')
assert dbmgtr.configDB.get_table('PORTCHANNEL') == expected_db.cfgdb.get_table('VLAN')
assert dbmgtr.configDB.get_table('VERSIONS') == expected_db.cfgdb.get_table('VERSIONS')

class TestInitConfigMigrator(object):
Expand Down

0 comments on commit dd4828a

Please sign in to comment.