I failed to build latest vdsm code on RHEL6 host because of test
failure as below:
make[2]: Entering directory `/home/mark/Work/vdsm/vdsm-src/tests'
../tests/run_tests.sh main.py miscTests.py resourceManagerTests.py
processPoolTests.py fileUtilTests.py guestIFTests.py
Failure
runTest
ERROR
runTest
ERROR
runTest
ERROR
runTest
ERROR
runTest
ERROR
TestGuestIF
testfilterXmlChars OK
When I manually run one of the test cases, I got the following
exception:
$ ./run_tests.sh fileUtilTests.py
Failure
runTest
ERROR
======================================================================
ERROR: Failure: ImportError (No module named fileUtils)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364,
in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39,
in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.6/site-packages/nose/importer.py", line 87,
in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/mark/Work/vdsm/vdsm-src/tests/fileUtilTests.py", line
23, in <module>
import storage.fileUtils as fileUtils
ImportError: No module named fileUtils ----------------------> I am not sure why the
name is fileUtils, not storage.fileUtils
----------------------------------------------------------------------
Ran 1 test in 0.001s
FAILED (errors=1)
I also tried to manually import fileUtilTests.py. Although it
failed too, it could locate the module storage.fileUtils and started
to load it. I guess the 'constants' module issue could be resolved
by the function hackVdsmModule in testrunner.py.
In [1]: import sys
In [2]: sys.path.append('../vdsm')
In [3]: import fileUtilTests.py
---------------------------------------------------------------------------
ImportError Traceback (most recent
call last)
/home/mark/Work/vdsm/vdsm-src/tests/<ipython console> in
<module>()
/home/mark/Work/vdsm/vdsm-src/tests/fileUtilTests.py in
<module>()
21 import os
22
---> 23 import storage.fileUtils as fileUtils
24 import testValidation
25 from testrunner import VdsmTestCase as TestCaseBase
/home/mark/Work/vdsm/vdsm-src/vdsm/storage/fileUtils.py in
<module>()
34
35 import shutil
---> 36 from vdsm import constants
37 import logging
38 import storage_exception as se
ImportError: cannot import name constants
I guess this problem may be related to nose. The software versions
are:
python-nose-0.10.4-3.1.el6.noarch
python-2.6.6-20.el6.x86_64
Anyone met this issue before? Am I missing something? Thanks!