Beispiel #1
0
    def test_020_add_EC2_backend(self):
        """
        -->Add EC2 Backends
        Adds all EC2 Backends, if no EC2 creds are given in the yaml file it will
        print a Message and return True
        """
        providers = self.test_config['SUPPORTED_PROVIDERS']
        creds = self.credentials['EC2']
        apikey = creds['api_key']
        apisecret = creds['api_secret']

        if not apikey or not apisecret:
            print "\n>>>Could not find credentials for EC2, will not add backend"
            return

        for prov in providers:
            if "EC2" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
Beispiel #2
0
    def test_021_add_Rackspace_backend(self):
        """
        --->Add Rackspace Backends
        """
        providers = self.test_config['SUPPORTED_PROVIDERS']
        creds = self.credentials['Rackspace']
        apikey = creds['username']
        apisecret = creds['api_key']

        if not apikey or not apisecret:
            print "\n>>>Could not find credentials for Rackspace, will not add backend"
            return

        for prov in providers:
            if "Rack" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
Beispiel #3
0
    def test_024_add_SoftLayer_backend(self):
        """
        --->Add SoftLayer Backend
        """
        providers = self.test_config['SUPPORTED_PROVIDERS']
        creds = self.credentials['SoftLayer']
        apikey = creds['username']
        apisecret = creds['api_key']

        if not apikey or not apisecret:
            print "\n>>>Could not find credentials for SoftLayer, will not add backend"
            return

        for prov in providers:
            if "Soft" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Addind %s backend" % title
                backend = backends.add_backend(self.uri,
                                               title,
                                               provider,
                                               apikey,
                                               apisecret,
                                               cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend

        print "\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
Beispiel #4
0
    def test_021_add_Rackspace_backend(self):
        """
        --->Add Rackspace Backends
        """
        providers = self.test_config['SUPPORTED_PROVIDERS']
        creds = self.credentials['Rackspace']
        apikey = creds['username']
        apisecret = creds['api_key']

        if not apikey or not apisecret:
            print "\n>>>Could not find credentials for Rackspace, will not add backend"
            return

        for prov in providers:
            if "Rack" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri,
                                               title,
                                               provider,
                                               apikey,
                                               apisecret,
                                               cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print "\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
Beispiel #5
0
    def test_020_add_EC2_backend(self):
        """
        -->Add EC2 Backends
        Adds all EC2 Backends, if no EC2 creds are given in the yaml file it will
        print a Message and return True
        """
        providers = self.test_config['SUPPORTED_PROVIDERS']
        creds = self.credentials['EC2']
        apikey = creds['api_key']
        apisecret = creds['api_secret']

        if not apikey or not apisecret:
            print "\n>>>Could not find credentials for EC2, will not add backend"
            return

        for prov in providers:
            if "EC2 AP SOUTHEAST" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri,
                                               title,
                                               provider,
                                               apikey,
                                               apisecret,
                                               cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print "\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
Beispiel #6
0
    def test_025_rename_backend(self):
        """
        --->Rename Backend

        Adds a EC2 SOUTHEAST backend and renames it.
        """
        providers = self.test_config['SUPPORTED_PROVIDERS']
        creds = self.credentials['EC2']
        apikey = creds['api_key']
        apisecret = creds['api_secret']

        if not apikey or not apisecret:
            print "\n>>>Could not find credentials for EC2, will not add backend"
            return

        for prov in providers:
            if "SOUTHEAST" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        backend_id = backend['id']
        new_name = "Renamed Backend"
        print "\n>>>Rename %s backend to %s" % (prov['title'], new_name)
        backends.rename_backend(self.uri, backend_id, new_name, cookie=self.cookie)

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
Beispiel #7
0
 def test_01_list_backends(self):
     """
     --> List Backends
     This one lists all of our backends and it is used every time
     we add or delete a backend in order to confirm our action and see
     if our information agrees with the information sent from the API
     """
     print "\n>>>List of Backends:"
     self.test_config['BACKENDS'] = backends.list_backends(self.uri, cookie=self.cookie) or {}
     for back in self.test_config['BACKENDS']:
         print back['title']
Beispiel #8
0
 def test_01_list_backends(self):
     """
     --> List Backends
     This one lists all of our backends and it is used every time
     we add or delete a backend in order to confirm our action and see
     if our information agrees with the information sent from the API
     """
     print "\n>>>List of Backends:"
     self.test_config['BACKENDS'] = backends.list_backends(
         self.uri, cookie=self.cookie) or {}
     for back in self.test_config['BACKENDS']:
         print back['title']
Beispiel #9
0
    def test_024_add_SoftLayer_backend(self):
        """
        --->Add SoftLayer Backend
        """
        providers = self.test_config['SUPPORTED_PROVIDERS']
        creds = self.credentials['SoftLayer']
        apikey = creds['username']
        apisecret = creds['api_key']

        if not apikey or not apisecret:
            print "\n>>>Could not find credentials for SoftLayer, will not add backend"
            return

        for prov in providers:
            if "Soft" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Addind %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
Beispiel #10
0
 def test_94_delete_all_backends(self):
     """--->Delete All Backends"""
     print "\n>>>Deleting all backends:"
     for back in backends.list_backends(self.uri):
         backends.delete_backend(self.uri, back['id'])
         del self.test_config['BACKENDS'][back['id']]
Beispiel #11
0
 def test_94_delete_all_backends(self):
     """--->Delete All Backends"""
     print "\n>>>Deleting all backends:"
     for back in backends.list_backends(self.uri):
         backends.delete_backend(self.uri, back['id'])
         del self.test_config['BACKENDS'][back['id']]