Skip to content

Commit f8a3ead

Browse files
mykolafjleveque
authored andcommitted
[intfstat] fix variable name (sonic-net#466)
1 parent 84aafb6 commit f8a3ead

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scripts/intfstat

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def main():
338338
print "The rates are calculated within %s seconds period" % wait_time_in_seconds
339339
cnstat_new_dict = intfstat.get_cnstat(rif=interface_name)
340340
if interface_name:
341-
intfstat.cnstat_single_interface(interface_name, cnstat_dict, cnstat_cached_dict)
341+
intfstat.cnstat_single_interface(interface_name, cnstat_new_dict, cnstat_dict)
342342
else:
343343
intfstat.cnstat_diff_print(cnstat_new_dict, cnstat_dict, use_json)
344344

sonic-utilities-tests/intfstat_test.py

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def test_period(self):
4747
print(result.output)
4848
assert result.output.split('\n')[0] == "The rates are calculated within 3 seconds period"
4949

50+
def test_period_single_interface(self):
51+
runner = CliRunner()
52+
result = runner.invoke(show.cli.commands["interfaces"].commands["counters"].commands["rif"], ["Ethernet20", "-p3"])
53+
print(result.output)
54+
assert result.output.split('\n')[0] == "The rates are calculated within 3 seconds period"
55+
5056
def test_single_intfs(self):
5157
runner = CliRunner()
5258
result = runner.invoke(show.cli.commands["interfaces"].commands["counters"].commands["rif"], ["Ethernet20"])

0 commit comments

Comments
 (0)