|
1 | | -/* |
2 | | - * Copyright 2024 Google LLC |
3 | | - * |
4 | | - * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | - * you may not use this file except in compliance with the License. |
6 | | - * You may obtain a copy of the License at |
7 | | - * |
8 | | - * https://www.apache.org/licenses/LICENSE-2.0 |
9 | | - * |
10 | | - * Unless required by applicable law or agreed to in writing, software |
11 | | - * distributed under the License is distributed on an "AS IS" BASIS, |
12 | | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | - * See the License for the specific language governing permissions and |
14 | | - * limitations under the License. |
15 | | - */ |
| 1 | +// /* |
| 2 | +// * Copyright 2024 Google LLC |
| 3 | +// * |
| 4 | +// * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// * you may not use this file except in compliance with the License. |
| 6 | +// * You may obtain a copy of the License at |
| 7 | +// * |
| 8 | +// * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +// * |
| 10 | +// * Unless required by applicable law or agreed to in writing, software |
| 11 | +// * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +// * See the License for the specific language governing permissions and |
| 14 | +// * limitations under the License. |
| 15 | +// */ |
16 | 16 |
|
17 | | -'use strict'; |
| 17 | +// 'use strict'; |
18 | 18 |
|
19 | | -const path = require('path'); |
20 | | -const assert = require('node:assert/strict'); |
21 | | -const {after, before, describe, it} = require('mocha'); |
22 | | -const cp = require('child_process'); |
| 19 | +// const path = require('path'); |
| 20 | +// const assert = require('node:assert/strict'); |
| 21 | +// const {after, before, describe, it} = require('mocha'); |
| 22 | +// const cp = require('child_process'); |
| 23 | +// const { |
| 24 | +// getStaleDisks, |
| 25 | +// deleteDisk, |
| 26 | +// getStaleStoragePools, |
| 27 | +// deleteStoragePool, |
| 28 | +// } = require('./util'); |
23 | 29 |
|
24 | | -const { |
25 | | - getStaleDisks, |
26 | | - deleteDisk, |
27 | | - getStaleStoragePools, |
28 | | - deleteStoragePool, |
29 | | -} = require('./util'); |
| 30 | +// const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); |
| 31 | +// const cwd = path.join(__dirname, '..'); |
30 | 32 |
|
31 | | -const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); |
32 | | -const cwd = path.join(__dirname, '..'); |
| 33 | +// describe('Create compute hyperdisk from pool', async () => { |
| 34 | +// const diskPrefix = 'disk-from-pool-name-745d98'; |
| 35 | +// const poolPrefix = 'storage-pool-name-745d9'; |
| 36 | +// const diskName = `${diskPrefix}${Math.floor(Math.random() * 1000 + 1)}f`; |
| 37 | +// const storagePoolName = `${poolPrefix}${Math.floor(Math.random() * 1000 + 1)}5f`; |
| 38 | +// const zone = 'us-central1-a'; |
33 | 39 |
|
34 | | -describe('Create compute hyperdisk from pool', async () => { |
35 | | - const diskPrefix = 'disk-from-pool-name-745d98'; |
36 | | - const poolPrefix = 'storage-pool-name-745d9'; |
37 | | - const diskName = `${diskPrefix}${Math.floor(Math.random() * 1000 + 1)}f`; |
38 | | - const storagePoolName = `${poolPrefix}${Math.floor(Math.random() * 1000 + 1)}5f`; |
| 40 | +// before(async () => { |
| 41 | +// // Cleanup resources |
| 42 | +// const disks = await getStaleDisks(diskPrefix); |
| 43 | +// await Promise.all(disks.map(disk => deleteDisk(disk.zone, disk.diskName))); |
| 44 | +// const storagePools = await getStaleStoragePools(poolPrefix); |
| 45 | +// await Promise.all( |
| 46 | +// storagePools.map(pool => deleteStoragePool(pool.zone, pool.diskName)) |
| 47 | +// ); |
| 48 | +// }); |
39 | 49 |
|
40 | | - before(async () => { |
41 | | - // Cleanup resources |
42 | | - const disks = await getStaleDisks(diskPrefix); |
43 | | - await Promise.all(disks.map(disk => deleteDisk(disk.zone, disk.diskName))); |
44 | | - const storagePools = await getStaleStoragePools(poolPrefix); |
45 | | - await Promise.all( |
46 | | - storagePools.map(pool => deleteStoragePool(pool.zone, pool.diskName)) |
47 | | - ); |
48 | | - }); |
| 50 | +// after(async () => { |
| 51 | +// // Cleanup resources |
| 52 | +// await deleteDisk(zone, diskName); |
| 53 | +// await deleteStoragePool(zone, storagePoolName); |
| 54 | +// }); |
49 | 55 |
|
50 | | - after(async () => { |
51 | | - // Cleanup resources |
52 | | - const disks = await getStaleDisks(diskPrefix); |
53 | | - await Promise.all(disks.map(disk => deleteDisk(disk.zone, disk.diskName))); |
54 | | - const storagePools = await getStaleStoragePools(poolPrefix); |
55 | | - await Promise.all( |
56 | | - storagePools.map(pool => |
57 | | - deleteStoragePool(pool.zone, pool.storagePoolName) |
58 | | - ) |
59 | | - ); |
60 | | - }); |
| 56 | +// it('should create a new storage pool', async () => { |
| 57 | +// const response = execSync( |
| 58 | +// `node ./disks/createComputeHyperdiskPool.js ${storagePoolName} ${zone}`, |
| 59 | +// { |
| 60 | +// cwd, |
| 61 | +// } |
| 62 | +// ); |
61 | 63 |
|
62 | | - it('should create a new storage pool', () => { |
63 | | - const response = execSync( |
64 | | - `node ./disks/createComputeHyperdiskPool.js ${storagePoolName}`, |
65 | | - { |
66 | | - cwd, |
67 | | - } |
68 | | - ); |
| 64 | +// assert(response.includes(`Storage pool: ${storagePoolName} created.`)); |
| 65 | +// }); |
69 | 66 |
|
70 | | - assert(response.includes(`Storage pool: ${storagePoolName} created.`)); |
71 | | - }); |
| 67 | +// it('should create a new hyperdisk from pool', async () => { |
| 68 | +// const response = execSync( |
| 69 | +// `node ./disks/createComputeHyperdiskFromPool.js ${diskName} ${storagePoolName} ${zone}`, |
| 70 | +// { |
| 71 | +// cwd, |
| 72 | +// } |
| 73 | +// ); |
72 | 74 |
|
73 | | - it('should create a new hyperdisk from pool', () => { |
74 | | - const response = execSync( |
75 | | - `node ./disks/createComputeHyperdiskFromPool.js ${diskName} ${storagePoolName}`, |
76 | | - { |
77 | | - cwd, |
78 | | - } |
79 | | - ); |
80 | | - |
81 | | - assert(response.includes(`Disk: ${diskName} created.`)); |
82 | | - }); |
83 | | -}); |
| 75 | +// assert(response.includes(`Disk: ${diskName} created.`)); |
| 76 | +// }); |
| 77 | +// }); |
0 commit comments