diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index 878807b2..3b9aa028 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -18,6 +18,12 @@ def cv_base_adjust_parser(args): # TODO: In future, can use TestRig once that GUI update has propagated args.set.append(["Test Rig ID:", args.test_rig]) + if args.influx_host != "": + if (not args.pull_report): + print("Specified influx host without pull_report, will enabled pull_request.") + args.pull_report = True + + def cv_add_base_parser(parser): parser.add_argument("-m", "--mgr", type=str, default="localhost", help="address of the LANforge GUI machine (localhost is default)") @@ -349,12 +355,15 @@ class cv_test(Realm): def check_influx_kpi(self, args): if self.report_dir == "": # Nothing to report on. + print("Not submitting to influx, no report-dir.\n") return if args.influx_host == "": # No influx configured, return. + print("Not submitting to influx, influx_host not configured.\n") return + print("Creating influxdb connection.\n") # lfjson_host would be if we are reading out of LANforge or some other REST # source, which we are not. So dummy those out. influxdb = RecordInflux(_lfjson_host = "", @@ -365,7 +374,12 @@ class cv_test(Realm): _influx_token = args.influx_token, _influx_bucket = args.influx_bucket) + path = "%s/kpi.csv"%(self.report_dir) + print("Attempt to submit kpi: ", path) csvtoinflux = CSVtoInflux(influxdb = influxdb, - target_csv = "%s/kpi.csv"%(self.report_dir), + target_csv = path, _influx_tag = args.influx_tag) + print("Posting to influx...\n") csvtoinflux.post_to_influx() + + print("All done posting to influx.\n") diff --git a/py-scripts/lf_ap_auto_test.py b/py-scripts/lf_ap_auto_test.py index d2ab444e..af503040 100755 --- a/py-scripts/lf_ap_auto_test.py +++ b/py-scripts/lf_ap_auto_test.py @@ -23,7 +23,11 @@ the options and how best to input data. --set 'Skip 2.4Ghz Tests' 1 --set 'Skip 5Ghz Tests' 1 \ --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 --set 'Band-Steering' 0 \ --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \ - --test_bed Testbed-01 + --test_rig Testbed-01 --pull_report \ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01 Note: --enable [option] will attempt to select any checkbox of that name to true. @@ -303,7 +307,11 @@ def main(): --set 'Skip 2.4Ghz Tests' 1 --set 'Skip 5Ghz Tests' 1 \ --set 'Throughput vs Pkt Size' 0 --set 'Capacity' 0 --set 'Stability' 0 --set 'Band-Steering' 0 \ --set 'Multi-Station Throughput vs Pkt Size' 0 --set 'Long-Term' 0 \ - --test_rig Testbed-01 + --test_rig Testbed-01 --pull_report \ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01 """ ) cv_add_base_parser(parser) # see cv_test_manager.py @@ -356,6 +364,7 @@ def main(): CV_Test.setup() CV_Test.run() + CV_Test.check_influx_kpi(args) if __name__ == "__main__": main() diff --git a/py-scripts/lf_wifi_capacity_test.py b/py-scripts/lf_wifi_capacity_test.py index 351199cc..a3dd5a9b 100755 --- a/py-scripts/lf_wifi_capacity_test.py +++ b/py-scripts/lf_wifi_capacity_test.py @@ -12,17 +12,16 @@ Note: This is a test file which will run a wifi capacity test. The influx part can be skipped if you are not using influx/graphana. ./lf_wifi_capacity_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name this_inst --config_name test_con --upstream 1.1.eth1 --batch_size 1 --loop_iter 1 \ - --protocol UDP-IPv4 --duration 6000 --pull_report --stations 1.1.sta0000,1.1.sta0002 \ + --instance_name this_inst --config_name test_con --upstream 1.1.eth2 --batch_size 1,5,25,50,100 --loop_iter 1 \ + --protocol UDP-IPv4 --duration 6000 --pull_report \ --test_rig Testbed-01 \ --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ - --influx_bucket ben --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000 \ - --influx_tag testbed Ferndale-01 + --influx_bucket ben --influx_tag testbed Ferndale-01 ex. on how to run this script (to create new stations): ./lf_wifi_capacity_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \ - --instance_name wct_instance --config_name wifi_config --upstream 1.1.eth1 --batch_size 1 --loop_iter 1 \ + --instance_name wct_instance --config_name wifi_config --upstream 1.1.eth1 --batch_size 1,5,25 --loop_iter 1 \ --protocol UDP-IPv4 --duration 6000 --pull_report --stations 1.1.sta0000,1.1.sta0001 \ --create_stations --radio wiphy0 --ssid test-ssid --security open --paswd [BLANK] \ --test_rig Testbed-01 @@ -468,7 +467,11 @@ def main(): --instance_name wct_instance --config_name wifi_config --upstream 1.1.eth1 --batch_size 1 --loop_iter 1 \ --protocol UDP-IPv4 --duration 6000 --pull_report --stations 1.1.sta0000,1.1.sta0001 \ --create_stations --radio wiphy0 --ssid test-ssid --security open --paswd [BLANK] \ - --test_rig Testbed-01 + --test_rig Testbed-01 \ + --influx_host c7-graphana --influx_port 8086 --influx_org Candela \ + --influx_token=-u_Wd-L8o992701QF0c5UmqEp7w7Z7YOMaWLxOMgmHfATJGnQbbmYyNxHBR9PgD6taM_tcxqJl6U8DjU1xINFQ== \ + --influx_bucket ben \ + --influx_tag testbed Ferndale-01 """) cv_add_base_parser(parser) # see cv_test_manager.py