###############################################################################
#                                                                             #
#  TakTuk, a middleware for adaptive large scale parallel remote executions   #
#  deployment. Perl implementation, copyright(C) 2006 Guillaume Huard.        #
#                                                                             #
#  This program is free software; you can redistribute it and/or modify       #
#  it under the terms of the GNU General Public License as published by       #
#  the Free Software Foundation; either version 2 of the License, or          #
#  (at your option) any later version.                                        #
#                                                                             #
#  This program is distributed in the hope that it will be useful,            #
#  but WITHOUT ANY WARRANTY; without even the implied warranty of             #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
#  GNU General Public License for more details.                               #
#                                                                             #
#  You should have received a copy of the GNU General Public License          #
#  along with this program; if not, write to the Free Software                #
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA #
#                                                                             #
#  Contact: Guillaume.Huard@imag.fr                                           #
#           ENSIMAG - Laboratoire ID                                          #
#           51 avenue Jean Kuntzmann                                          #
#           38330 Montbonnot Saint Martin                                     #
#                                                                             #
###############################################################################

0:TITLE:TAKTUK COMMANDS TESTS

1:TITLE:RANK, batch, no propagation
1:CMD:$TAKTUK `generate_hosts 10`
 :RAW:    broadcast exec [ echo \$TAKTUK_RANK ]

2:TITLE:RANK, interactive, propagation
2:RAW:echo 'broadcast exec [ echo $TAKTUK_RANK ]' |
 :CMD:    $TAKTUK_RELATIVE -s `generate_hosts 10`

3:TITLE:ASYNC, delayed input to broadcasted perl execution
3:INC:ma_fonction.sh
3:CMD:"ma_fonction | $TAKTUK `generate_hosts 5` broadcast exec [ perl -- - ], network state    ,, broadcast input file [ - ]  , q"

4:TITLE:SET SPECIFICATIONS (batch)
4:CMD:$TAKTUK `generate_hosts 10`
 :RAW:    1-3/5/7-8/10 exec { echo \$TAKTUK_RANK }

5:TITLE:SET SPECIFICATIONS (interactive)
5:INC:echo_commands.sh
5:CMD:"echo_commands | $TAKTUK `generate_hosts 10`"

6:TITLE:TIMEOUTS, simple triggered TERM signal on timeout
6:CMD:$TAKTUK `generate_hosts 3` broadcast exec timeout 1 [ sleep 5 ]

7:TITLE:TIMEOUTS, simple untriggered timeout
7:CMD:$TAKTUK `generate_hosts 3`
 :RAW:    broadcast exec timeout 2 [ sleep 1 ]\; broadcast exec [ sleep 3 ]

8:TITLE:TIMEOUTS, simple triggered KILL signal and action on timeout
8:CMD:$TAKTUK `generate_hosts 3`
 :RAW:    broadcast exec timeout 1 action exec [ "echo \$TAKTUK_PID: TakTuk m\\'a tuer" ] kill 9 [ sleep 5 ]

9:TITLE:TIMEOUTS, complex mixed test
9:CMD:$TAKTUK `generate_hosts 3`
 :RAW:    1 exec timeout 1 action exec [ echo message1 ] action version kill 9 kill 15 [ sleep 3 ]\; 2 exec timeout 2 action exec [ echo message2 ] [ sleep 1 ]\; broadcast exec [ sleep 3 ]

