bugfix:新增compatible_mode配置项,用来适配7400,9140环境
This commit is contained in:
@@ -1256,6 +1256,7 @@ class TsgDiagnose:
|
|||||||
self.dign_duration = 0
|
self.dign_duration = 0
|
||||||
self.max_service_function_index = 1
|
self.max_service_function_index = 1
|
||||||
self.list_service_function_index = []
|
self.list_service_function_index = []
|
||||||
|
self.compatible_mode = False
|
||||||
|
|
||||||
def _get_dign_option(self):
|
def _get_dign_option(self):
|
||||||
parser = argparse.ArgumentParser(description="Tsg Tools - tsg diagnose", epilog = "Example:help")
|
parser = argparse.ArgumentParser(description="Tsg Tools - tsg diagnose", epilog = "Example:help")
|
||||||
@@ -1265,11 +1266,13 @@ class TsgDiagnose:
|
|||||||
parser.add_argument('-l','--loop', action='store_true', default = False, help='Tsg diagnose loop, exit when recv a signal')
|
parser.add_argument('-l','--loop', action='store_true', default = False, help='Tsg diagnose loop, exit when recv a signal')
|
||||||
parser.add_argument('-m','--max_service_function_index', type = int, default = 1, help='Specifies the max index of service_function,range:1-256')
|
parser.add_argument('-m','--max_service_function_index', type = int, default = 1, help='Specifies the max index of service_function,range:1-256')
|
||||||
parser.add_argument('-d','--list_service_function_index', nargs='+', type = int, help='Specifies the list of service function index')
|
parser.add_argument('-d','--list_service_function_index', nargs='+', type = int, help='Specifies the list of service function index')
|
||||||
|
parser.add_argument('-o','--compatible_mode', action='store_true', default = False, help='Tsg diagnose compatible mode to running')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
self.interval = args.interval
|
self.interval = args.interval
|
||||||
self.loop = args.loop
|
self.loop = args.loop
|
||||||
self.count = args.count
|
self.count = args.count
|
||||||
self.config = args.configpath
|
self.config = args.configpath
|
||||||
|
self.compatible_mode = args.compatible_mode
|
||||||
self.max_service_function_index = args.max_service_function_index
|
self.max_service_function_index = args.max_service_function_index
|
||||||
self.list_service_function_index = args.list_service_function_index
|
self.list_service_function_index = args.list_service_function_index
|
||||||
if self.count == 0:
|
if self.count == 0:
|
||||||
@@ -1362,6 +1365,11 @@ class TsgDiagnose:
|
|||||||
print(format(("Service function id:" + str(id_service_function) + ",Test end time: " + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())),'=^70s'))
|
print(format(("Service function id:" + str(id_service_function) + ",Test end time: " + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())),'=^70s'))
|
||||||
|
|
||||||
def _dign_service_function_running(self):
|
def _dign_service_function_running(self):
|
||||||
|
if self.compatible_mode == True:
|
||||||
|
set_http_request_resolve(30)
|
||||||
|
set_dns_server_ip(35)
|
||||||
|
self._dign_running(1)
|
||||||
|
else:
|
||||||
if self.list_service_function_index == None:
|
if self.list_service_function_index == None:
|
||||||
for id_service_function in range(1,self.max_service_function_index + 1):
|
for id_service_function in range(1,self.max_service_function_index + 1):
|
||||||
set_http_request_resolve(id_service_function)
|
set_http_request_resolve(id_service_function)
|
||||||
|
|||||||
@@ -51,6 +51,6 @@ if [ -f "$K3S_BIN_PATH" ]; then
|
|||||||
else
|
else
|
||||||
systemctl start tsg-diagnose
|
systemctl start tsg-diagnose
|
||||||
sleep 10
|
sleep 10
|
||||||
docker exec -it dign-client /bin/sh -c "python bin/client.py"
|
docker exec -it dign-client /bin/sh -c "python bin/client.py -o"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,6 @@ if [ -f "$K3S_BIN_PATH" ]; then
|
|||||||
else
|
else
|
||||||
systemctl start tsg-diagnose
|
systemctl start tsg-diagnose
|
||||||
sleep 10
|
sleep 10
|
||||||
docker exec -it dign-client /bin/sh -c "python bin/client.py -l"
|
docker exec -it dign-client /bin/sh -c "python bin/client.py -l -o"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user