Skip to content

Commit 32c5c89

Browse files
author
Taras Keryk
committed
Merge branch 'tk_tof3_prof_nam_bf' of github.com:tkerykx/sonic-utilities into tk_tof3_prof_nam_bf
2 parents 00bdadb + 8fa6adc commit 32c5c89

File tree

3 files changed

+16
-320
lines changed

3 files changed

+16
-320
lines changed

config/plugins/barefoot.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def profile(profile):
2828

2929
# Get chip family
3030
hwsku_dir = device_info.get_path_to_hwsku_dir()
31+
chip_family = ""
3132
with open(hwsku_dir + '/switch-tna-sai.conf') as file:
3233
chip_family = json.load(file)['chip_list'][0]['chip_family'].lower()
3334

tests/config_barefoot_test.py

+15
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ def test_profile(self):
3333
print("result.exit_code:", result.exit_code)
3434
print("result.output:", result.output)
3535
assert result.output == expected_output
36+
37+
runner = CliRunner()
38+
expected_output = "Swss service will be restarted, continue? [y/N]: \nAborted!\n"
39+
result = runner.invoke(bf.barefoot.commands['profile'], ['x1'])
40+
print("result.exit_code:", result.exit_code)
41+
print("result.output:", result.output)
42+
assert result.output == expected_output
43+
44+
runner = CliRunner()
45+
expected_output = "Swss service will be restarted, continue? [y/N]: \nAborted!\n"
46+
result = runner.invoke(bf.barefoot.commands['profile'], ['y2'])
47+
print("result.exit_code:", result.exit_code)
48+
print("result.output:", result.output)
49+
assert result.output == expected_output
50+
3651
#mock_run_command.assert_called_with('show platform barefoot profile', display_cmd=False)
3752

3853
def test_register(self):

tests/conftest.py-orig

-320
This file was deleted.

0 commit comments

Comments
 (0)