From f9588ce15807e8bb101c75d8abb5c9d51ba22bf5 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Wed, 17 Aug 2022 08:08:56 +0000 Subject: [PATCH 01/12] start adding warm upgrate support for removin LOGLEVEL DB and moving it's content to CONFIG DB --- scripts/db_migrator.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index 04e0dbcb4b..453a2b6b09 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -44,7 +44,7 @@ def __init__(self, namespace, socket=None): none-zero values. build: sequentially increase within a minor version domain. """ - self.CURRENT_VERSION = 'version_3_0_5' + self.CURRENT_VERSION = 'version_3_0_6' self.TABLE_NAME = 'VERSIONS' self.TABLE_KEY = 'DATABASE' @@ -70,6 +70,11 @@ def __init__(self, namespace, socket=None): if self.stateDB is not None: self.stateDB.connect(self.stateDB.STATE_DB) + # todo check + self.loglevelDB = SonicV2Connector(host='127.0.0.1') + if self.loglevelDB is not None: + self.loglevelDB.connect(self.loglevelDB.LOGLEVEL_DB) + version_info = device_info.get_sonic_version_info() asic_type = version_info.get('asic_type') self.asic_type = asic_type @@ -717,9 +722,37 @@ def version_3_0_4(self): def version_3_0_5(self): """ - Current latest version. Nothing to do here. + Version 3_0_5 """ log.log_info('Handling version_3_0_5') + # Removing LOGLEVEL DB and moving it's content to CONFIG DB + # Removing Jinja2_cache + log.log_info('Handling version_3_0_5') + warmreboot_state = self.stateDB.get(self.stateDB.STATE_DB, 'WARM_RESTART_ENABLE_TABLE|system', 'enable') + table_name = "LOGGER" + loglevel_field = 'LOGLEVEL' + logoutput_field = 'LOGOUTPUT' + if warmreboot_state == 'true': + keys = self.loglevelDB.keys(self.loglevelDB.LOGLEVEL_DB, "*") + if keys is not None: + for key in keys: + if key != "JINJA2_CACHE": + component = key.split(":")[1] + loglevel = key[loglevel_field] + logoutput = key[logoutput_field] + self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) + self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) + self.loglevelDB.del(self.loglevelDB.LOGLEVEL_DB, key) + self.set_version('version_3_0_6') + return 'version_3_0_6' + + + def version_3_0_6(self): + """ + Current latest version. Nothing to do here. + """ + + log.log_info('Handling version_3_0_6') return None def get_version(self): From d16e29e5f83b84adff90ff19b3600008acb2eff8 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Sun, 21 Aug 2022 15:02:43 +0000 Subject: [PATCH 02/12] update --- scripts/db_migrator.py | 13 +++++++++++++ .../reclaiming-buffer-warmreboot-expected.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index 453a2b6b09..c17b9778a1 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -717,10 +717,17 @@ def version_3_0_4(self): if 'pfc_enable' in v: v['pfcwd_sw_enable'] = v['pfc_enable'] self.configDB.set_entry('PORT_QOS_MAP', k, v) +<<<<<<< HEAD self.set_version('version_3_0_5') return 'version_3_0_5' def version_3_0_5(self): +======= + self.set_version('version_2_0_5') + return 'version_2_0_5' + + def version_2_0_5(self): +>>>>>>> update """ Version 3_0_5 """ @@ -742,9 +749,15 @@ def version_3_0_5(self): logoutput = key[logoutput_field] self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) +<<<<<<< HEAD self.loglevelDB.del(self.loglevelDB.LOGLEVEL_DB, key) self.set_version('version_3_0_6') return 'version_3_0_6' +======= + self.loglevelDB.del_table(self.loglevelDB.LOGLEVEL_DB, key) + self.set_version('version_2_0_6') + return 'version_2_0_6' +>>>>>>> update def version_3_0_6(self): diff --git a/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json b/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json index ccedec4d9d..6425fa4e09 100644 --- a/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json +++ b/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json @@ -2043,6 +2043,6 @@ "admin_status": "up" }, "VERSIONS|DATABASE": { - "VERSION": "version_3_0_5" + "VERSION": "version_3_0_6" } } From cfa5c7d2598113487c8417dd8ce33c7b03a631e7 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Mon, 22 Aug 2022 10:38:01 +0000 Subject: [PATCH 03/12] fix conflict --- scripts/db_migrator.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index c17b9778a1..453a2b6b09 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -717,17 +717,10 @@ def version_3_0_4(self): if 'pfc_enable' in v: v['pfcwd_sw_enable'] = v['pfc_enable'] self.configDB.set_entry('PORT_QOS_MAP', k, v) -<<<<<<< HEAD self.set_version('version_3_0_5') return 'version_3_0_5' def version_3_0_5(self): -======= - self.set_version('version_2_0_5') - return 'version_2_0_5' - - def version_2_0_5(self): ->>>>>>> update """ Version 3_0_5 """ @@ -749,15 +742,9 @@ def version_2_0_5(self): logoutput = key[logoutput_field] self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) -<<<<<<< HEAD self.loglevelDB.del(self.loglevelDB.LOGLEVEL_DB, key) self.set_version('version_3_0_6') return 'version_3_0_6' -======= - self.loglevelDB.del_table(self.loglevelDB.LOGLEVEL_DB, key) - self.set_version('version_2_0_6') - return 'version_2_0_6' ->>>>>>> update def version_3_0_6(self): From 0a7ba3e66c676faae5d370fe313eecf992853467 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Tue, 23 Aug 2022 16:58:54 +0000 Subject: [PATCH 04/12] bug fix: change del function name to del_table --- scripts/db_migrator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index 453a2b6b09..b29a1f0ad6 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -742,7 +742,7 @@ def version_3_0_5(self): logoutput = key[logoutput_field] self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) - self.loglevelDB.del(self.loglevelDB.LOGLEVEL_DB, key) + self.loglevelDB.del_table(self.loglevelDB.LOGLEVEL_DB, key) self.set_version('version_3_0_6') return 'version_3_0_6' From d7da6e10a73f40be50c1b14d56bb9ee6f4d34c9d Mon Sep 17 00:00:00 2001 From: EdenGri Date: Thu, 8 Sep 2022 14:02:11 +0000 Subject: [PATCH 05/12] bug fix: change the loglevel and logoutput, change delete function for LOGLEVEL DB --- scripts/db_migrator.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index b29a1f0ad6..4b0d6b9837 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -720,29 +720,38 @@ def version_3_0_4(self): self.set_version('version_3_0_5') return 'version_3_0_5' + + + + def version_3_0_5(self): """ Version 3_0_5 """ - log.log_info('Handling version_3_0_5') + log.log_notice('Handling version_3_0_5') # Removing LOGLEVEL DB and moving it's content to CONFIG DB # Removing Jinja2_cache - log.log_info('Handling version_3_0_5') warmreboot_state = self.stateDB.get(self.stateDB.STATE_DB, 'WARM_RESTART_ENABLE_TABLE|system', 'enable') - table_name = "LOGGER" - loglevel_field = 'LOGLEVEL' - logoutput_field = 'LOGOUTPUT' if warmreboot_state == 'true': + table_name = "LOGGER" + loglevel_field = "LOGLEVEL" + logoutput_field = "LOGOUTPUT" + log.log_notice('Warm reboot 3_0_5') keys = self.loglevelDB.keys(self.loglevelDB.LOGLEVEL_DB, "*") if keys is not None: for key in keys: - if key != "JINJA2_CACHE": - component = key.split(":")[1] - loglevel = key[loglevel_field] - logoutput = key[logoutput_field] - self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) - self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) - self.loglevelDB.del_table(self.loglevelDB.LOGLEVEL_DB, key) + log.log_notice('Migrating key: ' + key) + if key == "JINJA2_CACHE": + continue + fvs = self.loglevelDB.get_all(self.loglevelDB.LOGLEVEL_DB, key) + component = key.split(":")[1] + loglevel = fvs[loglevel_field] + logoutput = fvs[logoutput_field] + log.log_notice("Setting loglevel: " + loglevel + " output: " + logoutput) + self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) + self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) + log.log_notice("Deleting key: " +key) + self.loglevelDB.delete(self.loglevelDB.LOGLEVEL_DB, key) ## todo: move outside the if to remove all keys. self.set_version('version_3_0_6') return 'version_3_0_6' From 7949a3747ab345717c6e1cd97030a3baa0986d52 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Sun, 11 Sep 2022 15:07:10 +0000 Subject: [PATCH 06/12] remove debug prints --- scripts/db_migrator.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index 4b0d6b9837..bd2e522097 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -728,7 +728,7 @@ def version_3_0_5(self): """ Version 3_0_5 """ - log.log_notice('Handling version_3_0_5') + log.log_info('Handling version_3_0_5') # Removing LOGLEVEL DB and moving it's content to CONFIG DB # Removing Jinja2_cache warmreboot_state = self.stateDB.get(self.stateDB.STATE_DB, 'WARM_RESTART_ENABLE_TABLE|system', 'enable') @@ -736,21 +736,17 @@ def version_3_0_5(self): table_name = "LOGGER" loglevel_field = "LOGLEVEL" logoutput_field = "LOGOUTPUT" - log.log_notice('Warm reboot 3_0_5') keys = self.loglevelDB.keys(self.loglevelDB.LOGLEVEL_DB, "*") if keys is not None: for key in keys: - log.log_notice('Migrating key: ' + key) if key == "JINJA2_CACHE": continue fvs = self.loglevelDB.get_all(self.loglevelDB.LOGLEVEL_DB, key) component = key.split(":")[1] loglevel = fvs[loglevel_field] logoutput = fvs[logoutput_field] - log.log_notice("Setting loglevel: " + loglevel + " output: " + logoutput) self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) - log.log_notice("Deleting key: " +key) self.loglevelDB.delete(self.loglevelDB.LOGLEVEL_DB, key) ## todo: move outside the if to remove all keys. self.set_version('version_3_0_6') return 'version_3_0_6' From 13a7b0e842e6cc3f518ad705512527336989645e Mon Sep 17 00:00:00 2001 From: EdenGri Date: Mon, 12 Sep 2022 07:39:58 +0000 Subject: [PATCH 07/12] remove todo --- scripts/db_migrator.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index bd2e522097..b68ba4ae79 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -70,7 +70,6 @@ def __init__(self, namespace, socket=None): if self.stateDB is not None: self.stateDB.connect(self.stateDB.STATE_DB) - # todo check self.loglevelDB = SonicV2Connector(host='127.0.0.1') if self.loglevelDB is not None: self.loglevelDB.connect(self.loglevelDB.LOGLEVEL_DB) @@ -739,15 +738,14 @@ def version_3_0_5(self): keys = self.loglevelDB.keys(self.loglevelDB.LOGLEVEL_DB, "*") if keys is not None: for key in keys: - if key == "JINJA2_CACHE": - continue - fvs = self.loglevelDB.get_all(self.loglevelDB.LOGLEVEL_DB, key) - component = key.split(":")[1] - loglevel = fvs[loglevel_field] - logoutput = fvs[logoutput_field] - self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) - self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) - self.loglevelDB.delete(self.loglevelDB.LOGLEVEL_DB, key) ## todo: move outside the if to remove all keys. + if key != "JINJA2_CACHE": + fvs = self.loglevelDB.get_all(self.loglevelDB.LOGLEVEL_DB, key) + component = key.split(":")[1] + loglevel = fvs[loglevel_field] + logoutput = fvs[logoutput_field] + self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) + self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) + self.loglevelDB.delete(self.loglevelDB.LOGLEVEL_DB, key) ## todo: When we will remove the Jinja2 chace, this line need to get outside from the if scope outside the if scope. self.set_version('version_3_0_6') return 'version_3_0_6' From ca00de56f98f8f38cc7d675b571a2a33b721a5eb Mon Sep 17 00:00:00 2001 From: EdenGri Date: Tue, 13 Sep 2022 10:55:34 +0000 Subject: [PATCH 08/12] fixes after code review --- scripts/db_migrator.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/db_migrator.py b/scripts/db_migrator.py index b68ba4ae79..2e3657b19c 100755 --- a/scripts/db_migrator.py +++ b/scripts/db_migrator.py @@ -719,10 +719,6 @@ def version_3_0_4(self): self.set_version('version_3_0_5') return 'version_3_0_5' - - - - def version_3_0_5(self): """ Version 3_0_5 @@ -745,11 +741,10 @@ def version_3_0_5(self): logoutput = fvs[logoutput_field] self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), loglevel_field, loglevel) self.configDB.set(self.configDB.CONFIG_DB, '{}|{}'.format(table_name, component), logoutput_field, logoutput) - self.loglevelDB.delete(self.loglevelDB.LOGLEVEL_DB, key) ## todo: When we will remove the Jinja2 chace, this line need to get outside from the if scope outside the if scope. + self.loglevelDB.delete(self.loglevelDB.LOGLEVEL_DB, key) self.set_version('version_3_0_6') return 'version_3_0_6' - def version_3_0_6(self): """ Current latest version. Nothing to do here. From 1563769822505448c4b9c0837038f6fa23f3fab2 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Wed, 12 Oct 2022 15:55:48 +0000 Subject: [PATCH 09/12] Add unit test for the db_migrator --- .../config_db/logger_tables_expected.json | 13 +++++++ .../config_db/logger_tables_input.json | 5 +++ .../loglevel_db/logger_tables_expected.json | 1 + .../loglevel_db/logger_tables_input.json | 11 ++++++ tests/db_migrator_test.py | 38 +++++++++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 tests/db_migrator_input/config_db/logger_tables_expected.json create mode 100644 tests/db_migrator_input/config_db/logger_tables_input.json create mode 100644 tests/db_migrator_input/loglevel_db/logger_tables_expected.json create mode 100644 tests/db_migrator_input/loglevel_db/logger_tables_input.json diff --git a/tests/db_migrator_input/config_db/logger_tables_expected.json b/tests/db_migrator_input/config_db/logger_tables_expected.json new file mode 100644 index 0000000000..80d5aab5d2 --- /dev/null +++ b/tests/db_migrator_input/config_db/logger_tables_expected.json @@ -0,0 +1,13 @@ +{ + "VERSIONS|DATABASE": { + "VERSION": "version_3_0_6" + }, + "LOGGER|orchagent": { + "LOGLEVEL": "INFO", + "LOGOUTPUT": "SYSLOG" + }, + "LOGGER|SAI_API_BUFFER": { + "LOGLEVEL": "SAI_LOG_LEVEL_NOTICE", + "LOGOUTPUT": "SYSLOG" + } +} \ No newline at end of file diff --git a/tests/db_migrator_input/config_db/logger_tables_input.json b/tests/db_migrator_input/config_db/logger_tables_input.json new file mode 100644 index 0000000000..6ee1d18f1f --- /dev/null +++ b/tests/db_migrator_input/config_db/logger_tables_input.json @@ -0,0 +1,5 @@ +{ + "VERSIONS|DATABASE": { + "VERSION": "version_3_0_5" + } +} diff --git a/tests/db_migrator_input/loglevel_db/logger_tables_expected.json b/tests/db_migrator_input/loglevel_db/logger_tables_expected.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/tests/db_migrator_input/loglevel_db/logger_tables_expected.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/db_migrator_input/loglevel_db/logger_tables_input.json b/tests/db_migrator_input/loglevel_db/logger_tables_input.json new file mode 100644 index 0000000000..02377ea0a4 --- /dev/null +++ b/tests/db_migrator_input/loglevel_db/logger_tables_input.json @@ -0,0 +1,11 @@ +{ + "orchagent:orchagent": { + "LOGLEVEL": "INFO", + "LOGOUTPUT": "SYSLOG" + }, + "SAI_API_BUFFER:SAI_API_BUFFER": { + "LOGLEVEL": "SAI_LOG_LEVEL_NOTICE", + "LOGOUTPUT": "SYSLOG" + }, + "JINJA2_CACHE": {} +} \ No newline at end of file diff --git a/tests/db_migrator_test.py b/tests/db_migrator_test.py index faa09c7ed2..6cc80addc2 100644 --- a/tests/db_migrator_test.py +++ b/tests/db_migrator_test.py @@ -409,4 +409,42 @@ def test_global_dscp_to_tc_map_migrator(self): dbmgtr_mlnx.migrate() resulting_table = dbmgtr_mlnx.configDB.get_table('PORT_QOS_MAP') assert resulting_table == {} + +class TestMoveLoggerTablesInWarmUpgrade(object): + @classmethod + def setup_class(cls): + os.environ['UTILITIES_UNIT_TESTING'] = "2" + + @classmethod + def teardown_class(cls): + os.environ['UTILITIES_UNIT_TESTING'] = "0" + dbconnector.dedicated_dbs['CONFIG_DB'] = None + dbconnector.dedicated_dbs['LOGLEVEL_DB'] = None + def mock_dedicated_loglevel_db(self, filename): + jsonfile = os.path.join(mock_db_path, 'loglevel_db', filename) + dbconnector.dedicated_dbs['LOGLEVEL_DB'] = jsonfile + loglevel_db = SonicV2Connector(host='127.0.0.1') + loglevel_db.connect(loglevel_db.LOGLEVEL_DB) + return loglevel_db + + def test_move_logger_tables_in_warm_upgrade(self): + dbconnector.dedicated_dbs['CONFIG_DB'] = os.path.join(mock_db_path, 'config_db', 'logger_tables_input') + dbconnector.dedicated_dbs['LOGLEVEL_DB'] = os.path.join(mock_db_path, 'loglevel_db', 'logger_tables_input') + import db_migrator + dbmgtr = db_migrator.DBMigrator(None) + dbmgtr.migrate() + dbconnector.dedicated_dbs['CONFIG_DB'] = os.path.join(mock_db_path, 'config_db', 'logger_tables_expected') + dbconnector.dedicated_dbs['LOGLEVEL_DB'] = os.path.join(mock_db_path, 'loglevel_db', 'logger_tables_expected') + + expected_db = Db() + + resulting_table = dbmgtr.configDB.get_table('LOGGER') + expected_table = expected_db.cfgdb.get_table('LOGGER') + + diff = DeepDiff(resulting_table, expected_table, ignore_order=True) + assert not diff + + + + From d77cd0f81e16c3350906f8db32b70c5c9e3f0b41 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Thu, 13 Oct 2022 12:43:55 +0000 Subject: [PATCH 10/12] add state db warm reboot enable flag --- tests/db_migrator_test.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/db_migrator_test.py b/tests/db_migrator_test.py index 6cc80addc2..4cf5383669 100644 --- a/tests/db_migrator_test.py +++ b/tests/db_migrator_test.py @@ -420,6 +420,8 @@ def teardown_class(cls): os.environ['UTILITIES_UNIT_TESTING'] = "0" dbconnector.dedicated_dbs['CONFIG_DB'] = None dbconnector.dedicated_dbs['LOGLEVEL_DB'] = None + dbconnector.dedicated_dbs['STATE_DB'] = None + def mock_dedicated_loglevel_db(self, filename): jsonfile = os.path.join(mock_db_path, 'loglevel_db', filename) dbconnector.dedicated_dbs['LOGLEVEL_DB'] = jsonfile @@ -428,11 +430,16 @@ def mock_dedicated_loglevel_db(self, filename): return loglevel_db def test_move_logger_tables_in_warm_upgrade(self): + device_info.get_sonic_version_info = get_sonic_version_info_mlnx + dbconnector.dedicated_dbs['CONFIG_DB'] = os.path.join(mock_db_path, 'config_db', 'logger_tables_input') dbconnector.dedicated_dbs['LOGLEVEL_DB'] = os.path.join(mock_db_path, 'loglevel_db', 'logger_tables_input') + dbconnector.dedicated_dbs['STATE_DB'] = os.path.join(mock_db_path, 'state_db') + import db_migrator dbmgtr = db_migrator.DBMigrator(None) dbmgtr.migrate() + dbconnector.dedicated_dbs['CONFIG_DB'] = os.path.join(mock_db_path, 'config_db', 'logger_tables_expected') dbconnector.dedicated_dbs['LOGLEVEL_DB'] = os.path.join(mock_db_path, 'loglevel_db', 'logger_tables_expected') @@ -443,8 +450,3 @@ def test_move_logger_tables_in_warm_upgrade(self): diff = DeepDiff(resulting_table, expected_table, ignore_order=True) assert not diff - - - - - From 4c3eae2748ebf34d00ac662f30e8c87842f79f69 Mon Sep 17 00:00:00 2001 From: EdenGri Date: Thu, 13 Oct 2022 12:46:19 +0000 Subject: [PATCH 11/12] remove unused file --- tests/db_migrator_input/loglevel_db/logger_tables_expected.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tests/db_migrator_input/loglevel_db/logger_tables_expected.json diff --git a/tests/db_migrator_input/loglevel_db/logger_tables_expected.json b/tests/db_migrator_input/loglevel_db/logger_tables_expected.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/tests/db_migrator_input/loglevel_db/logger_tables_expected.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file From 31fe28dd0759d02e6f3ca0ac6777e48e66b7839d Mon Sep 17 00:00:00 2001 From: EdenGri Date: Thu, 13 Oct 2022 12:51:37 +0000 Subject: [PATCH 12/12] bug fix: return the version to the original expected version --- .../config_db/reclaiming-buffer-warmreboot-expected.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json b/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json index 6425fa4e09..f38c426b18 100644 --- a/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json +++ b/tests/db_migrator_input/config_db/reclaiming-buffer-warmreboot-expected.json @@ -2043,6 +2043,6 @@ "admin_status": "up" }, "VERSIONS|DATABASE": { - "VERSION": "version_3_0_6" + "VERSION": "version_3_0_3" } }