Skip to content

Commit

Permalink
[watermarkstat] Add unit tests for watermarkstat show commands (sonic…
Browse files Browse the repository at this point in the history
…-net#1157)

* Add watermark testcases and mock counters

Signed-off-by: Neetha John <nejo@microsoft.com>
  • Loading branch information
neethajohn authored Oct 14, 2020
1 parent 059cdca commit a733df5
Show file tree
Hide file tree
Showing 6 changed files with 942 additions and 15 deletions.
14 changes: 13 additions & 1 deletion scripts/watermarkstat
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/python

#####################################################################
#
Expand All @@ -10,12 +10,24 @@ from __future__ import print_function

import argparse
import json
import os
import sys

import swsssdk
from natsort import natsorted
from tabulate import tabulate

# mock the redis for unit test purposes #
try:
if os.environ["UTILITIES_UNIT_TESTING"] == "2":
modules_path = os.path.join(os.path.dirname(__file__), "..")
tests_path = os.path.join(modules_path, "tests")
sys.path.insert(0, modules_path)
sys.path.insert(0, tests_path)
import mock_tables.dbconnector

except KeyError:
pass

headerBufferPool = ['Pool', 'Bytes']

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
'mock_tables/asic0/*.json',
'mock_tables/asic1/*.json',
'filter_fdb_input/*',
'pfcwd_input/*']
'pfcwd_input/*',
'wm_input/*']
},
scripts=[
'scripts/aclshow',
Expand Down
Loading

0 comments on commit a733df5

Please sign in to comment.