Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update utilities without log #3655

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/main.py
Original file line number Diff line number Diff line change
@@ -1830,7 +1830,7 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, force, file_form
if multi_asic.is_multi_asic():
# Multiasic has not 100% fully validated. Thus pass here.
pass
else:
elif "golden" in filename.lower():
config_file_yang_validation(filename)

#Stop services before config push
6 changes: 4 additions & 2 deletions tests/config_test.py
Original file line number Diff line number Diff line change
@@ -1231,6 +1231,7 @@ def teardown_class(cls):

class TestReloadConfig(object):
dummy_cfg_file = os.path.join(os.sep, "tmp", "config.json")
dummy_golden_cfg_file = os.path.join(os.sep, "tmp", "golden_config.json")

@classmethod
def setup_class(cls):
@@ -1433,7 +1434,7 @@ def test_reload_yang_config(self, get_cmd_module,
== RELOAD_YANG_CFG_OUTPUT.format(config.SYSTEM_RELOAD_LOCK)

def test_reload_config_fails_yang_validation(self, get_cmd_module, setup_single_broadcom_asic):
with open(self.dummy_cfg_file, 'w') as f:
with open(self.dummy_golden_cfg_file, 'w') as f:
device_metadata = {
"DEVICE_METADATA": {
"localhost": {
@@ -1452,7 +1453,7 @@ def test_reload_config_fails_yang_validation(self, get_cmd_module, setup_single_

result = runner.invoke(
config.config.commands["reload"],
[self.dummy_cfg_file, '-y', '-f'])
[self.dummy_golden_cfg_file, '-y', '-f'])

print(result.exit_code)
print(result.output)
@@ -1464,6 +1465,7 @@ def test_reload_config_fails_yang_validation(self, get_cmd_module, setup_single_
def teardown_class(cls):
os.environ['UTILITIES_UNIT_TESTING'] = "0"
os.remove(cls.dummy_cfg_file)
os.remove(cls.dummy_golden_cfg_file)
print("TEARDOWN")