Unit tests for the creation of the cloud-config file.
WPI: improve test code.
Prepare some testing utilities for repeating functions and promises.
Use the utilities to test the creation promises.