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



commit eef4784414dd8ddd90a50b29fdba4410888eaf98
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 7fae296..ed5fec9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1981,6 +1981,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 29412f0..799457d 100644
--- a/tests/functional-tests/common/utils/configuration.py.in
+++ b/tests/functional-tests/common/utils/configuration.py.in
@@ -76,6 +76,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]