Installing SNAPS

Install Dependencies

A few packages need to installed onto your system, before you can install SNAPS.

Git is used to download the snaps source from the OPNFV Gerrit repository.

Python, GCC and additional libraries are required to compile and install the packages used by SNAPS. These dependencies need to be installed whether or not a virtual Python environment is used.

Note: SNAPS-OO works best under Python 2.7; however, all of the code except in snaps.openstack.provisioning.ansible should work properly within a Python 3.4.4 runtime. Ansible support will not work in any Python 3.x when the Ansible version is 2.3.0 or prior. No indications when this support will be added as of 5 May 2017.

CentOS 7

sudo yum -y update
sudo yum install -y epel-release
sudo yum install -y git gcc python-pip python-devel openssl-devel
sudo pip install --upgrade pip

Ubuntu 14.04

sudo apt-get install git python2.7-dev libssl-dev python-pip
sudo apt-get install corkscrew (optional for SSH over an HTTP proxy)

Ubuntu 16.04

sudo apt install python git python2.7-dev libssl-dev python-pip
sudo apt install corkscrew (optional for SSH over an HTTP proxy)

Windows Server 2012

Install Python 2.7.x
Install Git
Install Microsoft Visual C++ Compiler for Python 2.7

Cannot SSH from behind a proxy in the 'cmd' shell as corkscrew is only available for Cygwin
Ansible functionality is not working on windows as an exception is being thrown while importing the packages

Optional: Setup a Python virtual environment

Python 2.7 (recommend leveraging a Virtual Python runtime, e.g.
Virtualenv, in your development environment)

Install SNAPS dependencies

The “pip” command below needs to be executed as root, if you are not using a virtual Python environment.

git clone https://gerrit.opnfv.org/gerrit/snaps
sudo pip install -e <path to repo>/snaps/
(note: on CentOS 7 and Ubuntu 14.04 you may have to try the previous command several times)

The install should now be complete and you can start using the SNAPS-OO libraries.

Try an example

