backup: Wire up qemu full pull backup commands over QMP
[libvirt/ericb.git] / tests / ssh.c
blob58148fef77b7f5b3f9f36fb557a77251f3e70213
1 /*
2 * Copyright (C) 2011, 2013 Red Hat, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see
16 * <http://www.gnu.org/licenses/>.
19 #include <config.h>
21 #include "internal.h"
22 #define NO_LIBVIRT /* This file intentionally does not link to libvirt */
23 #include "testutils.h"
25 #ifndef WIN32
27 int main(int argc, char **argv)
29 size_t i;
30 bool failConnect = false; /* Exit -1, with no data on stdout, msg on stderr */
31 bool dieEarly = false; /* Exit -1, with partial data on stdout, msg on stderr */
33 for (i = 1; i < argc; i++) {
34 if (STREQ(argv[i], "nosuchhost"))
35 failConnect = true;
36 else if (STREQ(argv[i], "crashinghost"))
37 dieEarly = true;
40 if (failConnect) {
41 fprintf(stderr, "%s", "Cannot connect to host nosuchhost\n");
42 return -1;
45 if (dieEarly) {
46 printf("%s\n", "Hello World");
47 fprintf(stderr, "%s", "Hangup from host\n");
48 return -1;
51 for (i = 1; i < argc; i++)
52 printf("%s%c", argv[i], i == (argc -1) ? '\n' : ' ');
54 return 0;
57 #else
59 int
60 main(void)
62 return EXIT_AM_SKIP;
65 #endif