Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 116a4d7

Browse files
committed
Merge pull request #570 from jrperritt/fix-image-tests
fixes for image unit tests
2 parents 524bceb + 65d5ee2 commit 116a4d7

File tree

2 files changed

+49
-6
lines changed

2 files changed

+49
-6
lines changed

openstack/compute/v2/images/requests_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ func TestListImages(t *testing.T) {
3737
"created": "2014-09-23T12:54:52Z",
3838
"minDisk": 0,
3939
"progress": 100,
40-
"minRam": 0,
41-
"metadata": {}
40+
"minRam": 0
4241
},
4342
{
4443
"status": "ACTIVE",
@@ -49,8 +48,7 @@ func TestListImages(t *testing.T) {
4948
"created": "2014-09-23T12:51:42Z",
5049
"minDisk": 0,
5150
"progress": 100,
52-
"minRam": 0,
53-
"metadata": {}
51+
"minRam": 0
5452
}
5553
]
5654
}
@@ -130,8 +128,7 @@ func TestGetImage(t *testing.T) {
130128
"created": "2014-09-23T12:54:52Z",
131129
"minDisk": 0,
132130
"progress": 100,
133-
"minRam": 0,
134-
"metadata": {}
131+
"minRam": 0
135132
}
136133
}
137134
`)

rackspace/compute/v2/images/fixtures.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,29 @@ var ArchImage = os.Image{
180180
MinRAM: 512,
181181
Progress: 100,
182182
Status: "ACTIVE",
183+
Metadata: map[string]string{
184+
"auto_disk_config": "True",
185+
"cache_in_nova": "True",
186+
"com.rackspace__1__build_core": "1",
187+
"com.rackspace__1__build_managed": "1",
188+
"com.rackspace__1__build_rackconnect": "1",
189+
"com.rackspace__1__options": "0",
190+
"com.rackspace__1__platform_target": "PublicCloud",
191+
"com.rackspace__1__release_build_date": "2014-10-01_12-31-03",
192+
"com.rackspace__1__release_id": "1007",
193+
"com.rackspace__1__release_version": "6",
194+
"com.rackspace__1__source": "kickstart",
195+
"com.rackspace__1__visible_core": "1",
196+
"com.rackspace__1__visible_managed": "1",
197+
"com.rackspace__1__visible_rackconnect": "1",
198+
"image_type": "base",
199+
"org.openstack__1__architecture": "x64",
200+
"org.openstack__1__os_distro": "com.ubuntu",
201+
"org.openstack__1__os_version": "14.04",
202+
"os_distro": "ubuntu",
203+
"os_type": "linux",
204+
"vm_mode": "xen",
205+
},
183206
}
184207

185208
// UbuntuImage is the second Image structure that should be parsed from ListOutput and
@@ -193,6 +216,29 @@ var UbuntuImage = os.Image{
193216
MinRAM: 512,
194217
Progress: 100,
195218
Status: "ACTIVE",
219+
Metadata: map[string]string{
220+
"auto_disk_config": "True",
221+
"cache_in_nova": "True",
222+
"com.rackspace__1__build_core": "1",
223+
"com.rackspace__1__build_managed": "1",
224+
"com.rackspace__1__build_rackconnect": "1",
225+
"com.rackspace__1__options": "0",
226+
"com.rackspace__1__platform_target": "PublicCloud",
227+
"com.rackspace__1__release_build_date": "2014-10-01_12-31-03",
228+
"com.rackspace__1__release_id": "1007",
229+
"com.rackspace__1__release_version": "6",
230+
"com.rackspace__1__source": "kickstart",
231+
"com.rackspace__1__visible_core": "1",
232+
"com.rackspace__1__visible_managed": "1",
233+
"com.rackspace__1__visible_rackconnect": "1",
234+
"image_type": "base",
235+
"org.openstack__1__architecture": "x64",
236+
"org.openstack__1__os_distro": "com.ubuntu",
237+
"org.openstack__1__os_version": "14.04",
238+
"os_distro": "ubuntu",
239+
"os_type": "linux",
240+
"vm_mode": "xen",
241+
},
196242
}
197243

198244
// ExpectedImageSlice is the collection of images that should be parsed from ListOutput,

0 commit comments

Comments
 (0)