Skip to content

Commit 61bad06

Browse files
[db_migrator] Set correct CURRENT_VERSION, extend UT (sonic-net#2895)
Signed-off-by: vadymhlushko-mlnx <[email protected]> What I did Set the correct value for the db_migrator class variable CURRENT_VERSION, because if the new DB version was introduced the CURRENT_VERSION variable should have the newest version value. How I did it Edit the db_migrator.py. How to verify it Extend existing UT.
1 parent 6b8ee47 commit 61bad06

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

scripts/db_migrator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, namespace, socket=None):
4747
none-zero values.
4848
build: sequentially increase within a minor version domain.
4949
"""
50-
self.CURRENT_VERSION = 'version_4_0_2'
50+
self.CURRENT_VERSION = 'version_4_0_3'
5151

5252
self.TABLE_NAME = 'VERSIONS'
5353
self.TABLE_KEY = 'DATABASE'

tests/db_migrator_test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -674,4 +674,5 @@ def test_fast_reboot_upgrade_to_4_0_3(self):
674674
dbmgtr = db_migrator.DBMigrator(None)
675675
dbmgtr.migrate()
676676
expected_db = self.mock_dedicated_config_db(db_after_migrate)
677-
assert not self.check_config_db(dbmgtr.configDB, expected_db.cfgdb)
677+
assert not self.check_config_db(dbmgtr.configDB, expected_db.cfgdb)
678+
assert dbmgtr.CURRENT_VERSION == expected_db.cfgdb.get_entry('VERSIONS', 'DATABASE')['VERSION']

0 commit comments

Comments
 (0)