Commit 37cff16d authored by Dimitris Lampridis's avatar Dimitris Lampridis

properly handle VME management outside of individual tests

parent f5d13a54
......@@ -6,7 +6,7 @@ To configure it, please edit directly the file `CONFIG.ini`. In particular, plea
you have set `CpuUserName` to an account name you have access to on the Front-End Computer (FEC)
that is hosting the Central Timing Receiver (CTR) cards.
To run it, simply run the `run-pts.sh` script.
To run it, simply run the `run-pts.py` python script.
**Dependencies:**
- snmp
......
......@@ -61,10 +61,6 @@ def main (card=None, default_directory='.',suite=None, serial=""):
user = config['DUT.FEC']['MgtUserName']
pwrd = config['DUT.FEC']['MgtPassword']
# Turn on VME crate
os.popen("snmpset -v2c -c %s %s 1.3.6.1.4.1.37968.1.1.7.2.1.3.1 i 0" % (pwrd, ip))
time.sleep(10)
dut = vv_skt.SKT(lun, ip, port, user, pwrd)
###############################################################################
......
......@@ -74,9 +74,6 @@ def main (card=None, default_directory='.',suite=None, serial=""):
port = int(config['CTR.FEC']['CpuPort'])
user = config['CTR.FEC']['CpuUserName']
mgt_ip = config['DUT.FEC']['MgtHostName']
mgt_pwrd = config['DUT.FEC']['MgtPassword']
ms1 = [0, 0, 0, 0]
pll1 = [0, 0, 0, 0]
miss1 = [0, 0, 0, 0]
......@@ -93,6 +90,9 @@ def main (card=None, default_directory='.',suite=None, serial=""):
test_results['PLL errors'] = 1
test_results['Missed errors'] = 1
util.user_msg("---> Please make sure that the CTR FEC is powered on and has finished booting and then press [ENTER]")
ret = raw_input("")
###############################################################################
############################ actual test ######################################
###############################################################################
......@@ -118,9 +118,6 @@ def main (card=None, default_directory='.',suite=None, serial=""):
test_results['Missed errors'] = 0
util.err_msg("Module %s: Missed errors detected ({%s} != {%s})"%(i+1, miss2[i], miss1[i]))
# Turn off VME crate
os.popen("snmpset -v2c -c %s %s 1.3.6.1.4.1.37968.1.1.7.2.1.3.1 i 1" % (mgt_pwrd, mgt_ip))
###############################################################################
########################## result processing ##################################
###############################################################################
......
#!/bin/sh
#!/usr/bin/env python
################################################################################
## CERN BE-CO-HT
## CONV-RS485-OPT-RTM
## https://www.ohwr.org/projects/conv-rs485-opt-rtm
################################################################################
##
## unit name: run-pts.sh
## unit name: run-pts.py
##
## description: Top level script to run the full PTS of the CONV-RS485-OPT-RTM.
##
......@@ -29,48 +29,86 @@
## SPDX-License-Identifier: GPL-3.0-or-later
################################################################################
BOARD="OptRtm"
import os
import subprocess
import sys
import errno
import time
import configparser
LOGDIR=`pwd`"/log/"
BOARD = "OptRtm"
LOGDIR = os.path.abspath('log')
mkdir -p "$LOGDIR"
config = configparser.ConfigParser()
config.read('CONFIG.ini')
serial=0000
extra_serial=0000
ip = config['DUT.FEC']['MgtHostName']
pwrd = config['DUT.FEC']['MgtPassword']
serial=$1
if [ x$1 = x"" ]; then
echo -n "Please scan CERN serial number bar-code, then press [ENTER]: "
read serial
fi
# Turn off DUT.FEC
fd = os.popen("snmpset -v2c -c %s %s 1.3.6.1.4.1.37968.1.1.7.2.1.3.1 i 1" % (pwrd, ip))
ret = fd.close()
if (ret != None):
print "ERROR accessing DUT.FEC over SNMP, exiting..."
sys.exit(ret >> 8)
time.sleep(2)
if [ x$serial = x"" ]; then
serial=0000
fi
try:
os.makedirs(LOGDIR)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(LOGDIR):
pass
else:
raise
extra_serial=$2
if [ x$2 = x"" ]; then
echo -n "If needed input extra serial number and press [ENTER]"\
"OR just press [ENTER]: "
read extra_serial
fi
serial = "0000"
if [ x$extra_serial = x"" ]; then
extra_serial=0000
fi
if (len(sys.argv) > 1):
serial = sys.argv[1]
else:
serial = raw_input(
"Please scan CERN serial number bar-code, then press [ENTER]: ")
echo
if (serial == ""):
serial = "0000"
board_plugged=$3
echo -n "---> Now please plug in the board and then press [ENTER]"
read board_plugged
if (len(sys.argv) > 2):
extra_serial = sys.argv[2]
else:
extra_serial = raw_input(
"If needed input extra serial number and press [ENTER] OR just press [ENTER]: ")
if (extra_serial == ""):
extra_serial = "0000"
print
board_plugged = raw_input("---> Now please plug in the board and then press [ENTER]")
# Turn on DUT.FEC
fd = os.popen("snmpset -v2c -c %s %s 1.3.6.1.4.1.37968.1.1.7.2.1.3.1 i 0" % (pwrd, ip))
ret = fd.close()
if (ret != None):
print "ERROR accessing DUT.FEC over SNMP, exiting..."
sys.exit(ret >> 8)
time.sleep(10)
# run tests
cd python
python pts.py -b $BOARD -s $serial -e $extra_serial -l $LOGDIR 00 01 02
cd ..
echo
echo "---------------"
echo
echo "End of the test"
os.chdir('python')
cmd = 'python pts.py -b {0} -s {1} -e {2} -l {3} 00 01 02'.format(
BOARD, serial, extra_serial, LOGDIR)
subprocess.call(cmd, shell = True)
os.chdir('..')
# Turn off DUT.FEC
fd = os.popen("snmpset -v2c -c %s %s 1.3.6.1.4.1.37968.1.1.7.2.1.3.1 i 1" % (pwrd, ip))
ret = fd.close()
if (ret != None):
print "ERROR accessing DUT.FEC over SNMP, exiting..."
sys.exit(ret >> 8)
time.sleep(2)
print
print "---------------"
print
print "End of the test"
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