Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
60e6d5f5
Commit
60e6d5f5
authored
12 years ago
by
Menno Norden
Browse files
Options
Downloads
Patches
Plain Diff
task #1723: V18 with new options
parent
b3066281
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCU/StationTest/stationtest.py
+69
-9
69 additions, 9 deletions
LCU/StationTest/stationtest.py
with
69 additions
and
9 deletions
LCU/StationTest/stationtest.py
+
69
−
9
View file @
60e6d5f5
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#
#
# Run the tests to test a LOFAR station
# Run the tests to test a LOFAR station
# H. Meulman
# H. Meulman
# Version 0.1
4
17-feb
-2012 SVN*****
# Version 0.1
8
2-okt
-2012 SVN*****
# 24 sep: local log directory aangepast
# 24 sep: local log directory aangepast
# 27 sept: - Toevoeging delay voor tbbdriver polling
# 27 sept: - Toevoeging delay voor tbbdriver polling
...
@@ -31,7 +31,9 @@
...
@@ -31,7 +31,9 @@
# 27 jan 2012: Store logfiles in /localhome/stationtest/data in "local mode"
# 27 jan 2012: Store logfiles in /localhome/stationtest/data in "local mode"
# 17 feb 2012: Added detection of oscillating tiles.
# 17 feb 2012: Added detection of oscillating tiles.
# 9 mar 2012: Devide by 0 error solved in HBAtest
# 9 mar 2012: Devide by 0 error solved in HBAtest
# 13 sept 2012: Added for user0..9 sys.path.append("/opt/stationtest/modules")
# 13 Apr 2012: added LBAdatatest directory. Also directorys need to change permissions to work with USER0.
# 20 Apr 2012: Logging suspicious tiles and elements in HBA modem test
# 13 Sep 2012: Added for user0..9 sys.path.append("/opt/stationtest/modules")
# todo:
# todo:
# - Als meer dan 10 elementen geen rf signaal hebben, keur dan hele tile af
# - Als meer dan 10 elementen geen rf signaal hebben, keur dan hele tile af
...
@@ -69,7 +71,7 @@ factor = 30 # station statistics fault window: Antenna average + and - factor =
...
@@ -69,7 +71,7 @@ factor = 30 # station statistics fault window: Antenna average + and - factor =
InternationalStations
=
(
'
DE601C
'
,
'
DE602C
'
,
'
DE603C
'
,
'
DE604C
'
,
'
DE605C
'
,
'
FR606C
'
,
'
SE607C
'
,
'
UK608C
'
)
InternationalStations
=
(
'
DE601C
'
,
'
DE602C
'
,
'
DE603C
'
,
'
DE604C
'
,
'
DE605C
'
,
'
FR606C
'
,
'
SE607C
'
,
'
UK608C
'
)
RemoteStations
=
(
'
CS302C
'
,
'
RS106C
'
,
'
RS205C
'
,
'
RS208C
'
,
'
RS306C
'
,
'
RS307C
'
,
'
RS406C
'
,
'
RS503C
'
)
RemoteStations
=
(
'
CS302C
'
,
'
RS106C
'
,
'
RS205C
'
,
'
RS208C
'
,
'
RS306C
'
,
'
RS307C
'
,
'
RS406C
'
,
'
RS503C
'
)
CoreStations
=
(
'
CS001C
'
,
'
CS002C
'
,
'
CS003C
'
,
'
CS004C
'
,
'
CS005C
'
,
'
CS006C
'
,
'
CS007C
'
,
'
CS011C
'
,
'
CS013C
'
,
'
CS017C
'
,
'
CS021C
'
,
'
CS024C
'
,
'
CS026C
'
,
'
CS028C
'
,
'
CS030C
'
,
'
CS031
'
,
'
CS032C
'
,
'
CS101C
'
,
'
CS103C
'
,
'
CS201C
'
,
'
CS301C
'
,
'
CS401C
'
,
'
CS501C
'
)
CoreStations
=
(
'
CS001C
'
,
'
CS002C
'
,
'
CS003C
'
,
'
CS004C
'
,
'
CS005C
'
,
'
CS006C
'
,
'
CS007C
'
,
'
CS011C
'
,
'
CS013C
'
,
'
CS017C
'
,
'
CS021C
'
,
'
CS024C
'
,
'
CS026C
'
,
'
CS028C
'
,
'
CS030C
'
,
'
CS031
'
,
'
CS032C
'
,
'
CS101C
'
,
'
CS103C
'
,
'
CS201C
'
,
'
CS301C
'
,
'
CS401C
'
,
'
CS501C
'
)
NoHBAelementtestPossible
=
(
'
DE601C
'
,
'
DE602C
'
,
'
DE603C
'
,
'
DE605C
'
,
'
FR606C
'
,
'
SE607C
'
,
'
UK608C
'
)
NoHBAelementtestPossible
=
(
'
DE601C
'
,
'
DE602C
'
,
'
DE603C
'
,
'
DE605C
'
,
'
FR606C
'
,
'
SE607C
'
,
'
UK608C
'
)
#
NoHBANaStestPossible
=
(
''
)
NoHBANaStestPossible
=
(
''
)
HBASubband
=
dict
(
DE601C
=
155
,
\
HBASubband
=
dict
(
DE601C
=
155
,
\
DE602C
=
155
,
\
DE602C
=
155
,
\
...
@@ -77,7 +79,7 @@ HBASubband = dict( DE601C=155,\
...
@@ -77,7 +79,7 @@ HBASubband = dict( DE601C=155,\
DE604C
=
474
,
\
DE604C
=
474
,
\
DE605C
=
479
,
\
DE605C
=
479
,
\
FR606C
=
155
,
\
FR606C
=
155
,
\
SE607C
=
155
,
\
SE607C
=
287
,
\
UK608C
=
155
)
UK608C
=
155
)
# Do not change:
# Do not change:
...
@@ -340,7 +342,7 @@ def GotoSwlevel2():
...
@@ -340,7 +342,7 @@ def GotoSwlevel2():
time
.
sleep
(
120
)
time
.
sleep
(
120
)
res
=
os
.
popen3
(
'
rspctl --datastream=0
'
)[
1
].
readlines
()
res
=
os
.
popen3
(
'
rspctl --datastream=0
'
)[
1
].
readlines
()
print
res
print
res
#
time.sleep(90) # Tijdelijk toe gevoegd voor nieuwe tbbdriver. Deze loopt vast tijdens pollen
#
time.sleep(90) # Tijdelijk toe gevoegd voor nieuwe tbbdriver. Deze loopt vast tijdens pollen
# CheckTBB() # Tijdelijk weg gelaten voor nieuwe tbbdriver. Deze loopt vast tijdens pollen
# CheckTBB() # Tijdelijk weg gelaten voor nieuwe tbbdriver. Deze loopt vast tijdens pollen
#fromprg.close()
#fromprg.close()
break
break
...
@@ -714,10 +716,13 @@ def CheckRSPVersion():
...
@@ -714,10 +716,13 @@ def CheckRSPVersion():
RSPgold
=
open
(
RSPgoldfile
,
'
r
'
).
readlines
()
# Read RSP Version gold
RSPgold
=
open
(
RSPgoldfile
,
'
r
'
).
readlines
()
# Read RSP Version gold
RSPversion
=
os
.
popen3
(
'
rspctl --version
'
)[
1
].
readlines
()
# Get RSP Versions
RSPversion
=
os
.
popen3
(
'
rspctl --version
'
)[
1
].
readlines
()
# Get RSP Versions
# res = cli.command('./rsp_version.sh')
# res = cli.command('./rsp_version.sh')
# debug=1
if
debug
:
if
debug
:
print
(
'
RSPgold =
'
,
RSPgold
)
for
RSPnumber
in
range
(
len
(
RSPgold
)):
for
RSPnumber
in
range
(
len
(
RSPgold
)):
if
RSPgold
[
RSPnumber
]
==
RSPversion
[
RSPnumber
]:
print
(
'
RSP OK =
'
,
RSPnumber
)
if
RSPgold
[
RSPnumber
]
==
RSPversion
[
RSPnumber
]:
print
(
'
RSP OK =
'
,
RSPnumber
)
else
:
print
(
'
RSPNOK =
'
,
RSPnumber
)
else
:
print
(
'
RSPNOK =
'
,
RSPnumber
)
# debug=0
# store subreck testlog
# store subreck testlog
for
RSPnumber
in
range
(
len
(
RSPgold
)):
for
RSPnumber
in
range
(
len
(
RSPgold
)):
if
RSPgold
[
RSPnumber
]
!=
RSPversion
[
RSPnumber
]:
if
RSPgold
[
RSPnumber
]
!=
RSPversion
[
RSPnumber
]:
...
@@ -1240,7 +1245,7 @@ def LBAtest():
...
@@ -1240,7 +1245,7 @@ def LBAtest():
SeverityOfThisTest
=
2
SeverityOfThisTest
=
2
PriorityOfThisTest
=
2
PriorityOfThisTest
=
2
debug
=
0
#
debug=
1
global
Severity
global
Severity
global
Priority
global
Priority
...
@@ -1249,7 +1254,8 @@ def LBAtest():
...
@@ -1249,7 +1254,8 @@ def LBAtest():
sr
.
setId
(
'
LBAmd1>:
'
)
sr
.
setId
(
'
LBAmd1>:
'
)
sub_time
=
[]
sub_time
=
[]
sub_file
=
[]
sub_file
=
[]
dir_name
=
'
./lbadatatest/
'
#Work directory will be cleaned
# dir_name = './lbadatatest/' #Work directory will be cleaned
dir_name
=
'
/opt/stationtest/test/hbatest/lbadatatest/
'
#Work directory will be cleaned
if
not
(
os
.
path
.
exists
(
dir_name
)):
if
not
(
os
.
path
.
exists
(
dir_name
)):
os
.
mkdir
(
dir_name
)
os
.
mkdir
(
dir_name
)
rmfile
=
'
*.log
'
rmfile
=
'
*.log
'
...
@@ -1561,7 +1567,7 @@ def HBAModemTest():
...
@@ -1561,7 +1567,7 @@ def HBAModemTest():
global
Priority
global
Priority
global
ModemFail
global
ModemFail
debug
=
0
#
debug=
1
sr
.
setId
(
'
HBAmdt>:
'
)
sr
.
setId
(
'
HBAmdt>:
'
)
print
(
'
HBA ModemTest
'
)
print
(
'
HBA ModemTest
'
)
...
@@ -1605,6 +1611,61 @@ def HBAModemTest():
...
@@ -1605,6 +1611,61 @@ def HBAModemTest():
count
+=
1
count
+=
1
ModemFail
[
TileNr
]
=
1
# global variabele om in HBA element test de RF meting over te slaan.
ModemFail
[
TileNr
]
=
1
# global variabele om in HBA element test de RF meting over te slaan.
#
if
(
count
>
10
and
isodd
(
RCUNr
)):
#Als er meer dan 10 fouten in zitten, keur dan hele tile af!
print
(
'
Tile %s - RCU %s; Broken. No modem communication
'
%
(
TileNr
,
RCUNr
))
# store station testlog
#if debug: print ('ModemFail = ',ModemFail)
if
Severity
<
SeverityOfThisTest
:
Severity
=
SeverityOfThisTest
if
Priority
<
PriorityOfThisTest
:
Priority
=
PriorityOfThisTest
st_log
.
write
(
'
HBAmdt>: Sv=%s Pr=%s, Tile %s - RCU %s; Suspicious.
\n
'
%
(
SeverityLevel
[
SeverityOfThisTest
],
PriorityLevel
[
PriorityOfThisTest
],
TileNr
,
RCUNr
))
sr
.
setResult
(
'
FAILED
'
)
else
:
#Anders keur elementen af als fout.
for
ElementNumber
in
range
(
4
,
20
):
if
(
ModemReply
[
ElementNumber
]
!=
ModemReplyGold
[
ElementNumber
]
and
isodd
(
RCUNr
)):
print
(
'
Tile %s - RCU %s; Element %s; Suspicious. : (%s, %s)
'
%
(
TileNr
,
RCUNr
,
ElementNumber
-
3
,
ModemReply
[
ElementNumber
],
ModemReplyGold
[
ElementNumber
]))
# store station testlog
if
Severity
<
SeverityOfThisTest
:
Severity
=
SeverityOfThisTest
if
Priority
<
PriorityOfThisTest
:
Priority
=
PriorityOfThisTest
st_log
.
write
(
'
HBAmdt>: Sv=%s Pr=%s, Tile %s - RCU %s; Element %s Suspicious. : (%s, %s)
\n
'
%
(
SeverityLevel
[
SeverityOfThisTest
],
PriorityLevel
[
PriorityOfThisTest
],
TileNr
,
RCUNr
,
ElementNumber
-
3
,
ModemReply
[
ElementNumber
],
ModemReplyGold
[
ElementNumber
]))
sr
.
setResult
(
'
FAILED
'
)
# print ('ModemFail = ',ModemFail)
try
:
f
=
open
(
'
/opt/stationtest/test/hbatest/hba_modem3.log
'
,
'
rb
'
)
except
:
print
(
'
Import error
'
)
if
Severity
<
SeverityOfThisTest
:
Severity
=
SeverityOfThisTest
if
Priority
<
PriorityOfThisTest
:
Priority
=
PriorityOfThisTest
st_log
.
write
(
'
HBAmdt>: Sv=%s Pr=%s, No modem-logfile found!
\n
'
%
(
SeverityLevel
[
SeverityOfThisTest
],
PriorityLevel
[
PriorityOfThisTest
]))
return
time
.
sleep
(
1
)
for
line
in
f
:
ModemReply
=
line
ModemReplyGold
=
[
'
HBA
'
,
'
95
'
,
'
real
'
,
'
delays=
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
,
'
253
'
]
if
debug
:
print
(
'
line =
'
,
line
[
0
])
if
line
[
0
]
==
'
H
'
:
# Check of regel geldig is!
ModemReply
=
line
.
replace
(
'
[
'
,
'
'
).
replace
(
'
].
'
,
'
'
).
split
()
RCUNr
=
int
(
ModemReply
[
1
])
TileNr
=
RCUNr
/
2
if
debug
:
print
(
'
line =
'
,
line
)
print
(
'
ModemReply =
'
,
ModemReply
)
print
(
'
ModemReplyGold =
'
,
ModemReplyGold
)
print
(
'
RCUNr =
'
,
RCUNr
)
print
(
'
TileNr =
'
,
TileNr
)
# Check if HBA modems work!
count
=
0
for
ElementNumber
in
range
(
4
,
20
):
# print ModemReplyGold[ElementNumber]
if
ModemReply
[
ElementNumber
]
!=
ModemReplyGold
[
ElementNumber
]:
count
+=
1
ModemFail
[
TileNr
]
=
1
# global variabele om in HBA element test de RF meting over te slaan.
#
#
if
(
count
>
10
and
isodd
(
RCUNr
)):
#Als er meer dan 10 fouten in zitten, keur dan hele tile af!
if
(
count
>
10
and
isodd
(
RCUNr
)):
#Als er meer dan 10 fouten in zitten, keur dan hele tile af!
print
(
'
Tile %s - RCU %s; Broken. No modem communication
'
%
(
TileNr
,
RCUNr
))
print
(
'
Tile %s - RCU %s; Broken. No modem communication
'
%
(
TileNr
,
RCUNr
))
...
@@ -1626,7 +1687,6 @@ def HBAModemTest():
...
@@ -1626,7 +1687,6 @@ def HBAModemTest():
st_log
.
write
(
'
HBAmdt>: Sv=%s Pr=%s, Tile %s - RCU %s; Element %s Broken. No modem communication : (%s, %s)
\n
'
%
(
SeverityLevel
[
SeverityOfThisTest
],
PriorityLevel
[
PriorityOfThisTest
],
TileNr
,
RCUNr
,
ElementNumber
-
3
,
ModemReply
[
ElementNumber
],
ModemReplyGold
[
ElementNumber
]))
st_log
.
write
(
'
HBAmdt>: Sv=%s Pr=%s, Tile %s - RCU %s; Element %s Broken. No modem communication : (%s, %s)
\n
'
%
(
SeverityLevel
[
SeverityOfThisTest
],
PriorityLevel
[
PriorityOfThisTest
],
TileNr
,
RCUNr
,
ElementNumber
-
3
,
ModemReply
[
ElementNumber
],
ModemReplyGold
[
ElementNumber
]))
sr
.
setResult
(
'
FAILED
'
)
sr
.
setResult
(
'
FAILED
'
)
# print ('ModemFail = ',ModemFail)
# print ('ModemFail = ',ModemFail)
return
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment