summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-23 21:37:59 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-23 21:41:47 +0100
commit2b059535b19125ca082f4354a7ff73f4f5a33822 (patch)
tree21c9bba9c7182621f010b3790298943b1fcb737f
parent941ec968b8a1d6f891d30631a8ddb1e23e427b99 (diff)
downloadlibguestfs-2b059535b19125ca082f4354a7ff73f4f5a33822.tar.gz
libguestfs-2b059535b19125ca082f4354a7ff73f4f5a33822.tar.xz
libguestfs-2b059535b19125ca082f4354a7ff73f4f5a33822.zip
tests: Skip regression test for 790721 if attach-method is not 'appliance'.
-rw-r--r--tests/regressions/rhbz790721.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/regressions/rhbz790721.c b/tests/regressions/rhbz790721.c
index bcb5820d..844631ff 100644
--- a/tests/regressions/rhbz790721.c
+++ b/tests/regressions/rhbz790721.c
@@ -43,6 +43,8 @@
#include "guestfs.h"
+#define STRNEQ(a,b) (strcmp((a),(b)) != 0)
+
/* Number of worker threads running the test. */
#define NR_THREADS 20
@@ -55,6 +57,29 @@ main (int argc, char *argv[])
pthread_t thread[NR_THREADS];
int data[NR_THREADS];
int i, r, errors;
+ guestfs_h *g;
+ char *attach_method;
+
+ /* Test is only meaningful if the attach-method "appliance" is used. */
+ g = guestfs_create ();
+ if (!g) {
+ perror ("guestfs_create");
+ exit (EXIT_FAILURE);
+ }
+ attach_method = guestfs_get_attach_method (g);
+ if (attach_method == NULL) {
+ guestfs_close (g);
+ exit (EXIT_FAILURE);
+ }
+ if (STRNEQ (attach_method, "appliance")) {
+ fprintf (stderr, "%s: test skipped because attach method isn't 'appliance'.\n",
+ argv[0]);
+ free (attach_method);
+ guestfs_close (g);
+ exit (77);
+ }
+ free (attach_method);
+ guestfs_close (g);
/* Ensure error messages are not translated. */
setenv ("LC_ALL", "C", 1);