~vishvananda/nova/network-refactor

« back to all changes in this revision

Viewing changes to nova/tests/api_integration.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright [2010] [Anso Labs, LLC]
 
2
 
3
#    Licensed under the Apache License, Version 2.0 (the "License");
 
4
#    you may not use this file except in compliance with the License.
 
5
#    You may obtain a copy of the License at
 
6
 
7
#        http://www.apache.org/licenses/LICENSE-2.0
 
8
 
9
#    Unless required by applicable law or agreed to in writing, software
 
10
#    distributed under the License is distributed on an "AS IS" BASIS,
 
11
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
12
#    See the License for the specific language governing permissions and
 
13
#    limitations under the License.
 
14
 
 
15
import unittest
 
16
 
 
17
import boto
 
18
from boto.ec2.regioninfo import RegionInfo
 
19
 
 
20
ACCESS_KEY = 'fake'
 
21
SECRET_KEY = 'fake'
 
22
CLC_IP = '127.0.0.1'
 
23
CLC_PORT = 8773
 
24
REGION = 'test'
 
25
 
 
26
def get_connection():
 
27
    return boto.connect_ec2 (
 
28
        aws_access_key_id=ACCESS_KEY,
 
29
        aws_secret_access_key=SECRET_KEY,
 
30
        is_secure=False,
 
31
        region=RegionInfo(None, REGION, CLC_IP),
 
32
        port=CLC_PORT,
 
33
        path='/services/Cloud',
 
34
        debug=99
 
35
    )
 
36
    
 
37
class APIIntegrationTests(unittest.TestCase):
 
38
    def test_001_get_all_images(self):
 
39
        conn = get_connection()
 
40
        res = conn.get_all_images()
 
41
        print res
 
42
        
 
43
        
 
44
if __name__ == '__main__':
 
45
    unittest.main()
 
46
 
 
47
#print conn.get_all_key_pairs()
 
48
#print conn.create_key_pair
 
49
#print conn.create_security_group('name', 'description')
 
50