Skip to content

Commit

Permalink
test: add tests for cap letter field, int64 type field (compute) (#629)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeffrey Rennie <rennie@google.com>
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
  • Loading branch information
3 people authored Nov 23, 2021
1 parent 37614a4 commit f4f53cc
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions packages/google-cloud-compute/system-test/compute.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,83 @@ describe('Compute', () => {
});
});

describe('Images', () => {
let NAME = null;

before(async () => {
client = new compute.ImagesClient({fallback: 'rest'});
NAME = generateName('image');
});

after(async () => {
await client.delete({
project,
image: NAME,
});
});

it('create and fetch image, test int64 type field', async function () {
this.timeout(10 * 60 * 1000);
const resource = {
name: NAME,
licenseCodes: [5543610867827062957],
sourceImage:
'projects/debian-cloud/global/images/debian-10-buster-v20210721',
};
const [op] = await client.insert({
project,
imageResource: resource,
});
await waitGlobalOperation(op);
const [fetched] = await client.get({
project,
image: NAME,
});
assert.strictEqual(fetched.licenseCodes[0], '5543610867827062957');
});
});

describe('Firewall', () => {
let NAME = null;

before(async () => {
client = new compute.FirewallsClient({fallback: 'rest'});
NAME = generateName('firewall');
});

after(async function () {
this.timeout(10 * 60 * 1000);
await client.delete({
project,
firewall: NAME,
});
});

it('create and fetch firewall, test capital letter field like "IPProtocol"', async function () {
this.timeout(10 * 60 * 1000);
const resource = {
name: NAME,
sourceRanges: ['0.0.0.0/0'],
allowed: [
{
IPProtocol: 'tcp',
ports: ['80'],
},
],
};
const [op] = await client.insert({
project,
firewallResource: resource,
});
await waitGlobalOperation(op);
const [fetched] = await client.get({
project,
firewall: NAME,
});
assert.strictEqual(fetched.allowed[0].IPProtocol, 'tcp');
});
});

describe('Instances', () => {
let INSTANCE_NAME = null;

Expand Down

0 comments on commit f4f53cc

Please sign in to comment.