Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
bbba8dcb
Commit
bbba8dcb
authored
Oct 17, 2018
by
Kenneth Hiemstra
Browse files
Options
Downloads
Patches
Plain Diff
Task #2404: first test version supporting UBDriver commands
parent
11e27cd0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/apertif/commissioning/executor.py
+72
-15
72 additions, 15 deletions
applications/apertif/commissioning/executor.py
with
72 additions
and
15 deletions
applications/apertif/commissioning/executor.py
+
72
−
15
View file @
bbba8dcb
...
@@ -45,7 +45,7 @@ from apertif.messaging.send_file import send_and_wait_files
...
@@ -45,7 +45,7 @@ from apertif.messaging.send_file import send_and_wait_files
from
pprint
import
pprint
from
pprint
import
pprint
def
writeParset
(
command
,
lcu_list
=
None
,
exec_time
=
'
utcnow()
'
,
args
=
[],
parset_template
=
'
low_level_parset.template
'
,
parset_path
=
'
/tmp/parset.parset
'
):
def
writeParset
(
command
,
lcu_list
=
None
,
exec_time
=
'
utcnow()
'
,
args
=
[],
parset_template
=
'
low_level_parset.template
'
,
parset_path
=
'
/tmp/parset
_executor
.parset
'
):
'''
Replace the parset template keys
'''
Replace the parset template keys
Input Arguments:
Input Arguments:
...
@@ -146,9 +146,7 @@ def verify_reply(reply, test_result=False):
...
@@ -146,9 +146,7 @@ def verify_reply(reply, test_result=False):
# Test case contains logging/printing functionality
# Test case contains logging/printing functionality
###############################################################################
###############################################################################
tc
=
test_case
.
Testcase
(
'
MAIN -
'
,
''
)
tc
=
test_case
.
Testcase
(
'
MAIN -
'
,
''
)
use_mac_str
=
'
True
'
supportedApps
=
[
'
apertif-ag
'
,
'
apertif-dev
'
,
'
arts_sc1
'
,
'
arts_sc4
'
]
supportedApps
=
[
'
apertif-ag
'
,
'
apertif-dev
'
,
'
arts_sc1
'
,
'
arts_sc4
'
]
if
tc
.
appStr
in
supportedApps
:
if
tc
.
appStr
in
supportedApps
:
...
@@ -217,7 +215,7 @@ except Exception as err:
...
@@ -217,7 +215,7 @@ except Exception as err:
if
tc
.
unbStr
==
''
:
if
tc
.
unbStr
==
''
:
print
'
Omitting call to central_status, since no XC boards are addressed.
'
print
'
Omitting call to central_status, since no XC boards are addressed.
'
else
:
else
:
cmd
=
'
. $RADIOHDL/applications/apertif/commissioning/central_status.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
telStr
+
'
'
+
tc
.
unbStr
+
'
'
+
'
precheck
'
+
'
'
+
tc
.
polStr
cmd
=
'
. $RADIOHDL/applications/apertif/commissioning/central_status.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
telStr
+
'
'
+
tc
.
unbStr
+
'
'
+
'
precheck
'
+
'
'
+
tc
.
polStr
+
'
'
+
use_mac_str
print
hostname_correlator
+
'
:$
'
+
cmd
print
hostname_correlator
+
'
:$
'
+
cmd
output
=
shell
.
ssh_cmd
(
hostname_correlator
,
cmd
,
tc
)
output
=
shell
.
ssh_cmd
(
hostname_correlator
,
cmd
,
tc
)
if
"
Error
"
in
output
or
not
"
Passed
"
in
output
:
if
"
Error
"
in
output
or
not
"
Passed
"
in
output
:
...
@@ -227,7 +225,7 @@ else:
...
@@ -227,7 +225,7 @@ else:
###############################################################################
###############################################################################
# Check if dish UniBoard systems are ready for action. If not, exit immediately.
# Check if dish UniBoard systems are ready for action. If not, exit immediately.
###############################################################################
###############################################################################
command
=
'
. $RADIOHDL/applications/apertif/commissioning/dish_status.sh
'
+
tc
.
appStr
+
'
'
+
'
precheck
'
+
'
'
+
tc
.
polStr
command
=
'
. $RADIOHDL/applications/apertif/commissioning/dish_status.sh
'
+
tc
.
appStr
+
'
'
+
'
precheck
'
+
'
'
+
tc
.
polStr
+
'
'
+
use_mac_str
for
lcu
in
LCUS
:
for
lcu
in
LCUS
:
print
lcu
+
'
:$
'
+
command
print
lcu
+
'
:$
'
+
command
output
=
(
shell
.
ssh_cmd
(
lcu
,
command
,
tc
))
output
=
(
shell
.
ssh_cmd
(
lcu
,
command
,
tc
))
...
@@ -240,13 +238,72 @@ for lcu in LCUS:
...
@@ -240,13 +238,72 @@ for lcu in LCUS:
# Run remote dish commands in background
# Run remote dish commands in background
###############################################################################
###############################################################################
print
'
POL, RUN
'
,
tc
.
polStr
,
tc
.
runStr
print
'
POL, RUN
'
,
tc
.
polStr
,
tc
.
runStr
#subcommand = '. $RADIOHDL/applications/apertif/commissioning/dish_commands.sh ' + tc.appStr + ' ' + tc.optStr + ' ' + tc.polStr + ' ' + tc.runStr + ' ' + ','.join(map(str,tc.unbNrs))
subcommand
=
'
. $RADIOHDL/applications/apertif/commissioning/dish_commands.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
optStr
+
'
'
+
tc
.
polStr
+
'
'
+
"
False
"
+
'
'
+
'
,
'
.
join
(
map
(
str
,
tc
.
unbNrs
))
+
'
'
+
use_mac_str
subcommand
=
'
. $RADIOHDL/applications/apertif/commissioning/dish_commands.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
optStr
+
'
'
+
tc
.
polStr
+
'
'
+
"
False
"
+
'
'
+
'
,
'
.
join
(
map
(
str
,
tc
.
unbNrs
))
shell
.
shell_source
(
subcommand
)
shell
.
shell_source
(
subcommand
)
#for lcu in LCUS:
# command = subcommand + ' > ~/'+lcu+'_dish_commands.log '
if
tc
.
optStr
==
'
noflash
'
:
# print lcu+':$ '+command
print
'
Continuing without BN reflash due to noflash option
'
# shell.ssh_cmd_bkgnd(lcu, command)
else
:
try
:
#hiemstra@lcu-rtx:~/svn/apertif/commissioning/trunk/test_scripts/python$ python util_send_command.py -c uniboard_writeflash --tel=x filename=/home/hiemstra/images/apertif_unb1_bn_filterbank-r18604.rbf nodelist=[6] --send
print
"
Rebooting all nodes to factory
"
arg_str
=
'
image=factory
'
parset_path
=
writeParset
(
'
uniboard_reboot
'
,
lcu_list
=
LCUS
,
args
=
[
arg_str
])
reply
=
send_and_wait_files
(
parset_path
,
timeout
=
20.0
)
reply
=
reply
[
parset_path
]
pprint
(
reply
)
verify_reply
(
reply
,
test_result
=
True
)
print
"
Flashing BN
'
s with firmware image:
"
,
os
.
getenv
(
'
IMAGE_FB
'
)
arg_str
=
'
filename=
'
+
os
.
getenv
(
'
IMAGE_FB
'
)
+
'
nodelist=[5]
'
parset_path
=
writeParset
(
'
uniboard_writeflash
'
,
lcu_list
=
LCUS
,
args
=
[
arg_str
])
reply
=
send_and_wait_files
(
parset_path
,
timeout
=
180.0
)
reply
=
reply
[
parset_path
]
pprint
(
reply
)
verify_reply
(
reply
,
test_result
=
True
)
print
"
Verifying BN
'
s with firmware image:
"
,
os
.
getenv
(
'
IMAGE_FB
'
)
arg_str
=
'
filename=
'
+
os
.
getenv
(
'
IMAGE_FB
'
)
+
'
nodelist=[5]
'
parset_path
=
writeParset
(
'
uniboard_verifyflash
'
,
lcu_list
=
LCUS
,
args
=
[
arg_str
])
reply
=
send_and_wait_files
(
parset_path
,
timeout
=
60.0
)
reply
=
reply
[
parset_path
]
pprint
(
reply
)
verify_reply
(
reply
,
test_result
=
True
)
print
"
Flashing FN
'
s with firmware image:
"
,
os
.
getenv
(
'
IMAGE_BF
'
)
arg_str
=
'
filename=
'
+
os
.
getenv
(
'
IMAGE_BF
'
)
+
'
nodelist=[1]
'
parset_path
=
writeParset
(
'
uniboard_writeflash
'
,
lcu_list
=
LCUS
,
args
=
[
arg_str
])
reply
=
send_and_wait_files
(
parset_path
,
timeout
=
180.0
)
reply
=
reply
[
parset_path
]
pprint
(
reply
)
verify_reply
(
reply
,
test_result
=
True
)
print
"
Verifying FN
'
s with firmware image:
"
,
os
.
getenv
(
'
IMAGE_BF
'
)
arg_str
=
'
filename=
'
+
os
.
getenv
(
'
IMAGE_BF
'
)
+
'
nodelist=[1]
'
parset_path
=
writeParset
(
'
uniboard_verifyflash
'
,
lcu_list
=
LCUS
,
args
=
[
arg_str
])
reply
=
send_and_wait_files
(
parset_path
,
timeout
=
60.0
)
reply
=
reply
[
parset_path
]
pprint
(
reply
)
verify_reply
(
reply
,
test_result
=
True
)
except
Exception
as
err
:
print
'
Error Signal_Control, UBDriver:
'
,
err
sys
.
exit
();
try
:
print
"
Booting:
"
parset_path
=
writeParset
(
'
uniboard_reboot
'
,
lcu_list
=
LCUS
)
reply
=
send_and_wait_files
(
parset_path
,
timeout
=
60.0
)
reply
=
reply
[
parset_path
]
pprint
(
reply
)
verify_reply
(
reply
,
test_result
=
True
)
except
Exception
as
err
:
print
'
Error Signal_Control, UBDriver:
'
,
err
sys
.
exit
();
sys
.
exit
()
###############################################################################
###############################################################################
...
@@ -255,7 +312,7 @@ shell.shell_source(subcommand)
...
@@ -255,7 +312,7 @@ shell.shell_source(subcommand)
if
tc
.
unbStr
==
''
:
if
tc
.
unbStr
==
''
:
pass
pass
else
:
else
:
subcommand
=
'
. $RADIOHDL/applications/apertif/commissioning/central_commands.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
telStr
+
'
'
+
tc
.
unbStr
+
'
'
+
tc
.
optStr
+
'
'
+
tc
.
polStr
subcommand
=
'
. $RADIOHDL/applications/apertif/commissioning/central_commands.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
telStr
+
'
'
+
tc
.
unbStr
+
'
'
+
tc
.
optStr
+
'
'
+
tc
.
polStr
+
'
'
+
use_mac_str
command
=
subcommand
+
'
| tee ~/central_commands.log
'
command
=
subcommand
+
'
| tee ~/central_commands.log
'
print
'
ccu-corr
'
+
'
:$
'
+
command
print
'
ccu-corr
'
+
'
:$
'
+
command
shell
.
ssh_cmd
(
'
ccu-corr
'
,
command
,
tc
)
shell
.
ssh_cmd
(
'
ccu-corr
'
,
command
,
tc
)
...
@@ -332,7 +389,7 @@ if tc.run == True:
...
@@ -332,7 +389,7 @@ if tc.run == True:
###############################################################################
###############################################################################
# Everything should be up and running - check dish UniBoard system
# Everything should be up and running - check dish UniBoard system
###############################################################################
###############################################################################
command
=
'
. $RADIOHDL/applications/apertif/commissioning/dish_status.sh
'
+
tc
.
appStr
+
'
'
+
'
postcheck
'
+
'
'
+
tc
.
polStr
command
=
'
. $RADIOHDL/applications/apertif/commissioning/dish_status.sh
'
+
tc
.
appStr
+
'
'
+
'
postcheck
'
+
'
'
+
tc
.
polStr
+
'
'
+
use_mac_str
for
lcu
in
LCUS
:
for
lcu
in
LCUS
:
print
lcu
+
'
:$
'
+
command
print
lcu
+
'
:$
'
+
command
output
=
(
shell
.
ssh_cmd
(
lcu
,
command
,
tc
))
output
=
(
shell
.
ssh_cmd
(
lcu
,
command
,
tc
))
...
@@ -345,7 +402,7 @@ for lcu in LCUS:
...
@@ -345,7 +402,7 @@ for lcu in LCUS:
if
tc
.
unbStr
==
''
:
if
tc
.
unbStr
==
''
:
print
'
Omitting call to central_status, since no XC boards are addressed.
'
print
'
Omitting call to central_status, since no XC boards are addressed.
'
else
:
else
:
cmd
=
'
. $RADIOHDL/applications/apertif/commissioning/central_status.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
telStr
+
'
'
+
tc
.
unbStr
+
'
'
+
'
postcheck
'
+
'
'
+
tc
.
polStr
cmd
=
'
. $RADIOHDL/applications/apertif/commissioning/central_status.sh
'
+
tc
.
appStr
+
'
'
+
tc
.
telStr
+
'
'
+
tc
.
unbStr
+
'
'
+
'
postcheck
'
+
'
'
+
tc
.
polStr
+
'
'
+
use_mac_str
print
'
ccu-corr
'
+
'
:$
'
+
cmd
print
'
ccu-corr
'
+
'
:$
'
+
cmd
output
=
shell
.
ssh_cmd
(
'
ccu-corr
'
,
cmd
,
tc
)
output
=
shell
.
ssh_cmd
(
'
ccu-corr
'
,
cmd
,
tc
)
if
"
Error
"
in
output
or
not
"
Passed
"
in
output
:
if
"
Error
"
in
output
or
not
"
Passed
"
in
output
:
...
...
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