Skip to content

Commit

Permalink
[db_migrator] Set correct CURRENT_VERSION, extend UT (#2895)
Browse files Browse the repository at this point in the history
Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>

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.
  • Loading branch information
vadymhlushko-mlnx authored Jul 6, 2023
1 parent 6b8ee47 commit 61bad06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, namespace, socket=None):
none-zero values.
build: sequentially increase within a minor version domain.
"""
self.CURRENT_VERSION = 'version_4_0_2'
self.CURRENT_VERSION = 'version_4_0_3'

self.TABLE_NAME = 'VERSIONS'
self.TABLE_KEY = 'DATABASE'
Expand Down
3 changes: 2 additions & 1 deletion tests/db_migrator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,4 +674,5 @@ def test_fast_reboot_upgrade_to_4_0_3(self):
dbmgtr = db_migrator.DBMigrator(None)
dbmgtr.migrate()
expected_db = self.mock_dedicated_config_db(db_after_migrate)
assert not self.check_config_db(dbmgtr.configDB, expected_db.cfgdb)
assert not self.check_config_db(dbmgtr.configDB, expected_db.cfgdb)
assert dbmgtr.CURRENT_VERSION == expected_db.cfgdb.get_entry('VERSIONS', 'DATABASE')['VERSION']

0 comments on commit 61bad06

Please sign in to comment.