@@ -122,6 +122,83 @@ describe('Compute', () => {
122
122
} ) ;
123
123
} ) ;
124
124
125
+ describe ( 'Images' , ( ) => {
126
+ let NAME = null ;
127
+
128
+ before ( async ( ) => {
129
+ client = new compute . ImagesClient ( { fallback : 'rest' } ) ;
130
+ NAME = generateName ( 'image' ) ;
131
+ } ) ;
132
+
133
+ after ( async ( ) => {
134
+ await client . delete ( {
135
+ project,
136
+ image : NAME ,
137
+ } ) ;
138
+ } ) ;
139
+
140
+ it ( 'create and fetch image, test int64 type field' , async function ( ) {
141
+ this . timeout ( 10 * 60 * 1000 ) ;
142
+ const resource = {
143
+ name : NAME ,
144
+ licenseCodes : [ 5543610867827062957 ] ,
145
+ sourceImage :
146
+ 'projects/debian-cloud/global/images/debian-10-buster-v20210721' ,
147
+ } ;
148
+ const [ op ] = await client . insert ( {
149
+ project,
150
+ imageResource : resource ,
151
+ } ) ;
152
+ await waitGlobalOperation ( op ) ;
153
+ const [ fetched ] = await client . get ( {
154
+ project,
155
+ image : NAME ,
156
+ } ) ;
157
+ assert . strictEqual ( fetched . licenseCodes [ 0 ] , '5543610867827062957' ) ;
158
+ } ) ;
159
+ } ) ;
160
+
161
+ describe ( 'Firewall' , ( ) => {
162
+ let NAME = null ;
163
+
164
+ before ( async ( ) => {
165
+ client = new compute . FirewallsClient ( { fallback : 'rest' } ) ;
166
+ NAME = generateName ( 'firewall' ) ;
167
+ } ) ;
168
+
169
+ after ( async function ( ) {
170
+ this . timeout ( 10 * 60 * 1000 ) ;
171
+ await client . delete ( {
172
+ project,
173
+ firewall : NAME ,
174
+ } ) ;
175
+ } ) ;
176
+
177
+ it ( 'create and fetch firewall, test capital letter field like "IPProtocol"' , async function ( ) {
178
+ this . timeout ( 10 * 60 * 1000 ) ;
179
+ const resource = {
180
+ name : NAME ,
181
+ sourceRanges : [ '0.0.0.0/0' ] ,
182
+ allowed : [
183
+ {
184
+ IPProtocol : 'tcp' ,
185
+ ports : [ '80' ] ,
186
+ } ,
187
+ ] ,
188
+ } ;
189
+ const [ op ] = await client . insert ( {
190
+ project,
191
+ firewallResource : resource ,
192
+ } ) ;
193
+ await waitGlobalOperation ( op ) ;
194
+ const [ fetched ] = await client . get ( {
195
+ project,
196
+ firewall : NAME ,
197
+ } ) ;
198
+ assert . strictEqual ( fetched . allowed [ 0 ] . IPProtocol , 'tcp' ) ;
199
+ } ) ;
200
+ } ) ;
201
+
125
202
describe ( 'Instances' , ( ) => {
126
203
let INSTANCE_NAME = null ;
127
204
0 commit comments