Commit f912dbf8 authored by Christopher Turner's avatar Christopher Turner

Pass hostname and port as arguments to the script

parent a48f90e0
......@@ -4,7 +4,7 @@ import read_config as cfg
import importlib
import socket
import time
import os
import os, getopt, sys, argparse
import logging
class RunTests(object):
......@@ -102,13 +102,23 @@ def view_log(log_file_path):
f.close()
def main():
def main(argv):
timestr = time.strftime("%Y%m%d-%H%M%S")
log_file_name = os.path.join('log', "{}.log".format(timestr))
setup_logging(log_file_name)
rt = RunTests('config', '172.23.252.202', 8888) #pass in as parameter
# Argument processing
parser = argparse.ArgumentParser(
description = 'Run PandA hardware I/O tests')
parser.add_argument(
'--port', '-p', default = 8888, help = 'Configuration port number')
parser.add_argument(
'hostname', help = 'Name or IP address of Panda device')
args = parser.parse_args()
rt = RunTests('config', args.hostname, int(args.port)) #pass in as parameter
rt.run_tests()
view_log(log_file_name)
if __name__ == '__main__':
main()
\ No newline at end of file
main(sys.argv[1:])
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment