Skip to content

Commit

Permalink
[intfstat] fix variable name (sonic-net#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykolaf authored and jleveque committed Feb 27, 2019
1 parent 84aafb6 commit f8a3ead
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/intfstat
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def main():
print "The rates are calculated within %s seconds period" % wait_time_in_seconds
cnstat_new_dict = intfstat.get_cnstat(rif=interface_name)
if interface_name:
intfstat.cnstat_single_interface(interface_name, cnstat_dict, cnstat_cached_dict)
intfstat.cnstat_single_interface(interface_name, cnstat_new_dict, cnstat_dict)
else:
intfstat.cnstat_diff_print(cnstat_new_dict, cnstat_dict, use_json)

Expand Down
6 changes: 6 additions & 0 deletions sonic-utilities-tests/intfstat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def test_period(self):
print(result.output)
assert result.output.split('\n')[0] == "The rates are calculated within 3 seconds period"

def test_period_single_interface(self):
runner = CliRunner()
result = runner.invoke(show.cli.commands["interfaces"].commands["counters"].commands["rif"], ["Ethernet20", "-p3"])
print(result.output)
assert result.output.split('\n')[0] == "The rates are calculated within 3 seconds period"

def test_single_intfs(self):
runner = CliRunner()
result = runner.invoke(show.cli.commands["interfaces"].commands["counters"].commands["rif"], ["Ethernet20"])
Expand Down

0 comments on commit f8a3ead

Please sign in to comment.