Persist variables to file (~/.whenjobs/variables).
[whenjobs.git] / tests / jobs / t103_whisper.ml
1 (* whenjobs
2  * Copyright (C) 2012 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *)
18
19 when state == "" :
20 <<
21   whenjobs --set state=A
22 >>
23
24 when state == "A" :
25 <<
26   echo state A >\> $HOME/test_output
27   sleep 1
28   whenjobs --set state=B
29 >>
30
31 when state == "B" :
32 <<
33   echo state B >\> $HOME/test_output
34   sleep 1
35   # This shouldn't cause state A to run:
36   whenjobs --whisper state=A
37   sleep 1
38   whenjobs --set state=C
39 >>
40
41 when state == "C":
42 <<
43   echo state C >\> $HOME/test_output
44   sleep 1
45   # This shouldn't cause state B to run:
46   whenjobs --whisper state=B
47   sleep 1
48   whenjobs --set state=D
49 >>
50
51 when state == "D":
52 <<
53   echo state D >\> $HOME/test_output
54   sleep 1
55   whenjobs --daemon-stop
56 >>