~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/tests/test_crypto.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-08-16 14:04:11 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20120816140411-0mr4n241wmk30t9l
Tags: upstream-2012.2~f3
ImportĀ upstreamĀ versionĀ 2012.2~f3

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
FLAGS = flags.FLAGS
30
30
 
31
31
 
32
 
class SymmetricKeyTestCase(test.TestCase):
33
 
    """Test case for Encrypt/Decrypt"""
34
 
    def test_encrypt_decrypt(self):
35
 
        key = 'c286696d887c9aa0611bbb3e2025a45a'
36
 
        plain_text = "The quick brown fox jumped over the lazy dog."
37
 
 
38
 
        # No IV supplied (all 0's)
39
 
        encrypt = crypto.encryptor(key)
40
 
        cipher_text = encrypt(plain_text)
41
 
        self.assertNotEquals(plain_text, cipher_text)
42
 
 
43
 
        decrypt = crypto.decryptor(key)
44
 
        plain = decrypt(cipher_text)
45
 
 
46
 
        self.assertEquals(plain_text, plain)
47
 
 
48
 
 
49
32
class X509Test(test.TestCase):
50
33
    def test_can_generate_x509(self):
51
34
        with utils.tempdir() as tmpdir: