Revision 96da37c8 snf-cyclades-app/synnefo/tools/burnin.py

b/snf-cyclades-app/synnefo/tools/burnin.py
56 56
from multiprocessing import Process, Queue
57 57
from random import choice
58 58

  
59
from kamaki.clients import ClientError, ComputeClient, CycladesClient
60
from kamaki.config import Config
59
from kamaki.clients.compute import ComputeClient
60
from kamaki.clients.cyclades import CycladesClient
61

  
61 62

  
62 63
from vncauthproxy.d3des import generate_response as d3des_generate_response
63 64

  
......
608 609
        images = cls.compute.list_images(detail = True)
609 610
        flavors = cls.compute.list_flavors(detail = True)
610 611

  
611
        is_windows = imagename.lower().find("windows") >= 0
612

  
613
        cls.imageid = choice([im['id'] for im in images] if not is_windows)
612
        cls.imageid = choice([im['id'] for im in images if not im['name'].lower().find("windows") >= 0])
614 613
        cls.flavorid = choice([f['id'] for f in flavors if f['disk'] >= 20])
615 614

  
616 615
        for image in images:
617
            if image['id'] == imageid:
616
            if image['id'] == cls.imageid:
618 617
                imagename = image['name']
619 618

  
620 619
        cls.servername = "%s%s for %s" % (SNF_TEST_PREFIX, TEST_RUN_ID, imagename)
......
636 635

  
637 636
        # Update class attributes to reflect data on building server
638 637
        cls = type(self)
639
        cls.serverid['A'] = server["id"]
638
        cls.serverid['A'] = serverA["id"]
640 639
        cls.username['A'] = None
641
        cls.password['A'] = server["adminPass"]
640
        cls.password['A'] = serverA["adminPass"]
642 641

  
643 642
    
644 643
    def test_0001_submit_create_server_B(self):
645 644
        """Test submit create server request"""
646
        serverA = self.client.create_server(self.servername, self.flavorid,
645
        serverB = self.client.create_server(self.servername, self.flavorid,
647 646
                                           self.imageid, personality=None)
648 647

  
649 648
        self.assertEqual(server["name"], self.servername)
......
653 652

  
654 653
        # Update class attributes to reflect data on building server
655 654
        cls = type(self)
656
        cls.serverid['B'] = server["id"]
655
        cls.serverid['B'] = serverB["id"]
657 656
        cls.username['B'] = None
658
        cls.password['B'] = server["adminPass"]
657
        cls.password['B'] = serverB["adminPass"]
659 658

  
660 659
    def test_0001_serverA_becomes_active(self):
661 660
        """Test server becomes ACTIVE"""
......
796 795
    """A distinct process used to execute part of the tests in parallel"""
797 796
    def __init__(self, **kw):
798 797
        Process.__init__(self, **kw)
799
        kwargs = kw["kwargs"]x
798
        kwargs = kw["kwargs"]
800 799
        self.testq = kwargs["testq"]
801 800
        self.runner = kwargs["runner"]
802 801

  
......
1047 1046

  
1048 1047
    # Initialize a kamaki instance, get flavors, images
1049 1048

  
1050
    c = ComputeClient(API, TOKEn)
1049
    c = ComputeClient(API, TOKEN)
1051 1050

  
1052 1051
    DIMAGES = c.list_images(detail=True)
1053 1052
    DFLAVORS = c.list_flavors(detail=True)
......
1102 1101
    #To run all cases
1103 1102
    #seq_cases = [UnauthorizedTestCase, FlavorsTestCase, ImagesTestCase, ServerTestCase, NetworkTestCase]
1104 1103
    
1105
    newNetworkTestCase = _spawn_network_test_case(action_timeout = opts.action_timeout,query_interval = opts.query_interval)    
1104
    newNetworkTestCase = _spawn_network_test_case(action_timeout = opts.action_timeout,
1105
                                                  query_interval = opts.query_interval)    
1106 1106
    seq_cases = [newNetworkTestCase]
1107 1107

  
1108 1108
    for case in seq_cases:

Also available in: Unified diff