Use launcher.py to deploy and clean up example environments. These examples are described in YAML files.

  1. Add your OpenStack connection information.

    Edit <path to repo>/examples/inst-w-volume/deploy-env.yaml with your OpenStack credentials and authorization URL

    • openstack: the top level tag that denotes configuration for the OpenStack components
    • connection: - contains the credentials and endpoints required to connect with OpenStack
    • username: - the project’s user (required)
    • password: - the tentant’s user password (required)
    • auth_url: - the URL to the OpenStack APIs (required)
    • project_name: - the name of the OpenStack project for the user (required)
    • http_proxy: - the {{ host }}:{{ port }} of the proxy server (optional)
  2. Go to the examples directory.

    cd <snaps repo>/examples/
    
  3. Deploy the launcher.

    python launch.py -t ./inst-w-volume/deploy-vm-with-volume.yaml -e ./inst-w-volume/deploy-env.yaml -d
    
  4. Clean the deployment.

    python launch.py -t ./complex-network/deploy-complex-network.yaml -e ./inst-w-volume/deploy-env.yaml -c
    
  5. Customize the deployment by changing the yaml file.

    The configuration file used to deploy and provision a virtual environment has been designed to describe the required images, networks, SSH public and private keys, associated VMs, as well as any required post deployment provisioning tasks.

  • openstack: the top level tag that denotes configuration for the OpenStack components

    • connections: the different connections/credentials to be used by the launcher application

      • connection: the credentials and endpoints required to connect to an OpenStack project/tenant

        • name: the name of the credentials for use when creating objects (required)

        • username: the project’s user (required)

        • password: the tentant’s user password (required)

        • auth_url: the URL to the OpenStack APIs (required)

        • project_name: the name of the OpenStack project for the user (required)

        • identity_api_version: the Keystone client version to use (default = 2)

        • image_api_version: the Glance client version to use (default = 2)

        • network_api_version: the Neutron client version to use (default = 2)

        • compute_api_version: the Nova client version to use (default = 2)

        • heat_api_version: the Heat client version to use (default = 1)

        • volume_api_version: the Cinder client version to use (default = 2)

        • user_domain_id: the user domain ID to use (default = ‘default’)

        • user_domain_name: the user domain name to use (default = ‘Default’)

        • project_domain_id: the project domain ID to use (default = ‘default’)

        • project_domain_name: the project domain name to use (default = ‘Default’)

        • interface: Used to specify the endpoint type for keystone (default = ‘public’)

        • cacert: True for https or the certification file location (default = False)

        • region_name: the region (default = None)

        • proxy_settings: for accessing APIs hidden behind an HTTP proxy

          • host: hostname or IP of HTTP proxy host (required)
          • port: port number of the HTTP proxy server (required)
          • http_host: hostname or IP of HTTPS proxy host (default = host)
          • port: port number of the HTTPS proxy server (default = port)
          • ssh_proxy_cmd: the OpenSSH command used to access the SSH port of a VM (optional)
    • projects: the projects/tenants to create

      • project: a project/tenant to create (admin user credentials required)
        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)
        • name: the project’s name (required)
        • domain or domain_name: the project’s domain name (default = ‘Default’)
        • description: the description (optional)
        • users: a list of users to associate to the project (optional)
        • enabled: when True the project will be enabled on creation (default = True)
    • users: the users to create

      • user: a user to create (admin user credentials required)
        • os_creds_name: the connection name (required)
        • name: the username (required)
        • password: the user’s password (required)
        • project_name: the user’s primary project name (optional)
        • domain_name: the user’s domain name (default = ‘Default’)
        • email: the user’s email address (optional)
        • roles: dict where key is the role’s name and value is the name of the project to associate with the role (optional)
    • flavors: the flavors to create

      • flavor: a flavor to create (admin user credentials required)
        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)
        • name: the name (required)
        • flavor_id: the string ID (default ‘auto’)
        • ram: the required RAM in MB (required)
        • disk: the size of the root disk in GB (required)
        • vcpus: the number of virtual CPUs (required)
        • ephemeral: the size of the ephemeral disk in GB (default 0)
        • swap: the size of the dedicated swap disk in GB (default 0)
        • rxtx_factor: the receive/transmit factor to be set on ports if backend supports QoS extension (default 1.0)
        • is_public: denotes whether or not the flavor is public (default = True)
        • metadata: freeform dict() for special metadata (optional)
    • qos_specs: the QoS Specs to create

      • qos_spec: a QoS Spec to create (admin user credentials required)
        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)
        • name: the name (required)
        • consumer: enumerations: ‘front-end’, ‘back-end’, ‘both’ (required)
        • specs: dict of custom values (optional)
    • volume_types: the Volume Type to create

      • volume_type: a Volume Type to create (admin user credentials required)
        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)
        • name: the name (required)
        • description: the description (optional)
        • qos_spec_name: the name of the associate QoS Spec (optional)
        • public: visibility (default - False)
        • encryption: the encryption settings (optional)
          • name: the name (required)
          • provider_class: the provider class (required i.e. LuksEncryptor)
          • control_location: enumerations: ‘front-end’, ‘back-end’ (required)
          • cipher: the encryption algorithm/mode to use (optional)
          • key_size: the size of the encryption key, in bits (optional)
    • volumes: the Volume to create

      • volume: a Volume to create

        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)

        • os_user: the connection from a new user defined in template (required or use “os_creds_name” above

          • name: the user’s name (required)
          • project_name: the project name to use
        • name: the name (required)

        • description: the description (optional)

        • size: the volume size in GB (default = 1)

        • image_name: the image name to leverage (optional)

        • type_name: the volume type name to associate (optional)

        • availability_zone: the zone name on which to deploy (optional)

        • multi_attach: when true, volume can be attached to more than one VM (default = False)

    • images: describes each image to create

      • image:

        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)

        • os_user: the connection from a new user defined in template (required or use “os_creds_name” above

          • name: the user’s name (required)
          • project_name: the project name to use
        • name: The unique image name. If the name already exists for your project, a new one will not be created (required)

        • image_user: the image’s default sudo user (required)

        • format or img_format: the image format type (required i.e. qcow2)

        • url or download_url: The HTTP download location of the image file (required when “image_file” below has not been configured)

        • image_file: the image file location (required when “url” has not been configured)

        • kernel_image_settings: the settings for a kernel image (optional)

        • ramdisk_image_settings: the settings for a kernel image (optional)

        • public: publically visibile when True (default = True)

    • networks:
      • network:

        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)

        • os_user: the connection from a new user defined in template (required or use “os_creds_name” above

          • name: the user’s name (required)
          • project_name: the project name to use
        • name: The name of the network to be created. If one already exists, a new one will not be created (required)

        • admin_state_up: T|F (default True)

        • shared: (optional)

        • project_name: Name of the project who owns the network. Note: only administrative users can specify projects other than their own (optional)

        • external: T|F whether or not network is external (default False)

        • network_type: The type of network to create (optional)

        • physical_network: the name of the physical network (required when network_type is ‘flat’)

        • segmentation_id: the id of the segmentation (required when network_type is ‘vlan’)

        • subnets:
          • subnet:
            • name: The name of the network to be created. If one already exists, a new one will not be created. Note: although OpenStack allows for multiple subnets to be applied to any given network, we have not included support as our current use cases does not utilize this functionality (required)
            • cidr: The subnet mask value (required)
            • dns_nameservers: A list of IP values used for DNS resolution (default: 8.8.8.8)
            • ip_version: 4|6 (default: 4)
            • project_name: Name of the project who owns the network. Note: only administrative users can specify projects other than their own (optional)
            • start: The start address for allocation_pools (optional)
            • end: The ending address for allocation_pools (optional)
            • gateway_ip: The IP address to the gateway (optional)
            • enable_dhcp: T|F (optional)
            • dns_nameservers: List of DNS server IPs (default = [‘8.8.8.8’]
            • host_routes: A list of host route dictionaries (optional) i.e.: yaml    "host_routes":[    {    "destination":"0.0.0.0/0",    "nexthop":"123.456.78.9"    },    {    "destination":"192.168.0.0/24",    "nexthop":"192.168.0.1"    }    ]
            • destination: The destination for a static route (optional)
            • nexthop: The next hop for the destination (optional)
            • ipv6_ra_mode: Valid values: “dhcpv6-stateful”, “dhcpv6-stateless”, and “slaac” (optional)
            • ipv6_address_mode: Valid values: “dhcpv6-stateful”, “dhcpv6-stateless”, and “slaac” (optional)
    • security_groups:

      • security_group:

        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)

        • os_user: the connection from a new user defined in template (required or use “os_creds_name” above

          • name: the user’s name (required)
          • project_name: the project name to use
        • name: The name of the security group to be created (required)

        • description: The security group’s description (optional)

        • project_name: Name of the project who owns the security group (optional)

        • rule_settings: List of rules to place onto security group (optional)

          • description: the rule’s description (optional)
          • protocol: rule’s protcol (‘icmp’ or ‘tcp’ or ‘udp’ or ‘null’)
          • ethertype: rule’s ethertype (‘4’ or ‘6’)
          • port_range_min: The minimum port number in the range that is matched by the security group rule. When the protocol is ‘tcp’ or ‘udp’, this value must be <= ‘port_range_max’ (optional)
          • port_range_max: The maximum port number in the range that is matched by the security group rule. When the protocol is ‘tcp’ or ‘udp’, this value must be <= ‘port_range_max’ (optional)
          • remote_ip_prefix: The remote IP prefix to associate with this metering rule packet (optional)
    • routers:

      • router:

        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)

        • os_user: the connection from a new user defined in template (required or use “os_creds_name” above

          • name: the user’s name (required)
          • project_name: the project name to use
        • name: The name of the router to be created (required)

        • project_name: Name of the project who owns the network (optional)

        • external_gateway: Name of the external network to which to route (optional)

        • admin_state_up: T|F (default True)

        • external_fixed_ids: Dictionary containing the IP address parameters (optional)

        • internal_subnets: List of subnet names to which to connect this router (optional)

          • port_settings (Leverages the same class/structure as port objects on VM instances. See port definition below for a full accounting of the port attributes. The ones listed below are generally used for routers)
            • name: The name given to the new port (required and must be unique for project)
            • network_name: The name of the network on which to create the port (optional)
            • admin_state_up: T|F (default True)
            • project_name: Name of the project who owns the network (optional)
            • mac_address: The port’s MAC address (optional)
            • ip_addrs: A list of k/v pairs (optional)
            • security_groups: a list of names of the the security groups to apply to the port
            • opt_value: The extra DHCP option value (optional)
            • opt_name: The extra DHCP option name (optional)
    • keypairs:

      • keypair:

        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)

        • os_user: the connection from a new user defined in template (required or use “os_creds_name” above

          • name: the user’s name (required)
          • project_name: the project name to use
        • name: The name of the keypair to be created. If one already exists, a new one will not be created but simply loaded from its configured file location (required)

        • public_filepath: The path to where the generated public key will be stored if it does not exist (optional but really required for provisioning purposes)

        • private_filepath: The path to where the generated private key will be stored if it does not exist (optional but really required for provisioning purposes)

    • instances:

      • instance:

        • os_creds_name: the connection name (default = ‘default’ required or use “os_user” below instead)

        • os_user: the connection from a new user defined in template (required or use “os_creds_name” above

          • name: the user’s name (required)
          • project_name: the project name to use
        • name: The unique instance name for project. (required)

        • flavor: Must be one of the preconfigured flavors (required)

        • imageName: The name of the image to be used for deployment (required)

        • keypair_name: The name of the keypair to attach to instance (optional but required for NIC configuration and Ansible provisioning)

        • sudo_user: The name of a sudo_user that is attached to the keypair (optional but required for NIC configuration and Ansible provisioning)

        • vm_boot_timeout: The number of seconds to block waiting for an instance to deploy and boot (default 900)

        • vm_delete_timeout: The number of seconds to block waiting for an instance to be deleted (default 300)

        • ssh_connect_timeout: The number of seconds to block waiting for an instance to achieve an SSH connection (default 120)

        • ports: A list of port configurations (should contain at least one)

        • port: Denotes the configuration of a NIC

          • name: The unique port name for project (required)
          • network_name: The name of the network to which the port is attached (required)
          • ip_addrs: Static IP addresses to be added to the port by subnet (optional)
          • subnet_name: The name of the subnet
          • ip: The assigned IP address (when null, OpenStack will assign an IP to the port)
          • admin_state_up: T|F (default True)
          • project_name: The name of the project who owns the network. Only administrative users can specify a the project ID other than their own (optional)
          • mac_address: The desired MAC for the port (optional)
          • fixed_ips: A dictionary that allows one to specify only a subnet ID, OpenStack Networking allocates an available IP from that subnet to the port. If you specify both a subnet ID and an IP address, OpenStack Networking tries to allocate the specified address to the port. (optional)
          • seurity_groups: A list of security group IDs (optional)
          • allowed_address_pairs: A dictionary containing a set of zero or more allowed address pairs. An address pair contains an IP address and MAC address. (optional)
          • opt_value: The extra DHCP option value (optional)
          • opt_name: The extra DHCP option name (optional)
          • device_owner: The ID of the entity that uses this port. For example, a DHCP agent (optional)
          • device_id: The ID of the device that uses this port. For example, a virtual server (optional)
      • floating_ips: list of floating_ip configurations (optional)
        • floating_ip:
        • name: Must be unique for VM instance (required)
        • port_name: The name of the port requiring access to the external network (required)
        • subnet_name: The name of the subnet contains the IP address on the port on which to create the floating IP (optional)
        • router_name: The name of the router connected to an external network used to attach the floating IP (required)
        • provisioning: (True|False) Denotes whether or not this IP can be used for Ansible provisioning (default True)
  • ansible: Each set of attributes below are contained in a list

    • playbook_location: Full path or relative to the directory in which the deployment file resides (required)
    • hosts: A list of hosts to which the playbook will be executed (required)
    • variables: Should your Ansible scripts require any substitution values to be applied with Jinga2templates, the values defined here will be used to for substitution
    • tag name = substitution variable names. For instance, for any file being pushed to the host being provisioned containing a value such as {{ foo }}, you must specify a tag name of “foo”
      • vm_name:
      • type: string|port|os_creds|vm-attr (note: will need to make changes to deploy_venv.py#__get_variable_value() for additional support)
      • when type == string, an tag name “value” must exist and its value will be used for template substituion
      • when type == port, custom code has been written to extract certain assigned values to the port:
        • vm_name: must correspond to a VM’s name as configured in this file
        • port_name: The name of the port from which to extract the substitution values (required)
        • port_value: The port value. Currently only supporting “mac_address” and “ip_address” (only the first)
      • when type == os_creds, custom code has been written to extract the file’s connection values:
        • username: connection’s user
        • password: connection’s password
        • auth_url: connection’s URL
        • project_name: connection’s project
      • when type == vm-attr, custom code has been written to extract the following attributes from the vm:
        • vm_name: must correspond to a VM’s name as configured in this file
        • value -> floating_ip: is currently the only vm-attr supported

Running Unit Test Suite

Execute the tests

cd <path to repo>
python snaps/test_runner.py -e <path to RC file> -n <external network name>
* All Supported Arguments
* -e [required - The path to the OpenStack RC file]
* -n [required - The name of the external network to use for routers and floating IPs]
* -p [optional - the proxy settings if required. Format :
* -s [optional - the proxy command used for SSH connections]
* -l [(default INFO) The log level]
* -u [optional - When set, the unit tests will be executed]
* -st [optional - When set, the staging tests will be executed]
* -c [optional - When set, the connection tests will be executed]
* -a [optional - When set, the API tests will be executed]
* -i [optional - When set, the integration tests will be executed]
* -k [optional - When set, tests project and user creation. Use only if host running tests has access to the cloud’s admin network]
* -f [optional - When set, will execute tests requiring Floating IPS]
* -im [optional - File containing image endpoints to override
* -fm [optional - JSON string containing a dict() for flavor metadata default=’{“hw:mem_page_size”: “any”}’]
* -ci [optional - runs the tests required by SNAPS-OO CI]
* -r [optional with default value of ‘1’ - The number of test iterations to execute]

SNAPS-OO Library Usage

The pattern used within the SNAPS-OO library for creating OpenStack instances have been made as consistent as possible amongst the different instance types. Each consists of a constructor that takes in a credentials object and generally takes in a single “settings” (configuration) object. The only exception to this rule is with the OpenStackVMInstance (creates an OpenStack Server) where it takes in the additional settings used for the associated image and SSH key-pairs credentials as those objects contain additional attributes required of SNAPS, primarily when one needs to obtain remote access. After instantiation, the create() method must be called to initiate all of the necessary remote API calls to OpenStack required for proper instance creation.

SNAPS Credentials

As communicating with OpenStack is performed via secure remote RESTful API calls, any function or method performing any type of query or CRUD operation must know how to connect to the NFVI. The class *OSCreds* defined in snaps.openstack.os_credentials.py contains everything required to connect to any Keystone v2.0 or v3 authorization server. The attributes are listed below:

  • username
  • password
  • auth_url
  • project_name (aka. tenant_name)
  • identity_api_version (for obtaining Keystone authorization token. default = 2, Versions 2.0 & v3 only validated.)
  • image_api_version (default = 2, Glance version 1 & 2 only validated)
  • network_api_version (Neutron version 2 currently only validated)
  • compute_api_version (Nova version 2 currently only validated)
  • heat_api_version (Heat version 1 currently only validated)
  • volume_api_version (default = 2, Heat versions 2 & 3 currently only validated)
  • user_domain_id (default=’default’)
  • user_domain_name (default=’Default’)
  • project_domain_id (default=’default’)
  • project_domain_name (default=’Default’)
  • interface (default=’admin’, used to specify the endpoint type for keystone: public, admin, internal)
  • cacert (default=False, expected values T|F to denote server certificate verification, else value contains the path to an HTTPS certificate)
  • region_name (The region name default=None)
  • proxy_settings
    • host (the HTTP proxy host)
    • port (the HTTP proxy port)
    • https_host (the HTTPS proxy host, default value of host)
    • https_port (the HTTPS proxy port, default value of port)
    • ssh_proxy_cmd (same as the value placed into ssh -o ProxyCommand=’<this config value>’)

Create OS Credentials Object

from snaps.openstack.os_credentials import OSCreds
os_creds=OSCreds(username='admin', password='admin',
                 auth_url='http://localhost:5000/v3', project_name='admin',
                 identity_api_version=3)

SNAPS Object Creators

Each creator minimally requires an OSCreds object for connecting to the NFVI, associated *Settings object for instance configuration, create() method to make the necessary remote API calls and create all of the necessary OpenStack instances required, and clean() method that is responsible for deleting all associated OpenStack instances. Please see the class diagram here. Below is a textual representation of the requirements of each creator classes with their associated setting classes and a sample code snippet on how to use the code.

Create User

  • User - snaps.openstack.create_user.OpenStackUser
    • snaps.openstack.create_user.UserSettings
      • name - the username (required)
      • password - the user’s password (required)
      • project_name - the name of the project to associated to this user (optional)
      • domain_name - the user’s domain (default=’default’)
      • email - the user’s email address (optional)
      • enabled - flag to determine whether or not the user should be enabled (default=True)
      • roles - dict where key is the role’s name and value is the name the project to associate with the role (optional)
from snaps.openstack.create_user import UserSettings, OpenStackUser
user_settings = UserSettings(name='username', password='password')
user_creator = OpenStackUser(os_creds, user_settings)
user_creator.create()

# Retrieve OS creds for new user for creating other OpenStack instance
user_creds = user_creator.get_os_creds(os_creds.project_name)

# Perform logic
...

# Cleanup
user_creator.clean()

Create Project

  • Project - snaps.openstack.create_project.OpenStackProject
    • snaps.openstack.create_project.ProjectSettings
      • name - the project name (required)
      • domain - the project’s domain (default=’default’)
      • description - the project’s description (optional)
      • enabled - flag to determine whether or not the project should be enabled (default=True)
from snaps.openstack.create_project import ProjectSettings, OpenStackProject
project_settings = ProjectSettings(name='username', password='password')
project_creator = OpenStackProject(os_creds, project_settings)
project_creator.create()

# Perform logic
...

# Cleanup
project_creator.clean()

Create Flavor

  • Flavor - snaps.openstack.create_flavor.OpenStackFlavor
    • snaps.openstack.create_flavor.FlavorSettings
      • name - the flavor name (required)
      • flavor_id - the flavor’s string ID (default=’auto’)
      • ram - memory in MB to allocate to VM (required)
      • disk - disk storage in GB (required)
      • vcpus - the number of CPUs to allocate to VM (required)
      • ephemeral - the size of the ephemeral disk in GB (default=0)
      • swap - the size of the swap disk in GB (default=0)
      • rxtx_factor - the receive/transmit factor to be set on ports if backend supports QoS extension (default=1.0)
      • is_public - flag that denotes whether or not other projects can access image (default=True)
      • metadata - freeform dict() for special metadata (optional)
from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
flavor_settings = FlavorSettings(name='flavor-name', ram=4, disk=10, vcpus=2)
flavor_creator = OpenStackFlavor(os_creds, flavor_settings)
flavor_creator.create()

# Perform logic
...

# Cleanup
flavor_creator.clean()

Create Image

  • Image - snaps.openstack.create_image.OpenStackImage
    • snaps.openstack.create_image.ImageSettings
      • name - the image name (required)
      • image_user - the default image user generally used by OpenStackVMInstance class for obtaining an SSH connection (required)
      • img_format or format - the image’s format (i.e. qcow2) (required)
      • url - the download URL to obtain the image file (this or image_file must be configured, not both)
      • image_file - the location of the file to be sourced from the local filesystem (this or url must be configured, not both)
      • extra_properties - dict() object containing extra parameters to pass when loading the image (i.e. ids of kernel and initramfs images)
      • nic_config_pb_loc - the location of the ansible playbook that can configure additional NICs. Floating IPs are required to perform this operation. (optional and deprecated)
      • kernel_image_settings - the image settings for a kernel image (optional)
      • ramdisk_image_settings - the image settings for a ramdisk image (optional)
      • public - image will be created with public visibility when True (default = False)
from snaps.openstack.create_image import ImageSettings, OpenStackImage
image_settings = ImageSettings(name='image-name', image_user='ubuntu', img_format='qcow2',
                               url='http://uec-images.ubuntu.com/releases/trusty/14.04/ubuntu-14.04-server-cloudimg-amd64-disk1.img')
image_creator = OpenStackImage(os_creds, image_settings)
image_creator.create()

# Perform logic
...

# Cleanup
image_creator.clean()

Create Keypair

  • Keypair - snaps.openstack.create_keypair.OpenStackKeypair
    • snaps.openstack.create_keypair.KeypairSettings
      • name - the keypair name (required)
      • public_filepath - the file location to where the public key is to be written or currently resides (optional)
      • private_filepath - the file location to where the private key file is to be written or currently resides (optional but highly recommended to leverage or the private key will be lost forever)
      • key_size - The number of bytes for the key size when it needs to be generated (value must be >=512, default = 1024)
      • delete_on_clean - when True, the key files will be deleted when OpenStackKeypair#clean() is called (default = False)
from snaps.openstack.create_keypairs import KeypairSettings, OpenStackKeypair
keypair_settings = KeypairSettings(name='kepair-name', private_filepath='/tmp/priv-kp')
keypair_creator = OpenStackKeypair(os_creds, keypair_settings)
keypair_creator.create()

# Perform logic
...

# Cleanup
keypair_creator.clean()

Create Network

  • Network - snaps.openstack.create_network.OpenStackNetwork
    • snaps.openstack.create_network.NetworkSettings
      • name - the name of the network (required)
      • admin_state_up - flag denoting the administrative status of the network (True = up, False = down)
      • shared - flag indicating whether the network can be shared across projects/tenants (default=True)
      • project_name - the name of the project (optional - can only be set by admin users)
      • external - flag determining if network has external access (default=False)
      • network_type - the type of network (i.e. vlan|vxlan|flat)
      • physical_network - the name of the physical network (required when network_type is ‘flat’)
      • segmentation_id - the id of the segmentation (required when network_type is ‘vlan’)
      • subnet_settings (list of optional snaps.openstack.create_network.SubnetSettings objects)
        • cidr - the subnet’s CIDR (required)
        • ip_version - 4 or 6 (default=4)
        • name - the subnet name (required)
        • project_name - the name of the project (optional - can only be set by admin users)
        • start - the start address for the allocation pools
        • end - the end address for the allocation pools
        • gateway_ip - the gateway IP
        • enable_dhcp - flag to determine whether or not to enable DHCP (optional)
        • dns_nameservers - a list of DNS nameservers
        • host_routes - list of host route dictionaries for subnet (optional, see pydoc and Neutron API for more details)
        • destination - the destination for static route (optional)
        • nexthop - the next hop for the destination (optional)
        • ipv6_ra_mode - valid values include: ‘dhcpv6-stateful’, ‘dhcp6v-stateless’, ‘slaac’ (optional)
        • ipvc_address_mode - valid values include: ‘dhcpv6-stateful’, ‘dhcp6v-stateless’, ‘slaac’ (optional)
from snaps.openstack.create_network import NetworkSettings, SubnetSettings, OpenStackNetwork

subnet_settings = SubnetSettings(name='subnet-name', cidr='10.0.0.0/24')
network_settings = NetworkSettings(name='network-name', subnet_settings=[subnet_settings])

network_creator = OpenStackNetwork(os_creds, network_settings)
network_creator.create()

# Perform logic
...

# Cleanup
network_creator.clean()

Create Security Group

  • Security Group - snaps.openstack.create_security_group.OpenStackSecurityGroup
    • snaps.openstack.create_security_group.SecurityGroupSettings
      • name - the security group’s name (required)
      • description - the description (optional)
      • project_name - the name of the project (optional - can only be set by admin users)
      • rule_settings (list of optional snaps.openstack.create_security_group.SecurityGroupRuleSettings objects)
        • sec_grp_name - the name of the associated security group (required)
        • description - the description (optional)
        • direction - enum snaps.openstack.create_security_group.Direction (required)
        • remote_group_id - the group ID to associate with this rule
        • protocol - enum snaps.openstack.create_security_group.Protocol (optional)
        • ethertype - enum snaps.openstack.create_security_group.Ethertype (optional)
        • port_range_min - the max port number in the range that is matched by the security group rule (optional)
        • port_range_max - the min port number in the range that is matched by the security group rule (optional)
        • sec_grp_rule - the rule object to a security group rule object to associate (note: does not work currently)
        • remote_ip_prefix - the remote IP prefix to associate with this metering rule packet (optional)
from snaps.openstack.create_security_group import SecurityGroupSettings, SecurityGroupRuleSettings, Direction, OpenStackSecurityGroup

rule_settings = SubnetSettings(name='subnet-name', cidr='10.0.0.0/24')
network_settings = NetworkSettings(name='network-name', subnet_settings=[subnet_settings])

sec_grp_name = 'sec-grp-name'
rule_settings = SecurityGroupRuleSettings(name=sec_grp_name, direction=Direction.ingress)
security_group_settings = SecurityGroupSettings(name=sec_grp_name, rule_settings=[rule_settings])

security_group_creator = OpenStackSecurityGroup(os_creds, security_group_settings)
security_group_creator.create()

# Perform logic
...

# Cleanup
security_group_creator.clean()

Create Router

  • Router - snaps.openstack.create_router.OpenStackRouter
    • snaps.openstack.create_router.RouterSettings
      • name - the router name (required)
      • project_name - the name of the project (optional - can only be set by admin users)
      • external_gateway - the name of the external network (optional)
      • admin_state_up - flag to denote the administrative status of the router (default=True)
      • external_fixed_ips - dictionary containing the IP address parameters (parameter not tested)
      • internal_subnets - list of subnet names to which this router will connect (optional)
      • port_settings (list of optional snaps.openstack.create_router.PortSettings objects) - creates custom ports to internal subnets (similar to internal_subnets with more control)
        • name - the port’s display name
        • network_name - the name of the network on which to create the port
        • admin_state_up - A boolean value denoting the administrative status of the port (default = True)
        • project_name - the name of the project (optional - can only be set by admin users)
        • mac_address - the port’s MAC address to set (optional and recommended not to set this configuration value)
        • ip_addrs - list of dict() objects containing two keys ‘subnet_name’ and ‘ip’ where the value of the ‘ip’ entry is the expected IP address assigned. This value gets mapped to the fixed_ips attribute (optional)
        • fixed_ips - dict() where the key is the subnet ID and value is the associated IP address to assign to the port (optional)
        • security_groups - list of security group IDs (not tested)
        • allowed_address_pairs - A dictionary containing a set of zero or more allowed address pairs. An address pair contains an IP address and MAC address (optional)
        • opt_value - the extra DHCP option value (optional)
        • opt_name - the extra DHCP option name (optional)
        • device_owner - The ID of the entity that uses this port. For example, a DHCP agent (optional)
        • device_id - The ID of the device that uses this port. For example, a virtual server (optional)
from snaps.openstack.create_router import RouterSettings, OpenStackRouter

router_settings = RouterSettings(name='router-name', external_gateway='external')
router_creator = OpenStackRouter(os_creds, router_settings)
router_creator.create()

# Perform logic
...

# Cleanup
router_creator.clean()

Create QoS Spec

  • Volume Type - snaps.openstack.create_qos.OpenStackQoS
    • snaps.openstack.create_qos.QoSSettings
      • name - the volume type’s name (required)
      • consumer - the qos’s consumer type of the enum type Consumer (required)
      • specs - freeform dict() to be added as ‘specs’ (optional)
from snaps.openstack.create_qos import QoSSettings, OpenStackQoS

qos_settings = QoSSettings(name='stack-name', consumer=Consumer.front-end)
qos_creator = OpenStackQoS(os_creds, vol_type_settings)
qos_creator.create()

# Perform logic
...

# Cleanup
qos_creator.clean()

Create Volume Type

  • Volume Type - snaps.openstack.create_volume_type.OpenStackVolumeType
    • snaps.openstack.create_volume_type.VolumeTypeSettings
      • name - the volume type’s name (required)
      • description - the volume type’s description (optional)
      • encryption - instance or config for VolumeTypeEncryptionSettings (optional)
      • qos_spec_name - name of the QoS Spec to associate (optional)
      • public - instance or config for VolumeTypeEncryptionSettings (optional)
from snaps.openstack.create_volume_type import VolumeTypeSettings, OpenStackVolumeType

vol_type_settings = VolumeTypeSettings(name='stack-name')
vol_type_creator = OpenStackHeatStack(os_creds, vol_type_settings)
vol_type_creator.create()

# Perform logic
...

# Cleanup
vol_type_creator.clean()

Create Volume

  • Volume - snaps.openstack.create_volume.OpenStackVolume
    • snaps.openstack.create_volume.VolumeSettings
      • name - the volume type’s name (required)
      • description - the volume type’s description (optional)
      • size - size of volume in GB (default = 1)
      • image_name - when a glance image is used for the image source (optional)
      • type_name - the associated volume’s type name (optional)
      • availability_zone - the name of the compute server on which to deploy the volume (optional)
      • multi_attach - when true, volume can be attached to more than one server (default = False)
from snaps.openstack.create\_volume import VolumeSettings, OpenStackVolume

vol_settings = VolumeSettings(name='stack-name')
vol_creator = OpenStackVolume(os_creds, vol_settings)
vol_creator.create()

# Perform logic
...

# Cleanup
vol_type_creator.clean()

Create Heat Stack

  • Heat Stack - snaps.openstack.create_stack.OpenStackHeatStack
    • snaps.openstack.create_stack.StackSettings
      • name - the stack’s name (required)
      • template - the heat template in dict() format (required when template_path is None)
      • template_path - the location of the heat template file (required when template is None)
      • env_values - dict() of strings for substitution of template default values (optional)
from snaps.openstack.create_stack import StackSettings, OpenStackHeatStack

stack_settings = StackSettings(name='stack-name', template_path='/tmp/template.yaml')
stack_creator = OpenStackHeatStack(os_creds, stack_settings)
stack_creator.create()

# Perform logic
...

# Cleanup
stack_creator.clean()

Create VM Instance

  • VM Instances - snaps.openstack.create_instance.OpenStackVmInstance
    • snaps.openstack.create_instance.VmInstanceSettings
      • name - the name of the VM (required)
      • flavor - the name of the flavor (required)
      • port_settings - list of snaps.openstack.create_network.PortSettings objects where each denote a NIC (see above in create router section for details) API does not require, but newer NFVIs now require VMs have at least one network
      • security_group_names - a list of security group names to apply to VM
      • floating_ip_settings (list of snaps.openstack_create_instance.FloatingIpSettings objects)
        • name - a name to a floating IP for easy lookup
        • port_name - the name of the VM port on which the floating IP should be applied (required)
        • router_name - the name of the router to the external network (required)
        • subnet_name - the name of the subnet on which to attach the floating IP (optional)
        • provisioning - when true, this floating IP will be used for provisioning which will come into play once we are able to get multiple floating IPs working.
      • sudo_user - overrides the image_settings.image_user value when attempting to connect via SSH
      • vm_boot_timeout - the number of seconds that the thread will block when querying the VM’s status when building (default=900)
      • vm_delete_timeout - the number of seconds that the thread will block when querying the VM’s status when deleting (default=300)
      • ssh_connect_timeout - the number of seconds that the thread will block when attempting to obtain an SSH connection (default=180)
      • availability_zone - the name of the compute server on which to deploy the VM (optional must be admin)
      • userdata - the cloud-init script to execute after VM has been started
    • image_settings - see snaps.openstack.create_image.ImageSettings above (required)
    • keypair_settings - see snaps.openstack.create_keypairs.KeypairSettings above (optional)
from snaps.openstack.create_instance import VmInstanceSettings, FloatingIpSettings, OpenStackVmInstance
from snaps.openstack.create_network import PortSettings

port_settings = PortSettings(name='port-name', network_name=network_settings.name)
floating_ip_settings = FloatingIpSettings(name='fip1', port_name=port_settings.name, router_name=router_settings.name)
instance_settings = VmInstanceSettings(name='vm-name', flavor='flavor_settings.name', port_settings=[port_settings],
                                       floating_ip_settings=[floating_ip_settings])

instance_creator = OpenStackVmInstance(os_creds, instance_settings, image_settings, kepair_settings)
instance_creator.create()

# Perform logic
...
ssh_client = instance_creator.ssh_client()
...

# Cleanup
instance_creator.clean()

Ansible Provisioning

Being able to easily create OpenStack instances such as virtual networks and VMs is a good start to the problem of NFV; however, an NFVI is useless unless there is some software performing some function. This is why we added Ansible playbook support to SNAPS-OO which can be located in snaps.provisioning.ansible_utils#apply_playbook. See below for a description of that function’s parameters:

  • playbook_path - the file location of the ansible playbook
  • hosts_inv - a list of hosts/IP addresses to which the playbook will be applied
  • host_user - the user (preferably sudo) to use for applying the playbook
  • ssh_priv_key_file_path - the location to the private key file used for SSH
  • variables - a dict() of substitution values for Jinga2 templates leveraged by Ansible
  • proxy_setting - used to extract the SSH proxy command (optional)

Apply Ansible Playbook Utility

from snaps.provisioning import ansible_utils

ansible_utils.apply_playbook(playbook_path='provisioning/tests/playbooks/simple_playbook.yml',
                             hosts_inv=[ip], host_user=user, ssh_priv_key_file_path=priv_key,
                             proxy_setting=self.os_creds.proxy_settings)

OpenStack Utilities

For those who do like working procedurally, SNAPS-OO also leverages utilitarian functions for nearly every query or request made to OpenStack. This pattern will make it easier to deal with API version changes as they would all be made in one place. (see keystone_utils for an example of this pattern as this is the only API where SNAPS is supporting more than one version)

  • snaps.openstack.utils.keystone_utils - for calls to the Keystone APIs (support for versions 2 & 3)
  • snaps.openstack.utils.glance_utils - for calls to the Glance APIs (support for versions 1 & 2)
  • snaps.openstack.utils.neutron_utils - for calls to the Neutron APIs (version 2)
  • snaps.openstack.utils.nova_utils - for calls to the Nova APIs (version 2)
  • snaps.openstack.utils.heat_utils - for calls to the Heat APIs (version 1)
  • snaps.openstack.utils.cinder_utils - for calls to the Cinder APIs (support for versions 2 & 3)

SNAPS OpenStack API Testing

Tests designated as component tests extend the snaps.openstack.tests.OSComponentTestCase class and must be exercised with OpenStack credentials for all as well as an external network for many. When leveraging the unit_test_suite.py application, the -e argument and -n arguments will suffice. When attempting to execute these tests within your IDE of choice (tested on IntelliJ), you will need to edit the [repo_dir]/snaps/openstack/tests/conf/os_env.yaml file as well as ensuring that your run configuration’s working directory is set to [repo_dir]/snaps.

The Test Classes

glance_utils_tests.py - GlanceSmokeTests

Ensures that a Glance client can be obtained as well as the proper exceptions thrown with the wrong credentials.

keystone_utils_tests.py - KeystoneSmokeTests

Ensures that a Keystone client can be obtained as well as the proper exceptions thrown with the wrong credentials.

neutron_utils_tests.py - NeutronSmokeTests

Ensures that a Neutron client can be obtained as well as the proper exceptions thrown with the wrong credentials.

nova_utils_tests.py - NovaSmokeTests

Ensures that a Nova client can be obtained as well as the proper exceptions thrown with the wrong credentials.

cinder_utils_tests.py - CinderSmokeTests

Ensures that a Cinder client can be obtained as well as the proper exceptions thrown with the wrong credentials.

heat_utils_tests.py - HeatSmokeTests

Ensures that a Heat client can be obtained as well as the proper exceptions thrown with the wrong credentials.

keystone_utils_tests.py - KeystoneUtilsTests

Test Name Keystone API Description
test_create_user_minimal 2 & 3 Tests the creation of a user with minimal configuration settings via the utility functions
test_create_project_minimal 2 & 3 Tests the creation of a project with minimal configuration settings via the utility functions
test_get_endpoint_success 2 & 3 Tests to ensure that proper credentials and proper service type can succeed
test_get_endpoint_fail_without _proper_service 2 & 3 Tests to ensure that proper credentials and improper service type cannot succeed
test_get_endpoint_fail_without _proper_credentials 2 & 3 Tests to ensure that improper credentials and proper service type cannot succeed
test_get_endpoint_with_each _interface 2 & 3 Tests to ensure that an interface URL is returned for each supported interface type (i.e. public, internal, & admin)
test_grant_user_role_to_project 2 & 3 Tests to ensure that one can grant a new user’s role to a new project

create_user_tests.py - CreateUserSuccessTests

Test Name Keystone API Description
test_create_user 2 & 3 Tests the creation of a user with minimal configuration settings via the utility functions
test_create_user_2x 2 & 3 Tests the creation of a user 2x and ensure it has been done only once
test_create_delete_user 2 & 3 Tests the creation of a user and ensure clean can be called 2x without exceptions being raised
test_create_admin_user 2 & 3 Tests the creation of a user with an ‘admin’ role

create_project_tests.py - CreateProjectSuccessTests

Test Name Keystone API Description
test_create_project_bad_domain 3 Ensures that keystone v3 clients using the domain ID project setting project creation will fail with an invalid domain id/name
test_create_project 2 & 3 Tests the creation of a project via the OpenStackProject class
test_create_project_2x 2 & 3 Tests the creation of a project a second time via the OpenStackProject class to ensure it is only created once
test_create_delete_project 2 & 3 Tests the creation and deletion of a project via the OpenStackProject class to ensure that clean will not raise an exception
test_update_quotas 2 & 3 nova & neutron Tests the ability to update quota values

create_project_tests.py - CreateProjectUserTests

Test Name Keystone API Description
test_create_project_sec_grp_one_user 2 & 3 Tests the creation of an OpenStack object to a project with a new users and to create a security group
test_create_project_sec_grp_two_users 2 & 3 Tests the creation of an OpenStack object to a project with two new users and to create a security group under each

glance_utils_tests.py - GlanceUtilsTests

Test Name Glance API Description
test_create_image_minimal_url 1 Tests the glance_utils.create_image() function with a URL
test_create_image_minimal_file 1 Tests the glance_utils.create_image() function with a file

neutron_utils_tests.py - NeutronUtilsNetworkTests

Test Name Neutron API Description
test_create_network 2 Ensures neutron_utils.create_network() properly creates a network
test_create_network_empty_name 2 Ensures neutron_utils.create_network() raises an exception when the network name is an empty string
test_create_network_null_name 2 Ensures neutron_utils.create_network() raises an exception when the network name is None

neutron_utils_tests.py - NeutronUtilsSubnetTests

Test Name Neutron API Description
test_create_subnet 2 Ensures neutron_utils.create_subnet() can properly create an OpenStack subnet object
test_create_subnet_null_name 2 Ensures neutron_utils.create_subnet() raises an exception when the subnet name is None
test_create_subnet_empty_name 2 Ensures neutron_utils.create_subnet() raises an exception when the subnet name is an empty string
test_create_subnet_null_cidr 2 Ensures neutron_utils.create_subnet() raises an exception when the subnet CIDR is None
test_create_subnet_empty_cidr 2 Ensures neutron_utils.create_subnet() raises an exception when the subnet CIDR is an empty string

neutron_utils_tests.py - NeutronUtilsRouterTests

Test Name Neutron API Description
test_create_router_simple 2 Ensures neutron_utils.create_router() can properly create a simple OpenStack router object
test_create_router_with_public_inter face 2 Ensures neutron_utils.create_router() can properly create an OpenStack router object with an interface to the external network
test_create_router_empty_name 2 Ensures neutron_utils.create_router() raises an exception when the name is an empty string
test_create_router_null_name 2 Ensures neutron_utils.create_router() raises an exception when the name is None
test_add_interface_router 2 Ensures neutron_utils.add_interface_router() properly adds an interface to another subnet
test_add_interface_router_null_router 2 Ensures neutron_utils.add_interface_router() raises an exception when the router object is None
test_add_interface_router_null_subnet 2 Ensures neutron_utils.add_interface_router() raises an exception when the subnet object is None
test_create_port 2 Ensures neutron_utils.create_port() can properly create an OpenStack port object
test_create_port_empty_name 2 Ensures neutron_utils.create_port() raises an exception when the port name is an empty string
test_create_port_null_name 2 Ensures neutron_utils.create_port() raises an exception when the port name is None
test_create_port_null_network_object 2 Ensures neutron_utils.create_port() raises an exception when the network object is None
test_create_port_null_ip 2 Ensures neutron_utils.create_port() raises an exception when the assigned IP value is None
test_create_port_invalid_ip 2 Ensures neutron_utils.create_port() raises an exception when the assigned IP value is invalid
test_create_port_invalid_ip_to_subnet 2 Ensures neutron_utils.create_port() raises an exception when the assigned IP value is not part of CIDR

neutron_utils_tests.py - NeutronUtilsSecurityGroupTests

Test Name Neutron API Description
test_create_delete_simple_sec_grp 2 Ensures that a security group can be created (neutron_utils.create_security_group() and deleted via neutron_utils.delete_security_group()
test_create_sec_grp_no_name 2 Ensures that neutron_utils.create_security_group() raises an exception when attempting to create a security group without a name
test_create_sec_grp_no_rules 2 Ensures that neutron_utils.create_security_group() can create a security group without any rules
test_create_sec_grp_one_rule 2 Ensures that neutron_utils.create_security_group_rule() can add a rule to a security group
test_get_sec_grp_by_id 2 Ensures that neutron_utils.get_security_group_by_id() returns the expected security group

neutron_utils_tests.py - NeutronUtilsFloatingIpTests

Test Name Neutron API Description
test_floating_ips 2 Ensures that a floating IP can be created

cinder_utils_tests.py - CinderUtilsQoSTests

Test Name Cinder API Description
test_create_qos_both 2 & 3 Ensures that a QoS Spec can be created with a Consumer value of ‘both’
test_create_qos_front 2 & 3 Ensures that a QoS Spec can be created with a Consumer value of ‘front-end’
test_create_qos_back 2 & 3 Ensures that a QoS Spec can be created with a Consumer value of ‘back-end’
test_create_delete_qos 2 & 3 Ensures that a QoS Spec can be created and deleted

cinder_utils_tests.py - CinderUtilsSimpleVolumeTypeTests

Test Name Cinder API Description
test_create_simple_volume_type 2 & 3 Tests the creation of a simple volume type with the function cinder_utils#create_volume_type()
test_create_delete_volume_type 2 & 3 Tests the creation of a simple volume type with the function cinder_utils#create_volume_type() then deletes with the function cinder_utils#delete_volume_type()

cinder_utils_tests.py - CinderUtilsAddEncryptionTests

Test Name Cinder API Description
test_create_simple_encryption 2 & 3 Tests the creation of a simple volume type encryption with the function cinder_utils#create_volume_encryption()
test_create_delete_encryption 2 & 3 Tests the creation of a simple volume type encryption with the function cinder_utils#create_volume_encryption() then deletes with the function cinder_utils#delete_volume_type_encryption()
test_create_with_all_attrs 2 & 3 Tests the creation of a simple volume type encryption with the function cinder_utils#create_volume_encryption() where all configuration attributes have been set
test_create_bad_key_size 2 & 3 Tests to ensure that the function cinder_utils#create_volume_encryption() raises a BadRequest exception when the key_size attribute is -1

cinder_utils_tests.py - CinderUtilsVolumeTypeCompleteTests

Test Name Cinder API Description
test_create_with_encryption 2 & 3 Tests the creation of a volume type with encryption with the function cinder_utils#create_volume_type()
test_create_with_qos 2 & 3 Tests the creation of a volume type with a QoS Spec with the function cinder_utils#create_volume_type()
test_create_with_invalid_qos 2 & 3 Tests the creation of a volume type with an invalid QoS Spec with the function cinder_utils#create_volume_type()
test_create_with_qos_and_encryption 2 & 3 Tests the creation of a volume type with a QoS Spec and encryption with the function cinder_utils#create_volume_type()

cinder_utils_tests.py - CinderUtilsVolumeTests

Test Name Cinder API Description
test_create_simple_volume 2 & 3 Tests the creation of a simple volume with the function cinder_utils#create_volume()
test_create_delete_volume 2 & 3 Tests the creation of a volume with the function cinder_utils#create_volume() then deletion with the function cinder_utils#delete_volume()

nova_utils_tests.py - NovaUtilsKeypairTests

Test Name Nova API Description
test_create_keypair 2 Ensures that a keypair can be properly created via nova_utils.upload_keypair() with a public_key object
test_create_delete_keypair 2 Ensures that a keypair can be properly deleted via nova_utils.delete_keypair()
test_create_key_from_file 2 Ensures that a keypair can be properly created via nova_utils.upload_keypair_file()

nova_utils_tests.py - NovaUtilsFlavorTests

Test Name Nova API Description
test_create_flavor 2 Ensures that a flavor can be properly created via nova_utils.create_flavor()
test_create_delete_flavor 2 Ensures that a flavor can be properly deleted via nova_utils.delete_flavor()

nova_utils_tests.py - NovaUtilsInstanceTests

Test Name Nova API Description
test_create_instance 2 Ensures that a VM instance can be properly created via nova_utils.create_server()

nova_utils_tests.py - NovaUtilsInstanceVolumeTests

Test Name Nova API Description
test_add_remove_volume 2 Ensures that a VM instance can properly attach and detach a volume using the nova interface

create_flavor_tests.py - CreateFlavorTests

Test Name Nova API Description
test_create_flavor 2 Ensures that the OpenStackFlavor class’s create() method creates an OpenStack flavor object
test_create_flavor_existing 2 Ensures that the OpenStackFlavor class’s create() will not create a flavor with the same name more than once
test_create_clean_flavor 2 Ensures that the OpenStackFlavor class’s clean() method will delete the flavor object
test_create_delete_flavor 2 Ensures that the OpenStackFlavor class’s clean() method will not raise an exception when called and the object no longer exists
test_create_delete_flavor_all_settings 2 Ensures that the OpenStackFlavor class will create a a flavor properly with all supported settings

heat_utils_tests.py - HeatUtilsCreateSimpleStackTests

Test Name Heat API Description
test_create_stack 1 Tests the heat_utils.create_stack() with a test template
test_create_stack_x2 1 Tests the heat_utils.create_stack() with a test template and attempts to deploy a second time w/o actually deploying any objects

heat_utils_tests.py - HeatUtilsCreateComplexStackTests

Test Name Heat API Description
test_get_settings_from_stack 1 Tests the heat_utils functions that are responsible for reverse engineering settings objects of the types deployed by Heat

heat_utils_tests.py - HeatUtilsVolumeTests

Test Name Heat API Description
test_create_vol_with_stack 1 Tests ability of the function heat_utils.create_stack() to return the correct Volume domain objects deployed with Heat
test_create_vol_types_with_stack 1 Tests ability of the function heat_utils.get_stack_volumes_types() to return the correct VolumeType domain objects deployed with Heat

heat_utils_tests.py - HeatUtilsKeypairTests

Test Name Heat API Description
test_create_keypair_with_stack 1 Tests ability of the function heat_utils.create_stack() to return the correct Keypair domain objects deployed with Heat

heat_utils_tests.py - HeatUtilsFlavorTests

Test Name Heat API Description
test_create_flavor_with_stack 1 Tests ability of the function heat_utils.get_stack_flavors() to return the correct Flavor domain objects deployed with Heat

settings_utils_tests.py - SettingsUtilsNetworkingTests

Test Name API Description
test_derive_net_settings_no_subnet Neutron 2 Tests to ensure that derived NetworkSettings from an OpenStack network are correct without a subnet
test_derive_net_settings_two_subnets Neutron 2 Tests to ensure that derived NetworkSettings from an OpenStack network are correct with two subnets

settings_utils_tests.py - SettingsUtilsVmInstTests

Test Name API Description
test_derive_vm_inst_settings Neutron 2 Tests to ensure that derived VmInstanceSettings from an OpenStack VM instance is correct
test_derive_image_settings Neutron 2 Tests to ensure that derived ImageSettings from an OpenStack VM instance is correct

SNAPS Unit Testing

Tests designated as Unit tests extend the unittest.TestCase class and can be exercised without any external resources
other than the filesystem. Most of these tests simply ensure that the configuration settings classes check their
constructor arguments properly.

The Test Classes

FileUtilsTests

  • testFileIsDirectory - ensures that the expected path is a directory
  • testFileNotExist - ensures that a file that does not exist returns False
  • testFileExists - ensures that a file that does exist returns True
  • testDownloadBadUrl - ensures that an Exception is thrown when attempting to download a file with a bad URL
  • testCirrosImageDownload - ensures that the Cirros image can be downloaded
  • testReadOSEnvFile - ensures that an OpenStack RC file can be properly parsed

ProxySettingsUnitTests

Ensures that all required members are included when constructing a ProxySettings object

OSCredsUnitTests

Ensures that all required members are included when constructing a OSCreds object

SecurityGroupRuleSettingsUnitTests

Ensures that all required members are included when constructing a SecurityGroupRuleSettings object

SecurityGroupRuleDomainObjectTests

Ensures that all required members are included when constructing a SecurityGroupRule domain object

SecurityGroupSettingsUnitTests

Ensures that all required members are included when constructing a SecuirtyGroupSettings object

SecurityGroupDomainObjectTests

Ensures that all required members are included when constructing a SecurityGroup domain object

ImageSettingsUnitTests

Ensures that all required members are included when constructing a ImageSettings object

ImageDomainObjectTests

Ensures that all required members are included when constructing a Image domain object

FlavorSettingsUnitTests

Ensures that all required members are included when constructing a FlavorSettings object

FlavorDomainObjectTests

Ensures that all required members are included when constructing a Flavor domain object

KeypairSettingsUnitTests

Ensures that all required members are included when constructing a KeypairSettings object

KeypairDomainObjectTests

Ensures that all required members are included when constructing a Keypair domain object

UserSettingsUnitTests

Ensures that all required members are included when constructing a UserSettings object

UserDomainObjectTests

Ensures that all required members are included when constructing a User domain object

ProjectSettingsUnitTests

Ensures that all required members are included when constructing a ProjectSettings object

ProjectDomainObjectTests

Ensures that all required members are included when constructing a Project domain object

DomainDomainObjectTests

Ensures that all required members are included when constructing a Domain domain object

ComputeQuotasDomainObjectTests

Ensures that all required members are included when constructing a ComputeQuotas domain object

NetworkQuotasDomainObjectTests

Ensures that all required members are included when constructing a NetworkQuotas domain object

RoleDomainObjectTests

Ensures that all required members are included when constructing a Role domain object

NetworkSettingsUnitTests

Ensures that all required members are included when constructing a NetworkSettings object

NetworkObjectTests

Ensures that all required members are included when constructing a Network domain object

SubnetSettingsUnitTests

Ensures that all required members are included when constructing a SubnetSettings object

SubnetObjectTests

Ensures that all required members are included when constructing a Subnet domain object

PortSettingsUnitTests

Ensures that all required members are included when constructing a PortSettings object

PortDomainObjectTests

Ensures that all required members are included when constructing a Port domain object

RouterSettingsUnitTests

Ensures that all required members are included when constructing a RouterSettings object

RouterDomainObjectTests

Ensures that all required members are included when constructing a Router domain object

InterfaceRouterDomainObjectTests

Ensures that all required members are included when constructing a InterfaceRouter domain object

StackSettingsUnitTests

Ensures that all required members are included when constructing a StackSettings object

StackDomainObjectTests

Ensures that all required members are included when constructing a Stack domain object (for Heat)

ResourceDomainObjectTests

Ensures that all required members are included when constructing a Resource domain object (for Heat)

OutputDomainObjectTests

Ensures that all required members are included when constructing a Output domain object (for Heat)

VolumeSettingsUnitTests

Ensures that all required members are included when constructing a VolumeSettings object

VolumeDomainObjectTests

Ensures that all required members are included when constructing a Volume domain object (for Cinder)

VolumeTypeSettingsUnitTests

Ensures that all required members are included when constructing a VolumeTypeSettings object

VolumeTypeDomainObjectTests

Ensures that all required members are included when constructing a VolumeType domain object (for Cinder)

VolumeTypeEncryptionObjectTests

Ensures that all required members are included when constructing a VolumeTypeEncryption domain object (for Cinder)

QoSSettingsUnitTests

Ensures that all required members are included when constructing a QoSSettings object

QoSSpecDomainObjectTests

Ensures that all required members are included when constructing a QoSSpec domain object (for Cinder)

VolumeDomainObjectTests

Ensures that all required members are included when constructing a Volume domain object (for Cinder)

FloatingIpSettingsUnitTests

Ensures that all required members are included when constructing a FloatingIpSettings object

FloatingIpDomainObjectTests

Ensures that all required members are included when constructing a FloatingIp domain object

VmInstanceSettingsUnitTests

Ensures that all required members are included when constructing a VmInstanceSettings object

VmInstDomainObjectTests

Ensures that all required members are included when constructing a VmInst domain object

SettingsUtilsUnitTests

Ensures that the settings_utils.py#create_volume_settings() function properly maps a snaps.domain.Volume object correctly to a snaps.openstack.create_volume.VolumeSettings object as well as a snaps.domain.VolumeType object to a snaps.openstack.create_volume.VolumeSettings object

Ensures that the settings_utils.py#create_flavor_settings() function properly maps a snaps.domain.Flavor object correctly to a snaps.openstack.create_flavor.FlavorSettings object

SNAPS OpenStack Integration Testing

These tests are ones designed to be run within their own dynamically created project along with a newly generated user account and generally require other OpenStack object creators.

The Test Classes

create_security_group_tests.py - CreateSecurityGroupTests

Test Name API Versions Description
test_create_group_without_rules Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup class can create a security group without any rules
test_create_group_admin_user_to_new _project Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup class can be created by the admin user and associated with a new project
test_create_group_new_user_to_admin _project Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup class can be created by the new user and associated with the admin project
test_create_delete_group Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup class clean() method will not raise an exception should the group be deleted by some other process
test_create_group_with_one_simple_rule Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup class can create a security group with a single simple rule
test_create_group_with_one_complex _rule Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup class can create a security group with a single complex rule
test_create_group_with_several_rules Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup class can create a security group with several rules
test_add_rule Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup#add_rule() method properly creates and associates the new rule
test_remove_rule_by_id Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup#remove_rule() method properly deletes and disassociates the old rule via its ID
test_remove_rule_by_setting Keysone 2 & 3 Neutron 2 Ensures the OpenStackSecurityGroup#remove_rule() method properly deletes and disassociates the old rule via its setting object

create_image_tests.py - CreateImageSuccessTests

Test Name Glance API Description
test_create_image_clean_url 1 & 2 Ensures the OpenStackImage class can create an image from a download URL location
test_create_image_clean_url_properties 1 & 2 Ensures the OpenStackImage class can create an image from a download URL location with custom properties
test_create_image_clean_file 1 & 2 Ensures the OpenStackImage class can create an image from a locally sourced image file
test_create_delete_image 1 & 2 Ensures the OpenStackImage.clean() method deletes an image and does not raise an exception on subsequent calls to the clean() method
test_create_same_image 1 & 2 Ensures the OpenStackImage.create() method does not create another image when one already exists with the same name
test_create_same_image_new_settings 1 & 2 Tests the creation of an OpenStack image when the image already exists and the configuration only contains the the name.

create_image_tests.py - CreateImageNegativeTests

Test Name Glance API Description
test_bad_image_name 1 & 2 Ensures OpenStackImage.create() results in an Exception being raised when the ImageSettings.name attribute has not been set
test_bad_image_url 1 & 2 Ensures OpenStackImage.create() results in an Exception being raised when the download URL is invalid
test_bad_image_type 1 & 2 Ensures OpenStackImage.create() results in an Exception being raised when the image format is ‘foo’
test_bad_image_file 1 & 2 Ensures OpenStackImage.create() results in an Exception being raised when the image file does not exist

create_image_tests.py - CreateMultiPartImageTests

Test Name Glance API Description
test_create_three_part_image_from_url 1 & 2 Ensures that a 3-part image can be created when each part is being sourced from URLs
test_create_three_part_image_from_file _3_creators 1 & 2 Ensures that a 3-part image can be created when each part is being sourced from local files and 3 creators are used
test_create_three_part_image_from_url _3_creators 1 & 2 Ensures that a 3-part image can be created when each part is being sourced from a URL and 3 creators are used

create_keypairs_tests.py - CreateKeypairsTests

Test Name Nova API Description
test_create_keypair_only 2 Ensures that a keypair object can be created simply by only configuring a name
test_create_keypair_large_key 2 Ensures that a keypair object can be created with a large key of 10000 bytes
test_create_delete_keypair 2 Ensures that a keypair object is deleted via OpenStackKeypair.clean() and subsequent calls do not result in exceptions
test_create_keypair_save_pub_only 2 Ensures that a keypair object can be created when the only the public key is cached to disk
test_create_keypair_save_both 2 Ensures that a keypair object can be created when both the public and private keys are cached to disk
test_create_keypair_from_file 2 Ensures that a keypair object can be created with an existing public key file

create_keypairs_tests.py - CreateKeypairsCleanupTests

create_network_tests.py - CreateNetworkSuccessTests

Test Name Neutron API Description
test_create_network_without_router 2 Ensures that a network can be created via the OpenStackNetwork class without any routers
test_create_delete_network 2 Ensures that a router can be deleted via the OpenStackNetwork.clean() method
test_create_network_with_router 2 Ensures that a network can be created via the OpenStackNetwork class with a router
test_create_networks_same_name 2 Ensures that the OpenStackNetwork.create() method will not create a network with the same name
test_create_networks_router_admin_user _to_new_project 2 Ensures that the networks, subnets, and routers can be create created by an admin user and assigned to a new project ID
test_create_networks_router_new_user _to_admin_project 2 Ensures that the networks, subnets, and routers can be create created by a new admin user and assigned to the ‘admin’ project ID

create_router_tests.py - CreateRouterSuccessTests

Test Name Neutron API Description
test_create_router_vanilla 2 Ensures that a router can be created via the OpenStackRouter class with minimal settings
test_create_router_admin_user_to_new _project 2 Ensures that a router can be created by an admin user and assigned to a new project
test_create_router_new_user_to_admin _project 2 Ensures that a router can be created by a new user and assigned to the admin project
test_create_delete_router 2 Ensures that a router can be deleted via the OpenStackRouter.clean() method
test_create_router_admin_state_false 2 Ensures that a router can created with admin_state_up = False
test_create_router_admin_state_True 2 Ensures that a router can created with admin_state_up = True
test_create_router_private_network 2 Ensures that a router port can be created against a private network
test_create_router_external_network 2 Ensures that a router can be created that is connected to both external and private internal networks

create_router_tests.py - CreateRouterNegativeTests

Test Name Neutron API Description
test_create_router_noname 2 Ensures that an exception is raised when attempting to create a router without a name
test_create_router_invalid_gateway_name 2 Ensures that an exception is raised when attempting to create a router to an external network that does not exist

create_qos_tests.py - CreateQoSTests

Test Name Cinder API Description
test_create_qos 2 & 3 Tests the creation of a QoS Spec with the class OpenStackQoS
test_create_delete_qos 2 & 3 Tests the creation of a QoS Spec with the class OpenStackQoS, its deletion with cinder_utils.py the the attempts to use the clean() method to ensure an exception is not called
test_create_same_qos 2 & 3 Tests the creation of a QoS Spec with the class OpenStackQoS then instantiates another OpenStackQoS object with the same configuration to ensure the second instance returns the ID of the original

create_volume_type_tests.py - CreateSimpleVolumeTypeSuccessTests

Test Name Cinder API Description
test_create_volume_type 2 & 3 Tests the creation of a Volume Type with the class OpenStackVolumeType
test_create_delete_volume_type 2 & 3 Tests the creation of a Volume Type with the class OpenStackVolumeType, its deletion with cinder_utils.py, then attempts to use the clean() method to ensure an exception is not raised
test_create_same_volume_type 2 & 3 Tests the creation of a Volume Type with the class OpenStackVolumeType then instantiates another OpenStackVolumeType object with the same configuration to ensure the second instance returns the ID of the original

create_volume_type_tests.py - CreateSimpleVolumeTypeComplexTests

Test Name Cinder API Description
test_volume_type_with_qos 2 & 3 Tests the creation of a Volume Type with the class OpenStackVolumeType with a QoSSpec
test_volume_type_with_encryption 2 & 3 Tests the creation of a Volume Type with the class OpenStackVolumeType with encryption
test_volume_type_with_qos_and_encryption 2 & 3 Tests the creation of a Volume Type with the class OpenStackVolumeType with encryption and QoS Spec

create_volume_tests.py - CreateSimpleVolumeSuccessTests

Test Name Cinder API Description
test_create_volume_simple 2 & 3 Tests the creation of a Volume Type with the class OpenStackVolume
test_create_delete_volume 2 & 3 Tests the creation of a Volume with the class OpenStackVolume, its deletion with cinder_utils.py, then attempts to use the clean() method to ensure an exception is not raised
test_create_same_volume 2 & 3 Tests the creation of a Volume with the class OpenStackVolume then instantiates another OpenStackVolume object with the same configuration to ensure the second instance returns the ID of the original

create_volume_tests.py - CreateSimpleVolumeFailureTests

Test Name Cinder API Description
test_create_volume_bad_size 2 & 3 Tests to ensure that attempting to create a volume with a size of -1 raises a BadRequest exception
test_create_volume_bad_type 2 & 3 Tests to ensure that attempting to create a volume with a type that does not exist raises a NotFound exception
test_create_volume_bad_image 2 & 3 Tests to ensure that attempting to create a volume with an image that does not exist raises a BadRequest exception
test_create_volume_bad_zone 2 & 3 Tests to ensure that attempting to create a volume with an invalid availability zone raises a BadRequest exception

create_volume_tests.py - CreateVolumeWithTypeTests

Test Name Cinder API Description
test_bad_volume_type 2 & 3 Tests to ensure the creation of a Volume with the OpenStackVolume#create() method raises a NotFound exception when attempting to apply a VolumeType that does not exist
test_valid_volume_type 2 & 3 Tests to ensure the creation of a Volume with the OpenStackVolume#create() method properly creates the volume when associating with a valid VolumeType

create_volume_tests.py - CreateVolumeWithImageTests

Test Name Cinder API Description
test_bad_image_name 2 & 3 Tests to ensure the creation of a Volume with the OpenStackVolume#create() method raises a BadRequest exception when attempting to apply an image that does not exist
test_valid_volume_image 2 & 3 Tests to ensure the creation of a Volume with the OpenStackVolume#create() method properly creates the volume when associating with a valid image

create_stack_tests.py - CreateStackSuccessTests

Test Name Heat API Description
test_create_stack_template_file 1 Ensures that a Heat stack can be created with a file-based Heat template file
test_create_stack_template_dict 1 Ensures that a Heat stack can be created with a dictionary Heat template
test_create_delete_stack 1 Ensures that a Heat stack can be created and deleted while having clean() called 2x without an exception
test_create_same_stack 1 Ensures that a Heat stack with the same name cannot be created 2x
test_retrieve_network_creators 1 Ensures that an OpenStackHeatStack instance can return an OpenStackNetwork instance configured as deployed
test_retrieve_vm_inst_creators 1 Ensures that an OpenStackHeatStack instance can return an OpenStackVmInstance instance configured as deployed

create_stack_tests.py - CreateStackVolumeTests

Test Name Heat API Description
test_retrieve_volume_creator 1 Ensures that an OpenStackHeatStack instance can return a OpenStackVolume instance that it was responsible for deploying
test_retrieve_volume_type_creator 1 Ensures that an OpenStackHeatStack instance can return a OpenStackVolumeType instance that it was responsible for deploying

create_stack_tests.py - CreateStackFlavorTests

Test Name Heat API Description
test_retrieve_flavor_creator 1 Ensures that an OpenStackHeatStack instance can return a OpenStackFlavor instance that it was responsible for deploying

create_stack_tests.py - CreateStackKeypairTests

Test Name Heat API Description
test_retrieve_keypair_creator 1 Ensures that an OpenStackHeatStack instance can return a OpenStackKeypair instance that it was responsible for deploying

create_stack_tests.py - CreateComplexStackTests

Test Name Heat API Description
test_connect_via_ssh_heat_vm 1 Ensures that two OpenStackHeatStack instances can return OpenStackVmInstance instances one configured with a floating IP and keypair and can be access via SSH

create_stack_tests.py - CreateStackNegativeTests

Test Name Heat API Description
test_missing_dependencies 1 Ensures that a Heat template fails to deploy when expected dependencies are missing
test_bad_stack_file 1 Ensures that a Heat template fails to deploy when the Heat template file does not exist

create_instance_tests.py - CreateInstanceSimpleTests

Test Name API Versions Description
test_create_delete_instance Nova 2 Neutron 2 Ensures that the OpenStackVmInstance.clean() method deletes the instance

create_instance_tests.py - SimpleHealthCheck

Test Name API Versions Description
test_check_vm_ip_dhcp Nova 2 Neutron 2 Tests the creation of an OpenStack instance with a single port and it’s assigned IP address

create_instance_tests.py - CreateInstanceTwoNetTests

Test Name API Versions Description
test_ping_via_router Nova 2 Neutron 2 Tests the ability of two VMs on different private overlay networks tied together with a router to ping each other

create_instance_tests.py - CreateInstanceSingleNetworkTests

Test Name API Versions Description
test_single_port_static Nova 2 Neutron 2 Ensures that an instance with a single port/NIC with a static IP can be created
test_ssh_client_fip_before_active Nova 2 Neutron 2 Ensures that an instance can be reached over SSH when the floating IP is assigned prior to the VM becoming ACTIVE
test_ssh_client_fip_after_active Nova 2 Neutron 2 Ensures that an instance can be reached over SSH when the floating IP is assigned after to the VM becoming ACTIVE
test_ssh_client_fip_second_creator Nova 2 Neutron 2 Ensures that an instance can be reached over SSH via a second identical creator object

create_instance_tests.py - CreateInstancePortManipulationTests

Test Name API Versions Description
test_set_custom_valid_ip_one_subnet Nova 2 Neutron 2 Ensures that an instance’s can have a valid static IP is properly assigned
test_set_custom_invalid_ip_one_subnet Nova 2 Neutron 2 Ensures that an instance’s port with an invalid static IP raises an exception
test_set_custom_valid_mac Nova 2 Neutron 2 Ensures that an instance’s port can have a valid MAC address properly assigned
test_set_custom_invalid_mac Nova 2 Neutron 2 Ensures that an instance’s port with an invalid MAC address raises and exception
test_set_custom_mac_and_ip Nova 2 Neutron 2 Ensures that an instance’s port with a valid static IP and MAC are properly assigned
test_set_allowed_address_pairs Nova 2 Neutron 2 Ensures the configured allowed_address_pairs is properly set on a VMs port
test_set_allowed_address_pairs_bad_mac Nova 2 Neutron 2 Ensures the port cannot be created when a bad MAC address format is used in the allowed_address_pairs port attribute
test_set_allowed_address_pairs_bad_ip Nova 2 Neutron 2 Ensures the port cannot be created when a bad IP address format is used in the allowed_address_pairs port attribute

create_instance_tests.py - CreateInstanceOnComputeHost

Test Name API Versions Description
test_deploy_vm_to_each_compute_node Nova 2 Neutron 2 Tests to ensure that one can fire up an instance on each active compute node

create_instance_tests.py - CreateInstanceFromThreePartImage

Test Name API Versions Description
test_create_delete_instance_from_three_part_image Nova 2 Neutron 2 Tests to ensure that one can fire up an instance then delete it when using a 3-part image

create_instance_tests.py - CreateInstancePubPrivNetTests

Test Name API Versions Description
test_dual_ports_dhcp Nova 2 Neutron 2 Ensures that a VM with two ports/NICs can have its second NIC configured via SSH/Ansible after startup

create_instance_tests.py - InstanceSecurityGroupTests

Test Name API Versions Description
test_add_security_group Nova 2 Neutron 2 Ensures that a VM instance can have security group added to it while its running
test_add_invalid_security_group Nova 2 Neutron 2 Ensures that a VM instance does not accept the addition of a security group that no longer exists
test_remove_security_group Nova 2 Neutron 2 Ensures that a VM instance accepts the removal of a security group
test_remove_security_group_never_added Nova 2 Neutron 2 Ensures that a VM instance does not accept the removal of a security group that was never added in the first place
test_add_same_security_group Nova 2 Neutron 2 Ensures that a VM instance does not add a security group that has already been added to the instance

create_instance_tests.py - CreateInstanceVolumeTests

Test Name API Versions Description
test_create_instance_with_one_volume Nova 2 Cinder 2 & 3 Ensures that a VM instance can have one volume attached to it
test_create_instance_with_two_volumes Nova 2 Cinder 2 & 3 Ensures that a VM instance can have two volumes attached to it

ansible_utils_tests.py - AnsibleProvisioningTests

Test Name API Versions Description
test_apply_simple_playbook Nova 2 Neutron 2 Ensures that an instance assigned with a floating IP will apply a simple Ansible playbook
test_apply_template_playbook Nova 2 Neutron 2 Ensures that an instance assigned with a floating IP will apply a Ansible playbook containing Jinga2 substitution values