fix some bugs for python verify jobs: 07/37907/8
authordongwenjuan <dong.wenjuan@zte.com.cn>
Fri, 21 Jul 2017 07:20:54 +0000 (15:20 +0800)
committerdongwenjuan <dong.wenjuan@zte.com.cn>
Wed, 26 Jul 2017 09:31:12 +0000 (17:31 +0800)
1.PYTHON_ENABLE=True does not work in bash
The python jobs does not run even we enabled them. The reason is that currently
JJB parse the parameter 'PYTHON_ENABLE' as 'True' which does not work in bash.
Fix it to compare with [Tt]rue.

2.Install tox if it is not installed

3.support only python3.4 in tox.ini

4.install python3-dev

Change-Id: I1a8ebad2fd06fe50ca4f739adb8d6d76caa2963b
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
.gitignore
tests/lib/installers/apex
tests/main.py
tests/run.sh
tox.ini

index 65b51a6..84d085d 100644 (file)
@@ -1,4 +1,5 @@
 *~
+*.pyc
 .*.sw?
 **.log
 /docs_build/
index 55878de..3d94e1c 100644 (file)
@@ -5,7 +5,7 @@ ssh_opts_cpu="$ssh_opts -i instack_key"
 
 function get_installer_ip {
     is_set INSTALLER_IP && return
-    INSTALLER_IP=$(get_first_vnic_ip instack)
+    INSTALLER_IP=$(get_first_vnic_ip undercloud)
 }
 
 function installer_get_ssh_keys {
index 45683d1..1cd2b1d 100644 (file)
@@ -76,7 +76,7 @@ class DoctorTest(object):
 
 def main():
     """doctor main"""
-    doctor_root_dir = os.path.dirname(os.getcwd())
+    doctor_root_dir = os.path.dirname(sys.path[0])
     config_file_dir = '{0}/{1}'.format(doctor_root_dir, 'etc/')
     config_files = [join(config_file_dir, f) for f in os.listdir(config_file_dir)
                     if isfile(join(config_file_dir, f))]
index fda1e75..713e494 100755 (executable)
@@ -480,7 +480,14 @@ cleanup() {
 
 # Main process
 
-if $PYTHON_ENABLE; then
+if [[ $PYTHON_ENABLE == [Tt]rue ]]; then
+    which tox || sudo pip install tox
+    if [ -f /usr/bin/apt-get ]; then
+        sudo apt-get install -y python3-dev
+    elif [ -f /usr/bin/yum ] ; then
+        sudo yum install -y python3-devel
+    fi
+
     cd $TOP_DIR
     echo "executing tox..."
     tox
diff --git a/tox.ini b/tox.ini
index 2f74083..e75a374 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
 [tox]
 minversion = 2.3.1
-envlist = verify
+envlist = py34
 skipsdist = True
 
 [testenv]
@@ -20,7 +20,6 @@ passenv =
     PROFILER_TYPE
     PYTHON_ENABLE
     CI_DEBUG
-
-[testenv:verify]
 changedir = {toxinidir}/tests
 commands = python main.py
+