diff --git a/applications/apertif/commissioning/main.py b/applications/apertif/commissioning/main.py index a9b8dc1ccb34fc03ef6e5d25abb5981c7bb76b5f..4ac3f1b7b8a114fa932c5670bbfb14f8b8adcb2e 100644 --- a/applications/apertif/commissioning/main.py +++ b/applications/apertif/commissioning/main.py @@ -47,8 +47,6 @@ import sys tc = test_case.Testcase('MAIN - ', '') - - supportedApps = ['apertif-ag', 'apertif-dev', 'arts_sc1', 'arts_sc4', 'arts_sc4-iab'] if tc.appStr in supportedApps: app_str = 'Application: ' + tc.appStr @@ -66,8 +64,11 @@ for tel in tc.telStrList: lcu_str = lcu_str + ' lcu-rt' + str(tel) + ',' tc.append_log(1, lcu_str[:-1]) -unb_str = 'Targetting UniBoards: ' + str(tc.unbStr) -tc.append_log(1, unb_str) +unb1_str = 'Targetting UniBoards: ' + str(tc.unb1Str) +tc.append_log(1, unb1_str) + +unb2_str = 'Targetting UniBoards2: ' + str(tc.unb2Str) +tc.append_log(1, unb2_str) #tc.polStr #tc.polNrs @@ -88,16 +89,32 @@ print 'UNBS_BF = ' + UNBS_BF ############################################################################### # 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.' 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 output = shell.ssh_cmd('ccu-corr', cmd, tc) if "Error" in output or not "Passed" in output: print "Exiting due to central errors" 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. ############################################################################### @@ -122,14 +139,28 @@ for lcu in LCUS: ############################################################################### # Run central commands in foreground ############################################################################### -if tc.unbStr == '': +if tc.unb1Str == '': pass 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 ' print 'ccu-corr'+':$ '+command 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 ############################################################################### @@ -147,7 +178,7 @@ for lcu in LCUS: # Reset the XAUI cores in the front end Apertif beam former and at central UniBoards ############################################################################### time.sleep(1) -if tc.unbStr == '': +if tc.unb1Str == '': print 'Omitting xaui reset, since no XC boards are addressed.' else: cmd = 'python $UPE/peripherals/pi_tr_xaui.py --unb ' + UNBS_BF + ' --fn 0:3 -r 0:2 --reg reset_control_status=3' @@ -189,7 +220,6 @@ for lcu in LCUS: cmd = 'python $UPE/peripherals/util_dp_xonoff.py --unb ' + str(offset+4) + ' --fn ' + str(unb % 4) + ' -v 5 -s OUTPUT -n 2' shell.ssh_cmd(lcu, cmd, tc) - ############################################################################### # Enable data path if this is not a re-run @@ -241,13 +271,27 @@ for lcu in LCUS: ############################################################################### # 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.' 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 output = shell.ssh_cmd('ccu-corr', cmd, tc) if "Error" in output or not "Passed" in output: 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"