summaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/testcenter
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pkt_gen/testcenter')
-rw-r--r--tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py93
-rw-r--r--tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py127
-rw-r--r--tools/pkt_gen/testcenter/testcenter.py218
3 files changed, 311 insertions, 127 deletions
diff --git a/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py b/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py
index 8da8ed17..6c30b130 100644
--- a/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py
+++ b/tools/pkt_gen/testcenter/testcenter-rfc2544-rest.py
@@ -1,4 +1,4 @@
-# Copyright 2016 Spirent Communications.
+# Copyright 2016-2017 Spirent Communications.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -11,7 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+#
+# Invalid name of file, must be used '_' instead '-'
+# pylint: disable=invalid-name
'''
@author Spirent Communications
@@ -22,10 +24,9 @@ TestCenter REST APIs. This test supports Python 3.4
import argparse
import logging
import os
-from conf import settings
-logger = logging.getLogger(__name__)
+_LOGGER = logging.getLogger(__name__)
def create_dir(path):
@@ -33,8 +34,8 @@ def create_dir(path):
if not os.path.exists(path):
try:
os.makedirs(path)
- except OSError as e:
- logger.error("Failed to create directory %s: %s", path, str(e))
+ except OSError as ex:
+ _LOGGER.error("Failed to create directory %s: %s", path, str(ex))
raise
@@ -43,11 +44,11 @@ def write_query_results_to_csv(results_path, csv_results_file_prefix,
""" Write the results of the query to the CSV """
create_dir(results_path)
filec = os.path.join(results_path, csv_results_file_prefix + ".csv")
- with open(filec, "wb") as f:
- f.write(query_results["Columns"].replace(" ", ",") + "\n")
+ with open(filec, "wb") as result_file:
+ result_file.write(query_results["Columns"].replace(" ", ",") + "\n")
for row in (query_results["Output"].replace("} {", ",").
replace("{", "").replace("}", "").split(",")):
- f.write(row.replace(" ", ",") + "\n")
+ result_file.write(row.replace(" ", ",") + "\n")
def positive_int(value):
@@ -67,7 +68,7 @@ def percent_float(value):
"%s not in range [0.0, 100.0]" % pvalue)
return pvalue
-
+# pylint: disable=too-many-branches, too-many-statements
def main():
""" Read the arguments, Invoke Test and Return the results"""
parser = argparse.ArgumentParser()
@@ -142,7 +143,7 @@ def main():
dest="test_user_name")
optional_named.add_argument("--results_dir",
required=False,
- default=settings.getValue("TRAFFICGEN_STC_RESULTS_DIR"),
+ default="./Results",
help="The directory to copy results to",
dest="results_dir")
optional_named.add_argument("--csv_results_file_prefix",
@@ -278,12 +279,12 @@ def main():
args = parser.parse_args()
if args.verbose:
- logger.debug("Creating results directory")
+ _LOGGER.debug("Creating results directory")
create_dir(args.results_dir)
session_name = args.test_session_name
user_name = args.test_user_name
-
+ # pylint: disable=import-error
try:
# Load Spirent REST Library
from stcrestclient import stchttp
@@ -291,8 +292,8 @@ def main():
stc = stchttp.StcHttp(args.lab_server_addr)
session_id = stc.new_session(user_name, session_name)
stc.join_session(session_id)
- except RuntimeError as e:
- logger.error(e)
+ except RuntimeError as err:
+ _LOGGER.error(err)
raise
# Get STC system info.
@@ -305,43 +306,43 @@ def main():
# Retrieve and display the server information
if args.verbose:
- logger.debug("SpirentTestCenter system version: %s",
- stc.get("system1", "version"))
+ _LOGGER.debug("SpirentTestCenter system version: %s",
+ stc.get("system1", "version"))
try:
device_list = []
port_list = []
if args.verbose:
- logger.debug("Bring up license server")
+ _LOGGER.debug("Bring up license server")
license_mgr = stc.get("system1", "children-licenseservermanager")
if args.verbose:
- logger.debug("license_mgr = %s", license_mgr)
+ _LOGGER.debug("license_mgr = %s", license_mgr)
stc.create("LicenseServer", under=license_mgr, attributes={
- "server": args.license_server_addr})
+ "server": args.license_server_addr})
# Create the root project object
if args.verbose:
- logger.debug("Creating project ...")
+ _LOGGER.debug("Creating project ...")
project = stc.get("System1", "children-Project")
# Configure any custom traffic parameters
if args.traffic_custom == "cont":
if args.verbose:
- logger.debug("Configure Continuous Traffic")
+ _LOGGER.debug("Configure Continuous Traffic")
stc.create("ContinuousTestConfig", under=project)
# Create ports
if args.verbose:
- logger.debug("Creating ports ...")
+ _LOGGER.debug("Creating ports ...")
east_chassis_port = stc.create('port', project)
if args.verbose:
- logger.debug("Configuring TX port ...")
+ _LOGGER.debug("Configuring TX port ...")
stc.config(east_chassis_port, {'location': tx_port_loc})
port_list.append(east_chassis_port)
west_chassis_port = stc.create('port', project)
if args.verbose:
- logger.debug("Configuring RX port ...")
+ _LOGGER.debug("Configuring RX port ...")
stc.config(west_chassis_port, {'location': rx_port_loc})
port_list.append(west_chassis_port)
@@ -387,12 +388,12 @@ def main():
# Append to the device list
device_list.append(device_gen_config['ReturnList'])
if args.verbose:
- logger.debug(device_list)
+ _LOGGER.debug(device_list)
# Create the RFC 2544 'metric test
if args.metric == "throughput":
if args.verbose:
- logger.debug("Set up the RFC2544 throughput test...")
+ _LOGGER.debug("Set up the RFC2544 throughput test...")
stc.perform("Rfc2544SetupThroughputTestCommand",
params={"AcceptableFrameLoss":
args.acceptable_frame_loss_pct,
@@ -463,26 +464,26 @@ def main():
"system1.project", "children-port"), "autoConnect": "TRUE"})
# Apply configuration.
if args.verbose:
- logger.debug("Apply configuration...")
+ _LOGGER.debug("Apply configuration...")
stc.apply()
if args.verbose:
- logger.debug("Starting the sequencer...")
+ _LOGGER.debug("Starting the sequencer...")
stc.perform("SequencerStart")
# Wait for sequencer to finish
- logger.info(
+ _LOGGER.info(
"Starting test... Please wait for the test to complete...")
stc.wait_until_complete()
- logger.info("The test has completed... Saving results...")
+ _LOGGER.info("The test has completed... Saving results...")
# Determine what the results database filename is...
lab_server_resultsdb = stc.get(
"system1.project.TestResultSetting", "CurrentResultFileName")
if args.verbose:
- logger.debug("The lab server results database is %s",
- lab_server_resultsdb)
+ _LOGGER.debug("The lab server results database is %s",
+ lab_server_resultsdb)
stc.perform("CSSynchronizeFiles",
params={"DefaultDownloadDir": args.results_dir})
@@ -492,10 +493,10 @@ def main():
if not os.path.exists(resultsdb):
resultsdb = lab_server_resultsdb
- logger.info("Failed to create the local summary DB File, using"
- " the remote DB file instead.")
+ _LOGGER.info("Failed to create the local summary DB File, using"
+ " the remote DB file instead.")
else:
- logger.info(
+ _LOGGER.info(
"The local summary DB file has been saved to %s", resultsdb)
# The returns the "RFC2544ThroughputTestResultDetailedSummaryView"
@@ -551,26 +552,26 @@ def main():
("RFC2544FrameLossTestResultDetailed"
"SummaryView")}))
if args.verbose:
- logger.debug("resultsdict[\"Columns\"]: %s",
- resultsdict["Columns"])
- logger.debug("resultsdict[\"Output\"]: %s", resultsdict["Output"])
- logger.debug("Result paths: %s",
- stc.perform("GetTestResultSettingPaths"))
+ _LOGGER.debug("resultsdict[\"Columns\"]: %s",
+ resultsdict["Columns"])
+ _LOGGER.debug("resultsdict[\"Output\"]: %s", resultsdict["Output"])
+ _LOGGER.debug("Result paths: %s",
+ stc.perform("GetTestResultSettingPaths"))
# Write results to csv
- logger.debug("Writing CSV file to results directory %s",
- args.results_dir)
+ _LOGGER.debug("Writing CSV file to results directory %s",
+ args.results_dir)
write_query_results_to_csv(
args.results_dir, args.csv_results_file_prefix, resultsdict)
except RuntimeError as e:
- logger.error(e)
+ _LOGGER.error(e)
if args.verbose:
- logger.debug("Destroy session on lab server")
+ _LOGGER.debug("Destroy session on lab server")
stc.end_session()
- logger.info("Test complete!")
+ _LOGGER.info("Test complete!")
if __name__ == "__main__":
main()
diff --git a/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py b/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py
index ddb64562..044fb67d 100644
--- a/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py
+++ b/tools/pkt_gen/testcenter/testcenter-rfc2889-rest.py
@@ -1,4 +1,4 @@
-# Copyright 2016 Spirent Communications.
+# Copyright 2016-2017 Spirent Communications.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -11,11 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+# pylint: disable=invalid-name
'''
@author Spirent Communications
-This test automates the RFC2544 tests using the Spirent
+This test automates the RFC2889 tests using the Spirent
TestCenter REST APIs. This test supports Python 3.4
'''
@@ -66,7 +66,7 @@ def percent_float(value):
"%s not in range [0.0, 100.0]" % pvalue)
return pvalue
-
+# pylint: disable=too-many-statements
def main():
""" Read the arguments, Invoke Test and Return the results"""
parser = argparse.ArgumentParser()
@@ -92,9 +92,9 @@ def main():
optional_named.add_argument("--metric",
required=False,
help=("One among - Forwarding,\
- Address Caching and Congestion"),
+ Address Caching and Learning"),
choices=["forwarding", "caching",
- "congestion"],
+ "learning"],
default="forwarding",
dest="metric")
optional_named.add_argument("--test_session_name",
@@ -103,7 +103,6 @@ def main():
help=("The friendly name to identify "
"the Spirent Lab Server test session"),
dest="test_session_name")
-
optional_named.add_argument("--test_user_name",
required=False,
default="Rfc2889Usr",
@@ -147,6 +146,42 @@ def main():
default=[256],
help="A comma-delimited list of frame sizes",
dest="frame_size_list")
+ optional_named.add_argument("--min_learning_rate",
+ type=positive_int,
+ required=False,
+ default=1488,
+ help="Lowest learning rate for test",
+ dest="min_learning_rate")
+ optional_named.add_argument("--max_learning_rate",
+ type=positive_int,
+ required=False,
+ default=14880,
+ help="Highest learning rate for test",
+ dest="max_learning_rate")
+ optional_named.add_argument("--min_num_addrs",
+ type=positive_int,
+ required=False,
+ default=1,
+ help="lowest number of addrs sent to DUT",
+ dest="min_num_addrs")
+ optional_named.add_argument("--max_num_addrs",
+ type=positive_int,
+ required=False,
+ default=1000,
+ help="Highest number of addrs sent to DUT",
+ dest="max_num_addrs")
+ optional_named.add_argument("--ac_learning_rate",
+ type=positive_int,
+ required=False,
+ default=1000,
+ help="Number of learning frames per sec",
+ dest="ac_learning_rate")
+ optional_named.add_argument("--frame_size",
+ type=positive_int,
+ required=False,
+ default=64,
+ help="Frame size for address test",
+ dest="frame_size")
parser.add_argument("-v",
"--verbose",
required=False,
@@ -164,6 +199,7 @@ def main():
session_name = args.test_session_name
user_name = args.test_user_name
+ # pylint: disable=import-error
try:
# Load Spirent REST Library
from stcrestclient import stchttp
@@ -187,7 +223,7 @@ def main():
if args.verbose:
logger.debug("license_mgr = %s", license_mgr)
stc.create("LicenseServer", under=license_mgr, attributes={
- "server": args.license_server_addr})
+ "server": args.license_server_addr})
# Create the root project object
if args.verbose:
@@ -224,12 +260,27 @@ def main():
"GenParams": gen_params})
if args.verbose:
- logger.debug("Set up the RFC2889 Forwarding test...")
- stc.perform("Rfc2889SetupMaxForwardingRateTestCommand",
- params={"Duration": args.trial_duration_sec,
- "FrameSizeList": args.frame_size_list,
- "NumOfTrials": args.num_trials,
- "TrafficPattern": args.traffic_pattern})
+ logger.debug("Set up the RFC2889 test...")
+
+ if args.metric == "learning":
+ stc.perform("Rfc2889SetupAddressLearningRateTestCommand",
+ params={"FrameSize": args.frame_size,
+ "MinLearningRate": args.min_learning_rate,
+ "MaxLearningRate": args.max_learning_rate,
+ "NumOfTrials": args.num_trials})
+ elif args.metric == "caching":
+ stc.perform("Rfc2889SetupAddressCachingCapacityTestCommand",
+ params={"FrameSize": args.frame_size,
+ "MinNumAddrs": args.min_num_addrs,
+ "MaxNumAddrs": args.max_num_addrs,
+ "LearningRate": args.ac_learning_rate,
+ "NumOfTrials": args.num_trials})
+ else:
+ stc.perform("Rfc2889SetupMaxForwardingRateTestCommand",
+ params={"Duration": args.trial_duration_sec,
+ "FrameSizeList": args.frame_size_list,
+ "NumOfTrials": args.num_trials,
+ "TrafficPattern": args.traffic_pattern})
# Save the configuration
stc.perform("SaveToTcc", params={"Filename": "2889.tcc"})
@@ -259,28 +310,34 @@ def main():
logger.debug("The lab server results database is %s",
lab_server_resultsdb)
- stc.perform("CSSynchronizeFiles",
- params={"DefaultDownloadDir": args.results_dir})
-
- resultsdb = args.results_dir + \
- lab_server_resultsdb.split("/Results")[1]
-
- if not os.path.exists(resultsdb):
- resultsdb = lab_server_resultsdb
- logger.info("Failed to create the local summary DB file, using"
- " the remote DB file instead.")
+ if args.metric == "learning":
+ resultsdict = (
+ stc.perform("QueryResult",
+ params={
+ "DatabaseConnectionString":
+ lab_server_resultsdb,
+ "ResultPath":
+ ("RFC2889AddressLearningRateTestResultDetailed"
+ "SummaryView")}))
+ elif args.metric == "caching":
+ resultsdict = (
+ stc.perform("QueryResult",
+ params={
+ "DatabaseConnectionString":
+ lab_server_resultsdb,
+ "ResultPath":
+ ("RFC2889AddressCachingCapacityTestResult"
+ "DetailedSummaryView")}))
else:
- logger.info(
- "The local summary DB file has been saved to %s", resultsdb)
-
- resultsdict = (
- stc.perform("QueryResult",
- params={
- "DatabaseConnectionString":
- resultsdb,
- "ResultPath":
- ("RFC2889MaxForwardingRateTestResultDetailed"
- "SummaryView")}))
+ resultsdict = (
+ stc.perform("QueryResult",
+ params={
+ "DatabaseConnectionString":
+ lab_server_resultsdb,
+ "ResultPath":
+ ("RFC2889MaxForwardingRateTestResultDetailed"
+ "SummaryView")}))
+
if args.verbose:
logger.debug("resultsdict[\"Columns\"]: %s",
resultsdict["Columns"])
diff --git a/tools/pkt_gen/testcenter/testcenter.py b/tools/pkt_gen/testcenter/testcenter.py
index 701d451c..9980ae7c 100644
--- a/tools/pkt_gen/testcenter/testcenter.py
+++ b/tools/pkt_gen/testcenter/testcenter.py
@@ -115,22 +115,52 @@ def get_rfc2544_custom_settings(framesize, custom_tr, tests):
return args
-def get_rfc2889_settings(framesize, tests, duration):
+def get_rfc2889_common_settings(framesize, tests, metric):
+ """
+ Return RFC2889 common Settings
+ """
+ new_metric = metric.replace('rfc2889_', '')
args = [settings.getValue("TRAFFICGEN_STC_PYTHON2_PATH"),
os.path.join(
settings.getValue("TRAFFICGEN_STC_TESTCENTER_PATH"),
settings.getValue(
"TRAFFICGEN_STC_RFC2889_TEST_FILE_NAME")),
- "--lab_server_addr",
- settings.getValue("TRAFFICGEN_STC_LAB_SERVER_ADDR"),
- "--license_server_addr",
- settings.getValue("TRAFFICGEN_STC_LICENSE_SERVER_ADDR"),
- "--location_list",
- settings.getValue("TRAFFICGEN_STC_RFC2889_LOCATIONS"),
- "--frame_size_list",
- str(framesize),
- "--num_trials",
- str(tests)]
+ "--lab_server_addr",
+ settings.getValue("TRAFFICGEN_STC_LAB_SERVER_ADDR"),
+ "--license_server_addr",
+ settings.getValue("TRAFFICGEN_STC_LICENSE_SERVER_ADDR"),
+ "--location_list",
+ settings.getValue("TRAFFICGEN_STC_RFC2889_LOCATIONS"),
+ "--test_session_name",
+ settings.getValue("TRAFFICGEN_STC_TEST_SESSION_NAME"),
+ "--results_dir",
+ settings.getValue("TRAFFICGEN_STC_RESULTS_DIR"),
+ "--csv_results_file_prefix",
+ settings.getValue("TRAFFICGEN_STC_CSV_RESULTS_FILE_PREFIX"),
+ "--frame_size_list",
+ str(framesize),
+ "--metric",
+ str(new_metric),
+ "--num_trials",
+ str(tests)]
+
+ return args
+
+
+def get_rfc2889_custom_settings():
+ """
+ Return RFC2889 Custom Settings
+ """
+ args = ["--min_learning_rate",
+ settings.getValue("TRAFFICGEN_STC_RFC2889_MIN_LR"),
+ "--max_learning_rate",
+ settings.getValue("TRAFFICGEN_STC_RFC2889_MAX_LR"),
+ "--min_num_addrs",
+ settings.getValue("TRAFFICGEN_STC_RFC2889_MIN_ADDRS"),
+ "--max_num_addrs",
+ settings.getValue("TRAFFICGEN_STC_RFC2889_MAX_ADDRS"),
+ "--ac_learning_rate",
+ settings.getValue("TRAFFICGEN_STC_RFC2889_AC_LR")]
return args
@@ -158,19 +188,35 @@ class TestCenter(trafficgen.ITrafficGenerator):
"""
return None
- def send_rfc2889_congestion(self, traffic=None, tests=1, duration=20):
+ def get_rfc2889_addr_learning_results(self, filename):
"""
- Do nothing.
+ Reads the CSV file and return the results
"""
- return None
+ result = {}
+ with open(filename, "r") as csvfile:
+ csvreader = csv.DictReader(csvfile)
+ for row in csvreader:
+ self._logger.info("Row: %s", row)
+ learn_rate = float(row["OptimalLearningRate"])
+ result[ResultsConstants.OPTIMAL_LEARNING_RATE_FPS] = learn_rate
+ return result
- def send_rfc2889_caching(self, traffic=None, tests=1, duration=20):
+ def get_rfc2889_addr_caching_results(self, filename):
"""
- Do nothing.
+ Reads the CSV file and return the results
"""
- return None
+ result = {}
+ with open(filename, "r") as csvfile:
+ csvreader = csv.DictReader(csvfile)
+ for row in csvreader:
+ self._logger.info("Row: %s", row)
+ caching_cap = float(row["RxFrameCount"])
+ learn_per = (100.0 - (float(row["PercentFrameLoss(%)"])))
+ result[ResultsConstants.CACHING_CAPACITY_ADDRS] = caching_cap
+ result[ResultsConstants.ADDR_LEARNED_PERCENT] = learn_per
+ return result
- def get_rfc2889_results(self, filename):
+ def get_rfc2889_forwarding_results(self, filename):
"""
Reads the CSV file and return the results
"""
@@ -200,6 +246,91 @@ class TestCenter(trafficgen.ITrafficGenerator):
row["ForwardingRate(fps)"])
return result
+ # pylint: disable=unused-argument
+ def send_rfc2889_forwarding(self, traffic=None, tests=1, duration=20):
+ """
+ Send traffic per RFC2889 Forwarding test specifications.
+ """
+ framesize = settings.getValue("TRAFFICGEN_STC_FRAME_SIZE")
+ if traffic and 'l2' in traffic:
+ if 'framesize' in traffic['l2']:
+ framesize = traffic['l2']['framesize']
+ args = get_rfc2889_common_settings(framesize, tests,
+ traffic['traffic_type'])
+ if settings.getValue("TRAFFICGEN_STC_VERBOSE") is "True":
+ args.append("--verbose")
+ verbose = True
+ self._logger.debug("Arguments used to call test: %s", args)
+ subprocess.check_call(args)
+
+ filec = os.path.join(settings.getValue("TRAFFICGEN_STC_RESULTS_DIR"),
+ settings.getValue(
+ "TRAFFICGEN_STC_CSV_RESULTS_FILE_PREFIX") +
+ ".csv")
+
+ if verbose:
+ self._logger.info("file: %s", filec)
+
+ return self.get_rfc2889_forwarding_results(filec)
+
+ def send_rfc2889_caching(self, traffic=None, tests=1, duration=20):
+ """
+ Send as per RFC2889 Addr-Caching test specifications.
+ """
+ framesize = settings.getValue("TRAFFICGEN_STC_FRAME_SIZE")
+ if traffic and 'l2' in traffic:
+ if 'framesize' in traffic['l2']:
+ framesize = traffic['l2']['framesize']
+ common_args = get_rfc2889_common_settings(framesize, tests,
+ traffic['traffic_type'])
+ custom_args = get_rfc2889_custom_settings()
+ args = common_args + custom_args
+
+ if settings.getValue("TRAFFICGEN_STC_VERBOSE") is "True":
+ args.append("--verbose")
+ verbose = True
+ self._logger.debug("Arguments used to call test: %s", args)
+ subprocess.check_call(args)
+
+ filec = os.path.join(settings.getValue("TRAFFICGEN_STC_RESULTS_DIR"),
+ settings.getValue(
+ "TRAFFICGEN_STC_CSV_RESULTS_FILE_PREFIX") +
+ ".csv")
+
+ if verbose:
+ self._logger.info("file: %s", filec)
+
+ return self.get_rfc2889_addr_caching_results(filec)
+
+ def send_rfc2889_learning(self, traffic=None, tests=1, duration=20):
+ """
+ Send traffic per RFC2889 Addr-Learning test specifications.
+ """
+ framesize = settings.getValue("TRAFFICGEN_STC_FRAME_SIZE")
+ if traffic and 'l2' in traffic:
+ if 'framesize' in traffic['l2']:
+ framesize = traffic['l2']['framesize']
+ common_args = get_rfc2889_common_settings(framesize, tests,
+ traffic['traffic_type'])
+ custom_args = get_rfc2889_custom_settings()
+ args = common_args + custom_args
+
+ if settings.getValue("TRAFFICGEN_STC_VERBOSE") is "True":
+ args.append("--verbose")
+ verbose = True
+ self._logger.debug("Arguments used to call test: %s", args)
+ subprocess.check_call(args)
+
+ filec = os.path.join(settings.getValue("TRAFFICGEN_STC_RESULTS_DIR"),
+ settings.getValue(
+ "TRAFFICGEN_STC_CSV_RESULTS_FILE_PREFIX") +
+ ".csv")
+
+ if verbose:
+ self._logger.info("file: %s", filec)
+
+ return self.get_rfc2889_addr_learning_results(filec)
+
def get_rfc2544_results(self, filename):
"""
Reads the CSV file and return the results
@@ -254,7 +385,7 @@ class TestCenter(trafficgen.ITrafficGenerator):
rfc2544_common_args = get_rfc2544_common_settings()
rfc2544_custom_args = get_rfc2544_custom_settings(framesize,
custom, 1)
- args = stc_common_args + rfc2544_common_args + rfc2544_custom_args
+ args = rfc2544_common_args + stc_common_args + rfc2544_custom_args
if settings.getValue("TRAFFICGEN_STC_VERBOSE") is "True":
args.append("--verbose")
@@ -272,31 +403,6 @@ class TestCenter(trafficgen.ITrafficGenerator):
return self.get_rfc2544_results(filec)
- def send_rfc2889_forwarding(self, traffic=None, tests=1, duration=20):
- """
- Send traffic per RFC2544 throughput test specifications.
- """
- framesize = settings.getValue("TRAFFICGEN_STC_FRAME_SIZE")
- if traffic and 'l2' in traffic:
- if 'framesize' in traffic['l2']:
- framesize = traffic['l2']['framesize']
- args = get_rfc2889_settings(framesize, tests, duration)
- if settings.getValue("TRAFFICGEN_STC_VERBOSE") is "True":
- args.append("--verbose")
- verbose = True
- self._logger.debug("Arguments used to call test: %s", args)
- subprocess.check_call(args)
-
- filec = os.path.join(settings.getValue("TRAFFICGEN_STC_RESULTS_DIR"),
- settings.getValue(
- "TRAFFICGEN_STC_CSV_RESULTS_FILE_PREFIX") +
- ".csv")
-
- if verbose:
- self._logger.debug("file: %s", filec)
-
- return self.get_rfc2889_results(filec)
-
def send_rfc2544_throughput(self, traffic=None, tests=1, duration=20,
lossrate=0.0):
"""
@@ -312,7 +418,7 @@ class TestCenter(trafficgen.ITrafficGenerator):
rfc2544_common_args = get_rfc2544_common_settings()
rfc2544_custom_args = get_rfc2544_custom_settings(framesize, '',
tests)
- args = stc_common_args + rfc2544_common_args + rfc2544_custom_args
+ args = rfc2544_common_args + stc_common_args + rfc2544_custom_args
if settings.getValue("TRAFFICGEN_STC_VERBOSE") is "True":
args.append("--verbose")
@@ -345,7 +451,7 @@ class TestCenter(trafficgen.ITrafficGenerator):
rfc2544_common_args = get_rfc2544_common_settings()
rfc2544_custom_args = get_rfc2544_custom_settings(framesize, '',
tests)
- args = stc_common_args + rfc2544_common_args + rfc2544_custom_args
+ args = rfc2544_common_args + stc_common_args + rfc2544_custom_args
if settings.getValue("TRAFFICGEN_STC_VERBOSE") is "True":
args.append("--verbose")
@@ -362,6 +468,26 @@ class TestCenter(trafficgen.ITrafficGenerator):
return self.get_rfc2544_results(filecs)
+ def start_cont_traffic(self, traffic=None, duration=30):
+ raise NotImplementedError('TestCenter start_cont_traffic not implement.')
+
+ def stop_cont_traffic(self):
+ raise NotImplementedError('TestCenter stop_cont_traffic not implement.')
+
+ def start_rfc2544_back2back(self, traffic=None, tests=1, duration=20,
+ lossrate=0.0):
+ raise NotImplementedError('TestCenter start_rfc2544_back2back not implement.')
+
+ def wait_rfc2544_back2back(self):
+ raise NotImplementedError('TestCenter wait_rfc2544_back2back not implement.')
+
+ def start_rfc2544_throughput(self, traffic=None, tests=1, duration=20,
+ lossrate=0.0):
+ raise NotImplementedError('TestCenter start_rfc2544_throughput not implement.')
+
+ def wait_rfc2544_throughput(self):
+ raise NotImplementedError('TestCenter wait_rfc2544_throughput not implement.')
+
if __name__ == '__main__':
TRAFFIC = {
'l3': {