May 2018
Intermediate to advanced
256 pages
7h 6m
English
In Chapter 4, Building the Deployment Pipeline, we wrote some basic tests for our OpenStack deployment using shell tools. In this section, we'll combine the code examples discussed earlier in the chapter with the Python unit test library to generate a set of automated tests that can be run from Jenkins to verify our deployment. The following example, which uses the Python unittest and requests libraries, is very simple, but can be used as a starting point:
#!/usr/bin/env python import unittest import requests #http://docs.python-requests.org/en/latest import json KEYSTONE_URL = 'http://controller01:5000/v2.0/' TENANT = 'demo' USERNAME = 'demo' PASSWORD = 'secret'
Once we've imported the necessary libraries and set the ...
Read now
Unlock full access