Skip to content
Snippets Groups Projects
Commit ece9b5da authored by Pieter Donker's avatar Pieter Donker
Browse files

#2995: changed main.py to use central_status_unb2.sh and central_commands_unb2.sh

parent d93ba191
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,6 @@ import sys ...@@ -47,8 +47,6 @@ import sys
tc = test_case.Testcase('MAIN - ', '') tc = test_case.Testcase('MAIN - ', '')
supportedApps = ['apertif-ag', 'apertif-dev', 'arts_sc1', 'arts_sc4', 'arts_sc4-iab'] supportedApps = ['apertif-ag', 'apertif-dev', 'arts_sc1', 'arts_sc4', 'arts_sc4-iab']
if tc.appStr in supportedApps: if tc.appStr in supportedApps:
app_str = 'Application: ' + tc.appStr app_str = 'Application: ' + tc.appStr
...@@ -66,8 +64,11 @@ for tel in tc.telStrList: ...@@ -66,8 +64,11 @@ for tel in tc.telStrList:
lcu_str = lcu_str + ' lcu-rt' + str(tel) + ',' lcu_str = lcu_str + ' lcu-rt' + str(tel) + ','
tc.append_log(1, lcu_str[:-1]) tc.append_log(1, lcu_str[:-1])
unb_str = 'Targetting UniBoards: ' + str(tc.unbStr) unb1_str = 'Targetting UniBoards: ' + str(tc.unb1Str)
tc.append_log(1, unb_str) tc.append_log(1, unb1_str)
unb2_str = 'Targetting UniBoards2: ' + str(tc.unb2Str)
tc.append_log(1, unb2_str)
#tc.polStr #tc.polStr
#tc.polNrs #tc.polNrs
...@@ -88,16 +89,32 @@ print 'UNBS_BF = ' + UNBS_BF ...@@ -88,16 +89,32 @@ print 'UNBS_BF = ' + UNBS_BF
############################################################################### ###############################################################################
# Check if central UniBoard system is ready for action. If not, exit immediately. # Check if central UniBoard system is ready for action. If not, exit immediately.
############################################################################### ###############################################################################
if tc.unbStr == '': if tc.unb1Str == '':
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.unb1Str + ' ' + 'precheck' + ' ' + tc.polStr
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:
print "Exiting due to central errors" print "Exiting due to central errors"
sys.exit() sys.exit()
###############################################################################
# Check if central UniBoard system is ready for action. If not, exit immediately.
###############################################################################
if tc.unb1Str == '':
print 'Omitting call to central_status_unb2, since no XC or UNB2 boards are addressed.'
else:
if tc.unb2Str == '':
cmd = '. $RADIOHDL/applications/apertif/commissioning/central_status_unb2.sh ' + tc.appStr + ' ' + tc.telStr + ' ' + '16,17,18,19' + ' ' + 'precheck' + ' ' + tc.polStr
else:
cmd = '. $RADIOHDL/applications/apertif/commissioning/central_status_unb2.sh ' + tc.appStr + ' ' + tc.telStr + ' ' + tc.unb2Str + ' ' + 'precheck' + ' ' + tc.polStr
print 'ccu-corr'+':$ '+cmd
output = shell.ssh_cmd('ccu-corr', cmd, tc)
if "Error" in output or not "Passed" in output:
print "Exiting due to central uniboard2 errors"
sys.exit()
############################################################################### ###############################################################################
# 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.
############################################################################### ###############################################################################
...@@ -122,14 +139,28 @@ for lcu in LCUS: ...@@ -122,14 +139,28 @@ for lcu in LCUS:
############################################################################### ###############################################################################
# Run central commands in foreground # Run central commands in foreground
############################################################################### ###############################################################################
if tc.unbStr == '': if tc.unb1Str == '':
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.unb1Str + ' ' + tc.optStr + ' ' + tc.polStr
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)
###############################################################################
# Run central commands for unb2 in foreground
###############################################################################
if tc.unb1Str == '':
pass
else:
if tc.unb2Str == '':
subcommand = '. $RADIOHDL/applications/apertif/commissioning/central_commands_unb2.sh ' + tc.appStr + ' ' + tc.telStr + ' ' + '16,17,18,19' + ' ' + tc.optStr + ' ' + tc.polStr
else:
subcommand = '. $RADIOHDL/applications/apertif/commissioning/central_commands_unb2.sh ' + tc.appStr + ' ' + tc.telStr + ' ' + tc.unb2Str + ' ' + tc.optStr + ' ' + tc.polStr
command = subcommand + ' | tee ~/central_commands_unb2.log '
print 'ccu-corr'+':$ '+command
shell.ssh_cmd('ccu-corr', command, tc)
############################################################################### ###############################################################################
# Wait until remote dish commands are done # Wait until remote dish commands are done
############################################################################### ###############################################################################
...@@ -147,7 +178,7 @@ for lcu in LCUS: ...@@ -147,7 +178,7 @@ for lcu in LCUS:
# Reset the XAUI cores in the front end Apertif beam former and at central UniBoards # Reset the XAUI cores in the front end Apertif beam former and at central UniBoards
############################################################################### ###############################################################################
time.sleep(1) time.sleep(1)
if tc.unbStr == '': if tc.unb1Str == '':
print 'Omitting xaui reset, since no XC boards are addressed.' print 'Omitting xaui reset, since no XC boards are addressed.'
else: else:
cmd = 'python $UPE/peripherals/pi_tr_xaui.py --unb ' + UNBS_BF + ' --fn 0:3 -r 0:2 --reg reset_control_status=3' cmd = 'python $UPE/peripherals/pi_tr_xaui.py --unb ' + UNBS_BF + ' --fn 0:3 -r 0:2 --reg reset_control_status=3'
...@@ -190,7 +221,6 @@ for lcu in LCUS: ...@@ -190,7 +221,6 @@ for lcu in LCUS:
shell.ssh_cmd(lcu, cmd, tc) shell.ssh_cmd(lcu, cmd, tc)
############################################################################### ###############################################################################
# Enable data path if this is not a re-run # Enable data path if this is not a re-run
############################################################################### ###############################################################################
...@@ -241,13 +271,27 @@ for lcu in LCUS: ...@@ -241,13 +271,27 @@ for lcu in LCUS:
############################################################################### ###############################################################################
# Everything should be up and running - check central UniBoard system # Everything should be up and running - check central UniBoard system
############################################################################### ###############################################################################
if tc.unbStr == '': if tc.unb1Str == '':
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.unb1Str + ' ' + 'postcheck' + ' ' + tc.polStr
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:
print "Found post-command central errors" print "Found post-command central errors"
###############################################################################
# Everything should be up and running - check central UniBoard2 system
###############################################################################
if tc.unb1Str == '':
print 'Omitting call to central_status_unb2, since no XC or unb2 boards are addressed.'
else:
if tc.unb2Str == '':
cmd = '. $RADIOHDL/applications/apertif/commissioning/central_status_unb2.sh ' + tc.appStr + ' ' + tc.telStr + ' ' + '16,17,18,19' + ' ' + 'postcheck' + ' ' + tc.polStr
else:
cmd = '. $RADIOHDL/applications/apertif/commissioning/central_status_unb2.sh ' + tc.appStr + ' ' + tc.telStr + ' ' + tc.unb2Str + ' ' + 'postcheck' + ' ' + tc.polStr
print 'ccu-corr'+':$ '+cmd
output = shell.ssh_cmd('ccu-corr', cmd, tc)
if "Error" in output or not "Passed" in output:
print "Found post-command central errors"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment