[tracker] functional-tests: Support cases with AND without Upstart



commit 6cd922cb8c09a5d1eebaa488d621a2c1d6fd4950
Author: maimishr <ext-maitrey mishra nokia com>
Date:   Wed Apr 13 16:42:31 2011 +0300

    functional-tests: Support cases with AND without Upstart

 configure.ac                                       |    9 +++++++++
 .../common/utils/configuration.py.in               |    1 +
 tests/functional-tests/create-tests-xml.py         |   18 ++++++++++++------
 3 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8ee9739..174617a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1976,6 +1976,15 @@ have_mockup="no  (disabled)"
 
 AM_CONDITIONAL(HAVE_MOCKUP, test "x$have_mockup" = "xyes")
 
+####################################################################
+# Check if we should use initctl or sysvinit
+####################################################################
+
+# Check for initcl
+AC_PATH_PROG(INITCTL, initctl, [])
+AC_SUBST(INITCTL)
+AM_CONDITIONAL(HAVE_UPSTART, test "x$INITCTL" != "x")
+
 ##################################################################
 # Write generated files
 ##################################################################
diff --git a/tests/functional-tests/common/utils/configuration.py.in b/tests/functional-tests/common/utils/configuration.py.in
index d3b12c5..1a8a46f 100644
--- a/tests/functional-tests/common/utils/configuration.py.in
+++ b/tests/functional-tests/common/utils/configuration.py.in
@@ -79,6 +79,7 @@ DATADIR = os.path.normpath (expandvars (RAW_DATA_DIR))
 BINDIR = os.path.normpath (expandvars (RAW_BINDIR))
                             
 haveMaemo = ("@HAVE_MAEMO_TRUE@" == "")
+haveUpstart = ("@HAVE_UPSTART_TRUE@" == "")
 
 TEST_TMP_DIR = os.path.join (os.environ["HOME"], ".tracker-tests")
         
diff --git a/tests/functional-tests/create-tests-xml.py b/tests/functional-tests/create-tests-xml.py
index 224d316..e78ed7c 100755
--- a/tests/functional-tests/create-tests-xml.py
+++ b/tests/functional-tests/create-tests-xml.py
@@ -43,12 +43,18 @@ FOOTER = """
   </suite>
 </testdefinition>"""
 
-PRE_STEPS = """        <pre_steps>
-           <step>initctl stop xsession/tracker-writeback</step>
-           <step>initctl stop xsession/tracker-miner</step>
-           <step>initctl start xsession/tracker-stop</step>
-       </pre_steps>
-"""
+if (cfg.haveUpstart):
+        PRE_STEPS = """        <pre_steps>
+                   <step>initctl stop xsession/tracker-writeback</step>
+                   <step>initctl stop xsession/tracker-miner</step>
+                   <step>initctl start xsession/tracker-stop</step>
+                </pre_steps>
+        """
+else:
+        PRE_STEPS = """        <pre_steps>
+           <step>su - meego -c "tracker-control -t"</step>
+        </pre_steps>
+        """
 
 def __get_doc (obj):
     if obj.__doc__:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]