Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv RS485 OPT RTM
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv RS485 OPT RTM
Commits
37cff16d
Commit
37cff16d
authored
Mar 04, 2019
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly handle VME management outside of individual tests
parent
f5d13a54
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
11 deletions
+118
-11
README.md
pts/README.md
+1
-1
test00.py
pts/python/tests/test00.py
+0
-4
test02.py
pts/python/tests/test02.py
+3
-6
run-pts.py
pts/run-pts.py
+114
-0
No files found.
pts/README.md
View file @
37cff16d
...
...
@@ -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
...
...
pts/python/tests/test00.py
View file @
37cff16d
...
...
@@ -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
)
###############################################################################
...
...
pts/python/tests/test02.py
View file @
37cff16d
...
...
@@ -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 ##################################
###############################################################################
...
...
pts/run-pts.
sh
→
pts/run-pts.
py
View file @
37cff16d
#!/
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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment