Revision 74193008 snf-cyclades-app/synnefo/tools/burnin.py

b/snf-cyclades-app/synnefo/tools/burnin.py
217 217
        conf = Config()
218 218
        conf.set('compute_token', TOKEN)
219 219
        cls.client = ComputeClient(conf)
220
        cls.cyclades = CycladesClient(conf)
220 221

  
221 222
    def _get_ipv4(self, server):
222 223
        """Get the public IPv4 of a server from the detailed server info"""
......
391 392

  
392 393
    def test_002c_set_server_metadata(self):
393 394
        image = self.client.get_image_details(self.imageid)
394
        os = image["metadata"]["values"]["OS"]
395
        loginname = image["metadata"]["values"].get("loginname", None)
395
        os = image["metadata"]["values"]["os"]
396
        loginname = image["metadata"]["values"].get("users", None)
396 397
        self.client.update_server_metadata(self.serverid, OS=os)
397 398

  
398 399
        # Determine the username to use for future connections
......
421 422
        http://www.realvnc.com/docs/rfbproto.pdf.
422 423

  
423 424
        """
424
        console = self.client.get_server_console(self.serverid)
425
        
426
        console = self.cyclades.get_server_console(self.serverid)
425 427
        self.assertEquals(console['type'], "vnc")
426 428
        sock = self._insist_on_tcp_connection(socket.AF_UNSPEC,
427 429
                                        console["host"], console["port"])
......
486 488

  
487 489
    def test_008_submit_shutdown_request(self):
488 490
        """Test submit request to shutdown server"""
489
        self.client.shutdown_server(self.serverid)
491
        self.cyclades.shutdown_server(self.serverid)
490 492

  
491 493
    def test_009_server_becomes_stopped(self):
492 494
        """Test server becomes STOPPED"""
......
496 498

  
497 499
    def test_010_submit_start_request(self):
498 500
        """Test submit start server request"""
499
        self.client.start_server(self.serverid)
501
        self.cyclades.start_server(self.serverid)
500 502

  
501 503
    def test_011_server_becomes_active(self):
502 504
        """Test server becomes ACTIVE again"""
......
655 657

  
656 658

  
657 659
def cleanup_servers(delete_stale=False):
658
    c = Client(API, TOKEN)
660

  
661
    conf = Config()
662
    conf.set('compute_token', TOKEN)
663
    c = ComputeClient(conf)
664

  
659 665
    servers = c.list_servers()
660 666
    stale = [s for s in servers if s["name"].startswith(SNF_TEST_PREFIX)]
661 667

  
......
801 807
        return 0
802 808

  
803 809
    # Initialize a kamaki instance, get flavors, images
804
    c = Client(API, TOKEN)
810

  
811
    conf = Config()
812
    conf.set('compute_token', TOKEN)
813
    c = ComputeClient(conf)
814

  
805 815
    DIMAGES = c.list_images(detail=True)
806 816
    DFLAVORS = c.list_flavors(detail=True)
807 817

  

Also available in: Unified diff