X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Ftools%2FCSIT_Test%2Fbase%2Fmodules%2Fstatistics_manager.py;fp=test%2Ftools%2FCSIT_Test%2Fbase%2Fmodules%2Fstatistics_manager.py;h=0f40cc95263b0d919f315eab05e9d954e31bde91;hb=6c1ab4af219da530d0fc7f273d30d9790c1b587c;hp=0000000000000000000000000000000000000000;hpb=87856619cc37358990784130207c542f23870b68;p=integration%2Ftest.git diff --git a/test/tools/CSIT_Test/base/modules/statistics_manager.py b/test/tools/CSIT_Test/base/modules/statistics_manager.py new file mode 100644 index 0000000000..0f40cc9526 --- /dev/null +++ b/test/tools/CSIT_Test/base/modules/statistics_manager.py @@ -0,0 +1,45 @@ +""" +CSIT test tools. +Authors: Baohua Yang@IBM, Denghui Huang@IBM +Updated: 2013-11-01 +""" + +import sys + +sys.path.append('..') +from restlib import * +from testmodule import TestModule + +sys.path.remove('..') + + +class StatisticsManager(TestModule): + """ + Test for the statistics manager. + Start 2-layer tree topology network. e.g., in Mininet, run 'sudo mn --controller=remote,ip=127.0.0.1 --mac --topo tree,2' + """ + + def __init__(self, restSubContext='/controller/nb/v2/statistics', user=DEFAULT_USER, password=DEFAULT_PWD, + container=DEFAULT_CONTAINER, contentType='json', prefix=DEFAULT_PREFIX): + super(self.__class__, self).__init__(restSubContext, user, password, container, contentType, prefix) + + def get_flow_stats(self): + """ + The name is suggested to match the NB API. + Show the flow statistics + """ + return super(self.__class__, self).get_entries('flow') + + def get_port_stats(self): + """ + The name is suggested to match the NB API. + Show the port statistics + """ + return super(self.__class__, self).get_entries('port') + + def get_table_stats(self): + """ + The name is suggested to match the NB API. + Show the table statistics + """ + return super(self.__class__, self).get_entries('table')