~gandelman-a/ubuntu/precise/nova/UCA_2012.2.1

« back to all changes in this revision

Viewing changes to nova/tests/rpc/test_kombu_ssl.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
Unit Tests for remote procedure calls using kombu + ssl
20
20
"""
21
21
 
 
22
from nova import flags
22
23
from nova import test
23
 
from nova.rpc import impl_kombu
 
24
 
 
25
try:
 
26
    import kombu
 
27
    from nova.rpc import impl_kombu
 
28
except ImportError:
 
29
    kombu = None
 
30
    impl_kombu = None
 
31
 
24
32
 
25
33
# Flag settings we will ensure get passed to amqplib
26
34
SSL_VERSION = "SSLv2"
28
36
SSL_CA_CERT = "/tmp/cert.ca.blah.blah"
29
37
SSL_KEYFILE = "/tmp/keyfile.blah.blah"
30
38
 
 
39
FLAGS = flags.FLAGS
 
40
 
31
41
 
32
42
class RpcKombuSslTestCase(test.TestCase):
33
43
 
34
44
    def setUp(self):
35
45
        super(RpcKombuSslTestCase, self).setUp()
36
 
        self.flags(kombu_ssl_keyfile=SSL_KEYFILE,
37
 
                   kombu_ssl_ca_certs=SSL_CA_CERT,
38
 
                   kombu_ssl_certfile=SSL_CERT,
39
 
                   kombu_ssl_version=SSL_VERSION,
40
 
                   rabbit_use_ssl=True)
 
46
        if kombu:
 
47
            impl_kombu.register_opts(FLAGS)
 
48
            self.flags(kombu_ssl_keyfile=SSL_KEYFILE,
 
49
                       kombu_ssl_ca_certs=SSL_CA_CERT,
 
50
                       kombu_ssl_certfile=SSL_CERT,
 
51
                       kombu_ssl_version=SSL_VERSION,
 
52
                       rabbit_use_ssl=True)
41
53
 
 
54
    @test.skip_if(kombu is None, "Test requires kombu")
42
55
    def test_ssl_on_extended(self):
43
56
        rpc = impl_kombu
44
 
        conn = rpc.create_connection(True)
 
57
        conn = rpc.create_connection(FLAGS, True)
45
58
        c = conn.connection
46
59
        #This might be kombu version dependent...
47
60
        #Since we are now peaking into the internals of kombu...