pushing lfdata from dipti-branch, adding version number for all new_x_profile in realm.py, version number in test_vt_2

Signed-off-by: Dipti <dipti.dhond@candelatech.com>
This commit is contained in:
Dipti
2021-03-03 00:32:26 -08:00
parent d580c8789a
commit bf5dbb841a
4 changed files with 121 additions and 48 deletions

View File

@@ -3,7 +3,7 @@ import re
import time import time
import pprint import pprint
from pprint import pprint from pprint import pprint
#from lfdata import LFDataCollection from lfdata import LFDataCollection
from base_profile import BaseProfile from base_profile import BaseProfile
import os import os
import datetime import datetime

View File

@@ -22,11 +22,6 @@ import pandas as pd
import requests import requests
import ast import ast
import csv import csv
#Profile Imports
from l3_cxprofile import L3CXProfile
from l3_cxprofile2 import L3CXProfile2
def wpa_ent_list(): def wpa_ent_list():
@@ -765,21 +760,41 @@ class Realm(LFCliBase):
link = self.lfclient_url + link link = self.lfclient_url + link
info = () info = ()
def new_station_profile(self): def new_station_profile(self, ver = 1):
if ver == 1:
#import station_profile
station_prof = StationProfile(self.lfclient_url, local_realm=self, debug_=self.debug, up=False) station_prof = StationProfile(self.lfclient_url, local_realm=self, debug_=self.debug, up=False)
#elif ver == 2:
# import station_profile2
# station_prof = station_profile2.StationProfile2(self.lfclient_url, local_realm=self, debug_=self.debug, up=False)
return station_prof return station_prof
def new_multicast_profile(self): def new_multicast_profile(self, ver = 1):
if ver == 1:
#import multicast_profile
multi_prof = MULTICASTProfile(self.lfclient_host, self.lfclient_port, multi_prof = MULTICASTProfile(self.lfclient_host, self.lfclient_port,
local_realm=self, debug_=self.debug, report_timer_=3000) local_realm=self, debug_=self.debug, report_timer_=3000)
#elif ver == 2:
# import multicast_profile2
# multi_prof = multicast_profile2.MULTICASTProfile2(self.lfclient_host, self.lfclient_port,
# local_realm=self, debug_=self.debug, report_timer_=3000)
return multi_prof return multi_prof
def new_wifi_monitor_profile(self, resource_=1, debug_=False, up_=False): def new_wifi_monitor_profile(self, resource_=1, debug_=False, up_=False, ver = 1):
if ver == 1:
#import wifi_monitor_profile
wifi_mon_prof = WifiMonitor(self.lfclient_url, wifi_mon_prof = WifiMonitor(self.lfclient_url,
local_realm=self, local_realm=self,
resource_=resource_, resource_=resource_,
up=up_, up=up_,
debug_=(self.debug or debug_)) debug_=(self.debug or debug_))
#elif ver == 2:
# import wifi_monitor_profile2
# wifi_mon_prof = wifi_monitor_profile2.WifiMonitor2(self.lfclient_url,
# local_realm=self,
# resource_=resource_,
# up=up_,
# debug_=(self.debug or debug_))
return wifi_mon_prof return wifi_mon_prof
def new_l3_cx_profile(self, ver = 1): def new_l3_cx_profile(self, ver = 1):
@@ -799,57 +814,117 @@ class Realm(LFCliBase):
report_timer_=3000) report_timer_=3000)
return cx_prof return cx_prof
def new_l4_cx_profile(self): def new_l4_cx_profile(self, ver = 1):
if ver == 1 :
#import l4_cxprofile
cx_prof = L4CXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) cx_prof = L4CXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
#elif ver == 2:
# import l4_cxprofile2
# cx_prof = l4_cxprofile2.L4CXProfile2(self.lfclient_host,
# self.lfclient_port,
# local_realm=self,
# debug_=self.debug,
# report_timer_=3000)
return cx_prof return cx_prof
def new_generic_endp_profile(self): def new_generic_endp_profile(self, ver = 1):
if ver == 1 :
#import gen_cxprofile
endp_prof = GenCXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) endp_prof = GenCXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
#elif ver == 2:
# import gen_cxprofile2
# endp_prof = gen_cxprofile2.GenCXProfile(self.lfclient_host,
# self.lfclient_port,
# local_realm=self,
# debug_=self.debug,
# report_timer_=3000)
return endp_prof return endp_prof
def new_generic_cx_profile(self): def new_generic_cx_profile(self, ver = 1):
""" """
@deprecated @deprecated
:return: new GenCXProfile :return: new GenCXProfile
""" """
if ver == 1:
#import gen_cxprofile
cx_prof = GenCXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) cx_prof = GenCXProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
#elif ver == 2:
# import gen_cxprofile2
# cx_prof = gen_cxprofile2.GenCXProfile(self.lfclient_host,
# self.lfclient_port,
# local_realm=self,
# debug_=self.debug,
# report_timer_=3000)
return cx_prof return cx_prof
def new_vap_profile(self): def new_vap_profile(self, ver = 1):
if ver == 1:
#import vap_profile
vap_prof = VAPProfile(lfclient_host=self.lfclient_host, lfclient_port=self.lfclient_port, local_realm=self, vap_prof = VAPProfile(lfclient_host=self.lfclient_host, lfclient_port=self.lfclient_port, local_realm=self,
debug_=self.debug) debug_=self.debug)
# elif ver == 2:
# import vap_profile2
# vap_prof = vap_profile2.VAPProfile2(lfclient_host=self.lfclient_host, lfclient_port=self.lfclient_port, local_realm=self,
# debug_=self.debug)
return vap_prof return vap_prof
def new_vr_profile(self): def new_vr_profile(self, ver = 1):
if ver == 1:
import vr_profile import vr_profile
from vr_profile import VRProfile from vr_profile import VRProfile
vap_prof = VRProfile(local_realm=self, vap_prof = vr_profile.VRProfile(local_realm=self,
debug=self.debug) debug=self.debug)
# elif ver == 2:
# import vr_profile2
# from vr_profile2 import VRProfile2
# vap_prof = vr_profile2.VRProfile2(local_realm=self,
# debug=self.debug)
return vap_prof return vap_prof
def new_http_profile(self): def new_http_profile(self, ver = 1):
if ver == 1:
#import http_profile
http_prof = HTTPProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) http_prof = HTTPProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
# elif ver == 2:
# import http_profile2
# http_prof = http_profile2.HTTPProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
return http_prof return http_prof
def new_fio_endp_profile(self): def new_fio_endp_profile(self, ver = 1):
if ver == 1:
#import fio_endp_profile
cx_prof = FIOEndpProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) cx_prof = FIOEndpProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
# elif ver == 2:
# import fio_endp_profile2
# cx_prof = fio_endp_profile2.FIOEndpProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
return cx_prof return cx_prof
def new_dut_profile(self): def new_dut_profile(self, ver = 1):
return DUTProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) if ver == 1:
#import dut_profile
dut_profile = dut_profile.DUTProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
# elif ver == 2:
# import dut_profile2
# dut_profile = dut_profile2.DUTProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
return dut_profile
def new_mvlan_profile(self): def new_mvlan_profile(self, ver = 1):
return MACVLANProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) if ver == 1:
#import mac_vlan_profile
mac_vlan_profile = MACVLANProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
# elif ver == 2:
# import mac_vlan_profile2
# mac_vlan_profile = mac_vlan_profile2.MACVLANProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
return mac_vlan_profile
def new_test_group_profile(self): def new_test_group_profile(self, ver = 1):
return TestGroupProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug) if ver == 1:
#import test_group_profile
def new_vr_profile(self): test_group_profile = TestGroupProfile(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
import vr_profile # elif ver == 2:
from vr_profile import VRProfile # import test_group_profile2
profile = VRProfile(local_realm=self, # test_group_profile = test_group_profile2.TestGroupProfile2(self.lfclient_host, self.lfclient_port, local_realm=self, debug_=self.debug)
debug=self.debug) return test_group_profile
return profile
class BaseProfile: class BaseProfile:
def __init__(self, local_realm, debug=False): def __init__(self, local_realm, debug=False):

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import lfdata from lfdata import LFDataCollection
import lfreporting #import lfreporting
class TestBase: class TestBase:
def __init__(self): def __init__(self):

8
py-scripts/test_ipv4_variable_time2.py Normal file → Executable file
View File

@@ -22,10 +22,9 @@ if 'py-json' not in sys.path:
sys.path.append(os.path.join(os.path.abspath('..'), 'py-json')) sys.path.append(os.path.join(os.path.abspath('..'), 'py-json'))
import argparse import argparse
#from LANforge.lfcli_base import LFCliBase
from LANforge import LFUtils from LANforge import LFUtils
from realm import Realm from realm import Realm
from LANforge.test_base import TestBase from test_base import TestBase
import time import time
import datetime import datetime
@@ -53,7 +52,6 @@ class IPV4VariableTime(Realm, TestBase):
super().__init__(lfclient_host=host, super().__init__(lfclient_host=host,
lfclient_port=port) lfclient_port=port)
self.add_to
self.upstream = upstream self.upstream = upstream
self.host = host self.host = host
self.port = port self.port = port
@@ -75,8 +73,8 @@ class IPV4VariableTime(Realm, TestBase):
# }) # })
self.name_prefix = name_prefix self.name_prefix = name_prefix
self.test_duration = test_duration self.test_duration = test_duration
self.station_profile = self.new_station_profile(station_list=sta_list) self.station_profile = self.new_station_profile(ver = 2, station_list = sta_list)
self.cx_profile = self.new_l3_cx_profile(ver=2) self.cx_profile = self.new_l3_cx_profile(ver = 2)
#station profile settings #station profile settings
self.station_profile.lfclient_url = self.lfclient_url self.station_profile.lfclient_url = self.lfclient_url