mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 11:18:03 +00:00
lf_check.py : additional removal for the --use_json flag as json will
be the only configuration supported. Using the flag --use_json will a Note that the --use_json is deprecated. Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -13,8 +13,8 @@ The --production flag determine the email list for results
|
|||||||
|
|
||||||
EXAMPLE:
|
EXAMPLE:
|
||||||
lf_check.py # this will use the defaults
|
lf_check.py # this will use the defaults
|
||||||
lf_check.py --use_json --json <unique json file> --test_suite
|
lf_check.py --json <unique json file> --test_suite
|
||||||
lf_check.py --use_json --json <unique json file> --production
|
lf_check.py --json <unique json file> --production
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
Before using lf_check.py
|
Before using lf_check.py
|
||||||
@@ -57,7 +57,6 @@ Starting LANforge:
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
import datetime
|
import datetime
|
||||||
import pprint
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info[0] != 3:
|
if sys.version_info[0] != 3:
|
||||||
@@ -71,10 +70,8 @@ import time
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import configparser
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import csv
|
import csv
|
||||||
import shutil
|
|
||||||
import shlex
|
import shlex
|
||||||
import paramiko
|
import paramiko
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
@@ -96,7 +93,6 @@ FORMAT = '%(asctime)s %(name)s %(levelname)s: %(message)s'
|
|||||||
# lf_check class contains verificaiton configuration and ocastrates the testing.
|
# lf_check class contains verificaiton configuration and ocastrates the testing.
|
||||||
class lf_check():
|
class lf_check():
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
_use_json,
|
|
||||||
_json_data,
|
_json_data,
|
||||||
_test_suite,
|
_test_suite,
|
||||||
_production,
|
_production,
|
||||||
@@ -105,7 +101,6 @@ class lf_check():
|
|||||||
_outfile_name,
|
_outfile_name,
|
||||||
_report_path,
|
_report_path,
|
||||||
_log_path):
|
_log_path):
|
||||||
self.use_json = _use_json
|
|
||||||
self.json_data = _json_data
|
self.json_data = _json_data
|
||||||
self.test_suite = _test_suite
|
self.test_suite = _test_suite
|
||||||
self.production_run = _production
|
self.production_run = _production
|
||||||
@@ -1032,8 +1027,7 @@ Summary :
|
|||||||
running scripts listed in <config>.ini or <config>.json
|
running scripts listed in <config>.ini or <config>.json
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
./lf_check.py --ini lf_check_test.ini --suite suite_one
|
./lf_check.py --json lf_check_test.json --suite suite_two
|
||||||
./lf_check.py --use_json --json lf_check_test.json --suite suite_two
|
|
||||||
---------
|
---------
|
||||||
''')
|
''')
|
||||||
|
|
||||||
@@ -1042,7 +1036,7 @@ Example :
|
|||||||
parser.add_argument('--dir', help="--dir <results directory>", default="lf_check")
|
parser.add_argument('--dir', help="--dir <results directory>", default="lf_check")
|
||||||
parser.add_argument('--path', help="--path <results path>", default="/home/lanforge/html-results")
|
parser.add_argument('--path', help="--path <results path>", default="/home/lanforge/html-results")
|
||||||
parser.add_argument('--json', help="--json <lf_ckeck_config.json file> ", default="lf_check_config.json")
|
parser.add_argument('--json', help="--json <lf_ckeck_config.json file> ", default="lf_check_config.json")
|
||||||
parser.add_argument('--use_json', help="--use_json ", action='store_true')
|
parser.add_argument('--use_json', help="--use_json FLAG DEPRECATED", action='store_true')
|
||||||
parser.add_argument('--suite', help="--suite <suite name> default TEST_DICTIONARY", default="TEST_DICTIONARY")
|
parser.add_argument('--suite', help="--suite <suite name> default TEST_DICTIONARY", default="TEST_DICTIONARY")
|
||||||
parser.add_argument('--production', help="--production stores true, sends email results to production email list",
|
parser.add_argument('--production', help="--production stores true, sends email results to production email list",
|
||||||
action='store_true')
|
action='store_true')
|
||||||
@@ -1053,10 +1047,10 @@ Example :
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.use_json:
|
||||||
|
print("NOTE: --use_json flag deprecated and unused")
|
||||||
# load test config file information either <config>.json or <config>.ini
|
# load test config file information either <config>.json or <config>.ini
|
||||||
use_json = False
|
|
||||||
json_data = ""
|
json_data = ""
|
||||||
use_json = True
|
|
||||||
try:
|
try:
|
||||||
print("args.json {}".format(args.json))
|
print("args.json {}".format(args.json))
|
||||||
with open(args.json, 'r') as json_config:
|
with open(args.json, 'r') as json_config:
|
||||||
@@ -1097,8 +1091,7 @@ Example :
|
|||||||
log_path = report.get_log_path()
|
log_path = report.get_log_path()
|
||||||
|
|
||||||
# lf_check() class created
|
# lf_check() class created
|
||||||
check = lf_check(_use_json=use_json,
|
check = lf_check(_json_data=json_data,
|
||||||
_json_data=json_data,
|
|
||||||
_test_suite=test_suite,
|
_test_suite=test_suite,
|
||||||
_production=production,
|
_production=production,
|
||||||
_csv_results=csv_results,
|
_csv_results=csv_results,
|
||||||
|
|||||||
Reference in New Issue
Block a user