SLIDER-630. slider-agent unit tests fail on debian and suse and windows
diff --git a/slider-agent/src/test/python/python-wrap b/slider-agent/src/test/python/python-wrap
index ea57721..88a8c55 100755
--- a/slider-agent/src/test/python/python-wrap
+++ b/slider-agent/src/test/python/python-wrap
@@ -17,23 +17,26 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-export PYTHONPATH=/usr/lib/python2.6/site-packages:$PYTHONPATH
-
 # reset settings
 unset PYTHON
 
+if [ -a /usr/bin/python2.6 ] && [ -z "$PYTHON" ]; then
+  PYTHON=/usr/bin/python2.6
+fi
+
 # checking for preferable python versions
 if [ -a /usr/bin/python2.7 ] && [ -z "$PYTHON" ]; then
   PYTHON=/usr/bin/python2.7
 fi
 
-if [ -a /usr/bin/python2.6 ] && [ -z "$PYTHON" ]; then
-  PYTHON=/usr/bin/python2.6
+# if no preferable python versions found, try to use system one
+if [ -a /usr/bin/python ] && [ -z "$PYTHON" ]; then
+  PYTHON=/usr/bin/python
 fi
 
 # if no preferable python versions found, try to use system one
 if [[ -z "$PYTHON" ]]; then
-  PYTHON=/usr/bin/python
+  PYTHON=python
 fi
 
 # execute script
diff --git a/slider-agent/src/test/python/resource_management/TestExecuteResource.py b/slider-agent/src/test/python/resource_management/TestExecuteResource.py
index f7f6371..0673b66 100644
--- a/slider-agent/src/test/python/resource_management/TestExecuteResource.py
+++ b/slider-agent/src/test/python/resource_management/TestExecuteResource.py
@@ -77,7 +77,7 @@
                 poll_after = 5)
         self.assertTrue(False, "Should fail as process does not run for 5 seconds")
       except Fail as e:
-        self.assertTrue("returned 1" in e.message)
+        self.assertTrue("returned 1" in str(e))
         pass
 
     self.assertTrue(popen_mock.called, 'subprocess.Popen should have been called!')
diff --git a/slider-agent/src/test/python/unitTests.py b/slider-agent/src/test/python/unitTests.py
index 6aa0167..b65c075 100644
--- a/slider-agent/src/test/python/unitTests.py
+++ b/slider-agent/src/test/python/unitTests.py
@@ -32,7 +32,7 @@
 class TestAgent(unittest.TestSuite):
   def run(self, result, debug=False):
     run = unittest.TestSuite.run
-    run(self, result, debug)
+    run(self, result)
     return result
 
 
diff --git a/slider-assembly/pom.xml b/slider-assembly/pom.xml
index fa6f1ad..b6f20c0 100644
--- a/slider-assembly/pom.xml
+++ b/slider-assembly/pom.xml
@@ -38,6 +38,9 @@
     <src.confdir>src/conf-hdp</src.confdir>
     <src.libdir>${project.build.directory}/lib</src.libdir>
     <src.agent.ini.dir>${project.build.directory}/../../slider-agent/conf</src.agent.ini.dir>
+    <python.ver>python &gt;= 2.6</python.ver>
+    <executable.python>${project.basedir}/../slider-agent/src/test/python/python-wrap</executable.python>
+    <python.path.l>${project.basedir}/src/main/scripts:${project.basedir}/../slider-agent/src/test/python/mock:${project.basedir}/src/test/python/scripts</python.path.l>
     <skipTests>false</skipTests>
   </properties>
 
@@ -72,13 +75,13 @@
         <executions>
           <execution>
             <configuration>
-              <executable>python</executable>
+              <executable>${executable.python}</executable>
               <workingDirectory>src/test/python</workingDirectory>
               <arguments>
                 <argument>unitTests.py</argument>
               </arguments>
               <environmentVariables>
-                <PYTHONPATH>${project.basedir}/src/main/scripts:${project.basedir}/../slider-agent/src/test/python/mock:${project.basedir}/src/test/python/scripts</PYTHONPATH>
+                <PYTHONPATH>${python.path.l}</PYTHONPATH>
               </environmentVariables>
               <skip>${skipTests}</skip>
             </configuration>
@@ -235,6 +238,27 @@
   </reporting>
 
   <profiles>
+   <profile>
+      <id>Windows</id>
+      <activation>
+        <os><family>windows</family></os>
+      </activation>
+      <properties>
+        <executable.python>python</executable.python>
+        <python.path.l>${project.basedir}\src\main\scripts;${project.basedir}\..\slider-agent\src\test\python\mock;${project.basedir}\src\test\python\scripts</python.path.l>
+      </properties>
+    </profile>
+
+    <profile>
+      <id>Linux</id>
+      <activation>
+        <os><family>!windows</family></os>
+      </activation>
+      <properties>
+        <executable.python>${project.basedir}/../slider-agent/src/test/python/python-wrap</executable.python>
+        <python.path.l>${project.basedir}/src/main/scripts:${project.basedir}/../slider-agent/src/test/python/mock:${project.basedir}/src/test/python/scripts</python.path.l>
+      </properties>
+    </profile>
     <profile>
       <id>rpm</id>
       <build>
diff --git a/slider-assembly/src/test/python/unitTests.py b/slider-assembly/src/test/python/unitTests.py
index aebf4ba..ec1a78c 100644
--- a/slider-assembly/src/test/python/unitTests.py
+++ b/slider-assembly/src/test/python/unitTests.py
@@ -32,7 +32,7 @@
 class TestAgent(unittest.TestSuite):
   def run(self, result, debug=False):
     run = unittest.TestSuite.run
-    run(self, result, debug)
+    run(self, result)
     return result