Skip to content

Commit f4f53cc

Browse files
georgiyekkertSurferJeffAtGooglebcoe
authored
test: add tests for cap letter field, int64 type field (compute) (#629)
Co-authored-by: Jeffrey Rennie <[email protected]> Co-authored-by: Benjamin E. Coe <[email protected]>
1 parent 37614a4 commit f4f53cc

File tree

1 file changed

+77
-0
lines changed
  • packages/google-cloud-compute/system-test

1 file changed

+77
-0
lines changed

packages/google-cloud-compute/system-test/compute.js

+77
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,83 @@ describe('Compute', () => {
122122
});
123123
});
124124

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+
125202
describe('Instances', () => {
126203
let INSTANCE_NAME = null;
127204

0 commit comments

Comments
 (0)