blob: b9d51979d7f00687c4a6c44ea916068bf7d7dafd [file] [log] [blame]
Jon Perritt5a0ddd82015-02-09 17:07:21 -07001// +build acceptance
2
3package v1
4
5import (
6 "fmt"
7 "os"
8 "testing"
9
10 "github.com/rackspace/gophercloud"
11 "github.com/rackspace/gophercloud/rackspace"
12 th "github.com/rackspace/gophercloud/testhelper"
13)
14
15var template = fmt.Sprintf(`
16{
17 "heat_template_version": "2013-05-23",
18 "description": "Simple template to test heat commands",
19 "parameters": {},
20 "resources": {
21 "hello_world": {
22 "type":"OS::Nova::Server",
23 "properties": {
24 "flavor": "%s",
25 "image": "%s",
26 "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
27 }
28 }
29 }
30}
31`, os.Getenv("RS_FLAVOR_ID"), os.Getenv("RS_IMAGE_ID"))
32
33func newClient(t *testing.T) *gophercloud.ServiceClient {
34 ao, err := rackspace.AuthOptionsFromEnv()
35 th.AssertNoErr(t, err)
36
37 client, err := rackspace.AuthenticatedClient(ao)
38 th.AssertNoErr(t, err)
39
40 c, err := rackspace.NewOrchestrationV1(client, gophercloud.EndpointOpts{
41 Region: os.Getenv("RS_REGION_NAME"),
42 })
43 th.AssertNoErr(t, err)
44 return c
45}