Пример #1
0
    def run(self):
        volumes.list_volumes(self)
        volumes.list_volume_type(self)
        volumes.create_volume(self)
        volumes.check_available(self)

        images.select_image(self)
        networks.select_network(self)
        keypairs.select_keypair(self)
        servers.create_volume_instance(self)
        servers.check_active(self)

        volumes.attach_volume(self)
        sleep(5)
        volumes.detach_volume(self)
        volumes.check_available(self)
        volumes.delete_volume(self)
        servers.delete_instance(self)

        images.select_image(self)
        volumes.create_with_image(self)
        volumes.check_available(self)

        images.select_image(self)
        networks.select_network(self)
        keypairs.select_keypair(self)
        servers.create_instance_with_bdm(self)
        servers.check_active(self)
        servers.delete_instance(self)
        volumes.delete_volume(self)

        if self.overall_success is True:
            exit(0)
        else:
            exit(1)
Пример #2
0
    def run(self):

        # Create server
        images.select_image(self)
        keypairs.select_keypair(self)
        networks.select_network(self)

        servers.create_instance(self)
        servers.check_active(self)

        # Image processing
        images.create_image(self)

        images.check_image_status(self)
        images.list_images(self)
        images.get_image(self)
        images.delete_image(self)

        if self.overall_success is True:
            exit(0)
        else:
            exit(1)
Пример #3
0
    def run(self):

        # Add sec_group rule
        floating_ip.create_delete_security_group(self)

        # Keypair processing

        keypairs.list_keypair(self)
        keypairs.create_keypair(self)
        keypairs.delete_keypair(self)

        # Flavor processing
        flavors.list_flavors(self)
        flavors.get_flavor(self)

        # Create server
        images.select_image(self)
        keypairs.select_keypair(self)
        networks.select_network(self)

        servers.create_instance(self)
        servers.check_active(self)

        # floating IP
        floating_ip.create_floating(self)
        sleep(10)
        floating_ip.add_floating(self)

        # SSH to Instance
        if self.ssh_to_instance == "True":
            floating_ip.ssh_to_instance(self)

        # Stop server
        servers.get_server(self)
        servers.stop_server(self)
        servers.check_stopped(self)

        # Start stopped server
        servers.get_server(self)
        servers.start_server(self)
        servers.check_active(self)

        # Reboot server Hard
        servers.reboot_server_hard(self)
        servers.check_active(self)

        # Set and delete server metadata
        servers.set_server_metadata(self)
        servers.delete_server_metadata(self)

        # Delete floating ip
        floating_ip.delete_floating(self)

        # Delete instance
        servers.delete_instance(self)

        sleep(5)

        if self.overall_success is True:
            exit(0)
        else:
            exit(1)