run-report: Use libtool wrapper to spawn the sessiond for tests
authorChristian Babeux <christian.babeux@efficios.com>
Tue, 18 Dec 2012 21:31:14 +0000 (16:31 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 18 Dec 2012 21:47:52 +0000 (16:47 -0500)
The run-report script was using the sessiond binary generated via
libtool under the ".libs/" folder. When using this binary, the consumerd
used when starting the sessiond is the one installed system-wide (if
any). This could lead to tests failures if no consumer are installed in
the system or any version mismatch occurs.

This commit fix this by using the consumerd that was built with libtool
in the local source tree.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
tests/run-report.py

index 1516c7e7056c25de1ac1322e69355a155e7cf4fa..73645fd420764c29ad9aea183267b3b7c639f5c0 100755 (executable)
@@ -1,15 +1,18 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 
 import os, sys
 import subprocess
 import threading
 import Queue
 import time
+import shlex
 
 from signal import signal, SIGTERM, SIGINT
 
 SESSIOND_BIN_NAME = "lttng-sessiond"
-SESSIOND_BIN_PATH = "src/bin/lttng-sessiond/.libs/"
+SESSIOND_BIN_PATH = "src/bin/lttng-sessiond/"
+CONSUMERD_BIN_NAME = "lttng-consumerd"
+CONSUMERD_BIN_PATH = "src/bin/lttng-consumerd/"
 TESTDIR_PATH = ""
 
 PRINT_BRACKET = "\033[1;34m[\033[1;33m+\033[1;34m]\033[00m"
@@ -208,19 +211,26 @@ def spawn_session_daemon():
         os.kill(pid, SIGTERM)
 
     bin_path = os.path.join(TESTDIR_PATH, "..", SESSIOND_BIN_PATH, SESSIOND_BIN_NAME)
+    consumer_path = os.path.join(TESTDIR_PATH, "..", CONSUMERD_BIN_PATH, CONSUMERD_BIN_NAME)
 
     if not os.path.isfile(bin_path):
         print "Error: No session daemon binary found. Compiled?"
         return 0
 
     try:
-        sdaemon_proc = subprocess.Popen([bin_path, "-d"], shell=False,
-                stderr = subprocess.PIPE)
+        args = shlex.split("libtool execute " + bin_path
+                           + " --consumerd32-path=" + consumer_path
+                           + " --consumerd64-path=" + consumer_path)
+
+        sdaemon_proc = subprocess.Popen(args, shell = False, stderr = subprocess.PIPE)
+
     except OSError, e:
         print e
         return 0
 
-    return get_pid(SESSIOND_BIN_NAME)
+    time.sleep(1)
+
+    return get_pid("lt-" + SESSIOND_BIN_NAME)
 
 def start_test(name):
     """
This page took 0.027441 seconds and 4 git commands to generate.