[Openstack] Problems with run_tests.sh on 11.10

John Griffith john.griffith at solidfire.com
Thu Dec 29 16:27:49 UTC 2011


Hi,
I'm trying to learn how the testing framework is set up and write my own
unit tests for the driver I've been working on.  Unfortunately I'm not
making much progress, on my Ubuntu 11.10 system I keep running into
problems with M2Crypto.

I picked up the change to use apt-get instead of pip, but still no luck.

During virtualenv setup I recieved an error at install of M2Crypto that the
source couldn't be verified, so I ran 'sudo apt-get install -y --force-yes
python-m2crypto', deleted the .venv directory and ran run_tests.sh again.

This time the environment setup completed, but again the tests fail for
'ImportError: No module named M2Crypto'.

Running in the python cli I can do 'import M2Crypto' with no ImportError.
 I've spun up a VM for now with 11.04 and things are working, but I would
like to understand what's going on with 11.10 and not have to use the VM if
I don't have to.  Has anybody seen anything along these lines?  There seems
to be quite a bit on Google about 11.10 and M2Crypto, but not finding a
resolution.

Thanks,
John

``````````````````````````````````````````````````````````````````````````````````````````````````````

    Nova development environment setup is complete.

    Nova development uses virtualenv to track and manage Python dependencies
    while in development and testing.

    To activate the Nova virtualenv for the extent of your current shell
    session you can run:

    $ source .venv/bin/activate

    Or, if you prefer, you can run commands in the virtualenv on a case by
case
    basis by running:

    $ tools/with_venv.sh <your command>

    Also, make test will automatically use the virtualenv.

ERROR

======================================================================
ERROR: <nose.suite.ContextSuite context=nova.tests>
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/jdg/Projects/OpenStack/nova/.venv/local/lib/python2.7/site-packages/nose/suite.py",
line 208, in run
    self.setUp()
  File
"/home/jdg/Projects/OpenStack/nova/.venv/local/lib/python2.7/site-packages/nose/suite.py",
line 291, in setUp
    self.setupContext(ancestor)
  File
"/home/jdg/Projects/OpenStack/nova/.venv/local/lib/python2.7/site-packages/nose/suite.py",
line 314, in setupContext
    try_run(context, names)
  File
"/home/jdg/Projects/OpenStack/nova/.venv/local/lib/python2.7/site-packages/nose/util.py",
line 478, in try_run
    return func()
  File "/home/jdg/Projects/OpenStack/nova/nova/tests/__init__.py", line 48,
in setup
    from nova.tests import fake_flags
  File "/home/jdg/Projects/OpenStack/nova/nova/tests/fake_flags.py", line
28, in <module>
    flags.DECLARE('auth_driver', 'nova.auth.manager')
  File "/home/jdg/Projects/OpenStack/nova/nova/flags.py", line 224, in
DECLARE
    __import__(module_string, globals(), locals())
  File "/home/jdg/Projects/OpenStack/nova/nova/auth/manager.py", line 34,
in <module>
    from nova import crypto
  File "/home/jdg/Projects/OpenStack/nova/nova/crypto.py", line 36, in
<module>
    import M2Crypto
ImportError: No module named M2Crypto

----------------------------------------------------------------------
Ran 0 tests in 0.002s

FAILED (errors=1)

jdg at grumpy ~/Projects/OpenStack/nova
 % cd /tmp

jdg at grumpy /tmp % python
Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import M2Crypto

jdg at grumpy /tmp %
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20111229/dfa8db48/attachment.html>


More information about the Openstack mailing list