3 # Copyright (C) 2011 Red Hat Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 # Test guestfish events.
25 ../fish/guestfish -a /dev/null <<'EOF' | grep -v get_verbose | grep -v get_trace | grep -v 'library .*0x' > test.out
28 event ev1 * "echo $EVENT $@"
29 event ev1 * "echo $EVENT $@"
30 event ev2 * "echo $EVENT $@"
38 event ev1 close,subprocess_quit "echo $EVENT $@"
39 event ev2 close,subprocess_quit "echo $EVENT $@"
40 event ev3 launch "echo $EVENT $@"
52 if [ "$(cat test.out)" != '"ev1" (0): *: echo $EVENT $@
53 "ev1" (1): *: echo $EVENT $@
54 "ev2" (2): *: echo $EVENT $@
55 "ev2" (2): *: echo $EVENT $@
58 trace get_autosync = 1
61 trace get_path = "../appliance"
67 "ev1" (0): close,subprocess_quit: echo $EVENT $@
68 "ev2" (1): close,subprocess_quit: echo $EVENT $@
69 "ev3" (2): launch_done: echo $EVENT $@
70 "ev1" (0): close,subprocess_quit: echo $EVENT $@
71 "ev2" (1): close,subprocess_quit: echo $EVENT $@
72 "ev3" (2): launch_done: echo $EVENT $@
73 "ev2" (1): close,subprocess_quit: echo $EVENT $@
74 "ev3" (2): launch_done: echo $EVENT $@
75 "ev2" (1): close,subprocess_quit: echo $EVENT $@
77 echo "$0: unexpected output from guestfish events"