'Tests the build_userdata function.'

def test_build_userdata(self):

    cfg.CONF.set_override('heat_metadata_server_url', 'http://server.test:123')
    cfg.CONF.set_override('heat_watch_server_url', 'http://server.test:345')
    cfg.CONF.set_override('instance_connection_is_secure', False)
    cfg.CONF.set_override('instance_connection_https_validate_certificates', False)
    data = self.nova_plugin.build_userdata({})
    self.assertIn('Content-Type:    text/cloud-config;', data)
    self.assertIn('Content-Type:    text/cloud-boothook;', data)
    self.assertIn('Content-Type:    text/part-handler;', data)
    self.assertIn('Content-Type:    text/x-cfninitdata;', data)
    self.assertIn('Content-Type:    text/x-shellscript;', data)
    self.assertIn('http://server.test:345', data)
    self.assertIn('http://server.test:123', data)
    self.assertIn('[Boto]', data)
