@@ -38,32 +38,47 @@ var findOSImageTestResponse = `
38
38
{
39
39
"osImage": [
40
40
{
41
- "name": "CentOS 7 64-bit 2 CPU",
42
- "description": "CentOS Release 7.1 64-bit",
43
- "operatingSystem": {
44
- "id": "CENTOS764",
45
- "displayName": "CENTOS7/64",
46
- "family": "UNIX"
47
- },
48
- "cpu": {
49
- "count": 2,
50
- "speed": "STANDARD",
51
- "coresPerSocket": 1
52
- },
53
- "memoryGb": 4,
54
- "disk": [
55
- {
56
- "id": "55f6780c-bcc6-49d5-8e9b-26c26b6381fa",
57
- "scsiId": 0,
58
- "sizeGb": 10,
59
- "speed": "STANDARD"
41
+ "name": "CentOS 7 64-bit 2 CPU",
42
+ "description": "CentOS Release 7.2 64-bit",
43
+ "cpu": {
44
+ "count": 2,
45
+ "speed": "STANDARD",
46
+ "coresPerSocket": 1
47
+ },
48
+ "memoryGb": 4,
49
+ "scsiController": [
50
+ {
51
+ "id": "eec5a912-0fb0-11e7-b626-001b21cfdbe0",
52
+ "adapterType": "LSI_LOGIC_PARALLEL",
53
+ "key": 1000,
54
+ "disk": [
55
+ {
56
+ "id": "fab8c94e-5f8a-4617-8be9-6514fc779bf1",
57
+ "sizeGb": 10,
58
+ "speed": "STANDARD",
59
+ "scsiId": 0
60
+ }
61
+ ],
62
+ "busNumber": 0
63
+ }
64
+ ],
65
+ "sataController": [],
66
+ "floppy": [],
67
+ "nic": [],
68
+ "softwareLabel": [],
69
+ "createTime": "2016-08-10T14:05:12.000Z",
70
+ "id": "e1b4e0cc-35ba-47be-a2d7-1b5601b87119",
71
+ "datacenterId": "AU9",
72
+ "osImageKey": "T-CENT-7-64-2-4-10",
73
+ "sortOrder": 65,
74
+ "guest": {
75
+ "operatingSystem": {
76
+ "id": "CENTOS764",
77
+ "displayName": "CENTOS7/64",
78
+ "family": "UNIX"
79
+ },
80
+ "osCustomization": true
60
81
}
61
- ],
62
- "softwareLabel": [],
63
- "createTime": "2015-10-26T10:34:40.000Z",
64
- "id": "7e68acb4-bbb8-4206-b30b-0e6c878056bc",
65
- "datacenterId": "AU9",
66
- "osImageKey": "T-CENT-7-64-2-4-10"
67
82
}
68
83
],
69
84
"pageNumber": 1,
@@ -77,26 +92,33 @@ func verifyFindOSImageTestResponse(test *testing.T, image *OSImage) {
77
92
expect := expect (test )
78
93
79
94
expect .NotNil ("OSImage" , image )
80
- expect .EqualsString ("OSImage.ID" , "7e68acb4-bbb8-4206-b30b-0e6c878056bc " , image .ID )
95
+ expect .EqualsString ("OSImage.ID" , "e1b4e0cc-35ba-47be-a2d7-1b5601b87119 " , image .ID )
81
96
expect .EqualsString ("OSImage.Name" , "CentOS 7 64-bit 2 CPU" , image .Name )
82
- expect .EqualsString ("OSImage.Description" , "CentOS Release 7.1 64-bit" , image .Description )
97
+ expect .EqualsString ("OSImage.Description" , "CentOS Release 7.2 64-bit" , image .Description )
83
98
84
- expect .EqualsString ("OSImage.OperatingSystem.ID" , "CENTOS764" , image .OperatingSystem .ID )
85
- expect .EqualsString ("OSImage.OperatingSystem.DisplayName" , "CENTOS7/64" , image .OperatingSystem .DisplayName )
86
- expect .EqualsString ("OSImage.OperatingSystem.Family" , "UNIX" , image .OperatingSystem .Family )
99
+ expect .EqualsString ("OSImage.Guest. OperatingSystem.ID" , "CENTOS764" , image . Guest .OperatingSystem .ID )
100
+ expect .EqualsString ("OSImage.Guest. OperatingSystem.DisplayName" , "CENTOS7/64" , image . Guest .OperatingSystem .DisplayName )
101
+ expect .EqualsString ("OSImage.Guest. OperatingSystem.Family" , "UNIX" , image . Guest .OperatingSystem .Family )
87
102
88
103
expect .EqualsInt ("OSImage.CPU.Count" , 2 , image .CPU .Count )
89
104
expect .EqualsString ("OSImage.CPU.Speed" , "STANDARD" , image .CPU .Speed )
90
105
expect .EqualsInt ("OSImage.CPU.CoresPerSocket" , 1 , image .CPU .CoresPerSocket )
91
106
92
- expect .NotNil ("OSImage.Disks " , image .Disks )
107
+ expect .EqualsInt ("OSImage.SCSIControllers.Length " , 1 , len ( image .SCSIControllers ) )
93
108
94
- disk1 := image .Disks [0 ]
95
- expect .EqualsString ("OSImage.Disks[0].ID" , "55f6780c-bcc6-49d5-8e9b-26c26b6381fa" , disk1 .ID )
109
+ controller1 := image .SCSIControllers [0 ]
110
+ expect .EqualsString ("OSImage.SCSIControllers[0].ID" , "eec5a912-0fb0-11e7-b626-001b21cfdbe0" , controller1 .ID )
111
+ expect .EqualsString ("OSImage.SCSIControllers[0].AdapterType" , StorageControllerAdapterTypeLSILogicParallel , controller1 .AdapterType )
112
+ expect .EqualsInt ("OSImage.SCSIControllers[0].BusNumber" , 0 , controller1 .BusNumber )
113
+
114
+ expect .EqualsInt ("OSImage.SCSIControllers[0].Disks.Length" , 1 , len (controller1 .Disks ))
115
+
116
+ disk1 := controller1 .Disks [0 ]
117
+ expect .EqualsString ("OSImage.Disks[0].ID" , "fab8c94e-5f8a-4617-8be9-6514fc779bf1" , disk1 .ID )
96
118
expect .EqualsInt ("OSImage.Disks[0].SCSIUnitID" , 0 , disk1 .SCSIUnitID )
97
119
expect .EqualsInt ("OSImage.Disks[0].SizeGB" , 10 , disk1 .SizeGB )
98
120
expect .EqualsString ("OSImage.Disks[0].Speed" , "STANDARD" , disk1 .Speed )
99
121
100
- expect .EqualsString ("OSImage.CreateTime" , "2015-10-26T10:34:40 .000Z" , image .CreateTime )
122
+ expect .EqualsString ("OSImage.CreateTime" , "2016-08-10T14:05:12 .000Z" , image .CreateTime )
101
123
expect .EqualsString ("OSImage.OSImageKey" , "T-CENT-7-64-2-4-10" , image .OSImageKey )
102
124
}
0 commit comments