Skip to content

Commit 2790431

Browse files
Fixed failed test, changed debian version to 11 (GoogleCloudPlatform#9423)
1 parent 7c5bf8d commit 2790431

File tree

14 files changed

+15
-32
lines changed

14 files changed

+15
-32
lines changed

compute/cloud-client/src/main/java/compute/CreateInstanceFromTemplateWithOverrides.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void main(String[] args)
4949
* https://cloud.google.com/sdk/gcloud/reference/compute/machine-types/list
5050
* newDiskSourceImage - Path the the disk image you want to use for your new
5151
* disk. This can be one of the public images
52-
* (like "projects/debian-cloud/global/images/family/debian-10")
52+
* (like "projects/debian-cloud/global/images/family/debian-11")
5353
* or a private image you have access to.
5454
* You can check the list of available public images using the doc:
5555
* http://cloud.google.com/compute/docs/images
@@ -72,7 +72,7 @@ public static void createInstanceFromTemplateWithOverrides(String projectId, Str
7272
InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.create()) {
7373

7474
String machineType = "n1-standard-1";
75-
String newDiskSourceImage = "projects/debian-cloud/global/images/family/debian-10";
75+
String newDiskSourceImage = "projects/debian-cloud/global/images/family/debian-11";
7676

7777
// Retrieve an instance template.
7878
InstanceTemplate instanceTemplate = instanceTemplatesClient

compute/cloud-client/src/main/java/compute/CreateInstanceTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static void createInstanceTemplateWithDiskType(String projectId, String t
110110
.setInitializeParams(AttachedDiskInitializeParams.newBuilder()
111111
.setDiskSizeGb(10)
112112
.setDiskType("pd-balanced")
113-
.setSourceImage("projects/debian-cloud/global/images/family/debian-10").build())
113+
.setSourceImage("projects/debian-cloud/global/images/family/debian-11").build())
114114
.setAutoDelete(true)
115115
.setBoot(true)
116116
.setType(AttachedDisk.Type.PERSISTENT.toString()).build();

compute/cloud-client/src/main/java/compute/CreateInstancesAdvanced.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private static Instance createWithDisks(String project, String zone, String inst
254254
// [START compute_instances_create_from_image]
255255

256256
/**
257-
* Create a new VM instance with Debian 10 operating system.
257+
* Create a new VM instance with Debian 11 operating system.
258258
*
259259
* @param project project ID or project number of the Cloud project you want to use.
260260
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
@@ -265,7 +265,7 @@ public static Instance createFromPublicImage(String project, String zone, String
265265
throws IOException, InterruptedException, ExecutionException, TimeoutException {
266266
try (ImagesClient imagesClient = ImagesClient.create()) {
267267
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
268-
Image image = imagesClient.getFromFamily("debian-cloud", "debian-10");
268+
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
269269
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
270270
Vector<AttachedDisk> disks = new Vector<>();
271271
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));
@@ -301,7 +301,7 @@ public static Instance createFromCustomImage(String project, String zone, String
301301
// [START compute_instances_create_from_image_plus_empty_disk]
302302

303303
/**
304-
* Create a new VM instance with Debian 10 operating system and a 11 GB additional empty disk.
304+
* Create a new VM instance with Debian 11 operating system and a 11 GB additional empty disk.
305305
*
306306
* @param project project ID or project number of the Cloud project you want to use.
307307
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
@@ -312,7 +312,7 @@ public static Instance createWithAdditionalDisk(String project, String zone, Str
312312
throws IOException, InterruptedException, ExecutionException, TimeoutException {
313313
try (ImagesClient imagesClient = ImagesClient.create()) {
314314
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
315-
Image image = imagesClient.getFromFamily("debian-cloud", "debian-10");
315+
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
316316
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
317317
Vector<AttachedDisk> disks = new Vector<>();
318318
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));
@@ -349,7 +349,7 @@ public static Instance createFromSnapshot(String project, String zone, String in
349349
// [START compute_instances_create_from_image_plus_snapshot_disk]
350350

351351
/**
352-
* Create a new VM instance with Debian 10 operating system and data disk created from snapshot.
352+
* Create a new VM instance with Debian 11 operating system and data disk created from snapshot.
353353
*
354354
* @param project project ID or project number of the Cloud project you want to use.
355355
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
@@ -363,7 +363,7 @@ public static Instance createWithSnapshottedDataDisk(String project, String zone
363363
throws IOException, InterruptedException, ExecutionException, TimeoutException {
364364
try (ImagesClient imagesClient = ImagesClient.create()) {
365365
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
366-
Image image = imagesClient.getFromFamily("debian-cloud", "debian-10");
366+
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
367367
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
368368
Vector<AttachedDisk> disks = new Vector<>();
369369
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));
@@ -377,7 +377,7 @@ public static Instance createWithSnapshottedDataDisk(String project, String zone
377377
// [START compute_instances_create_from_image]
378378

379379
/**
380-
* Create a new VM instance with Debian 10 operating system in specified network and subnetwork.
380+
* Create a new VM instance with Debian 11 operating system in specified network and subnetwork.
381381
*
382382
* @param project project ID or project number of the Cloud project you want to use.
383383
* @param zone name of the zone to create the instance in. For example: "us-west3-b"
@@ -394,7 +394,7 @@ public static Instance createWithSubnetwork(String project, String zone, String
394394
throws IOException, InterruptedException, ExecutionException, TimeoutException {
395395
try (ImagesClient imagesClient = ImagesClient.create()) {
396396
// List of public operating system (OS) images: https://cloud.google.com/compute/docs/images/os-details
397-
Image image = imagesClient.getFromFamily("debian-cloud", "debian-10");
397+
Image image = imagesClient.getFromFamily("debian-cloud", "debian-11");
398398
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
399399
Vector<AttachedDisk> disks = new Vector<>();
400400
disks.add(diskFromImage(diskType, 10, true, image.getSelfLink()));

compute/cloud-client/src/main/java/compute/CreateWithLocalSsd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static void main(String[] args)
4848
createWithLocalSsd(projectId, zone, instanceName);
4949
}
5050

51-
// Create a new VM instance with Debian 10 operating system and SSD local disk.
51+
// Create a new VM instance with Debian 11 operating system and SSD local disk.
5252
public static void createWithLocalSsd(String projectId, String zone, String instanceName)
5353
throws IOException, ExecutionException, InterruptedException, TimeoutException {
5454

@@ -57,7 +57,7 @@ public static void createWithLocalSsd(String projectId, String zone, String inst
5757
boolean autoDelete = true;
5858
String diskType = String.format("zones/%s/diskTypes/pd-standard", zone);
5959
// Get the latest debian image.
60-
Image newestDebian = getImageFromFamily("debian-cloud", "debian-10");
60+
Image newestDebian = getImageFromFamily("debian-cloud", "debian-11");
6161
List<AttachedDisk> disks = new ArrayList<>();
6262

6363
// Create the disks to be included in the instance.

compute/cloud-client/src/test/java/compute/InstanceOperationsIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@
4040
import org.junit.jupiter.api.AfterEach;
4141
import org.junit.jupiter.api.BeforeAll;
4242
import org.junit.jupiter.api.BeforeEach;
43-
import org.junit.jupiter.api.Disabled;
4443
import org.junit.jupiter.api.Test;
4544
import org.junit.jupiter.api.Timeout;
4645
import org.junit.runner.RunWith;
4746
import org.junit.runners.JUnit4;
4847

49-
@Disabled("TODO: fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/9373")
5048
@RunWith(JUnit4.class)
5149
@Timeout(value = 10, unit = TimeUnit.MINUTES)
5250
public class InstanceOperationsIT {

compute/cloud-client/src/test/java/compute/InstanceTemplatesIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@
3737
import org.junit.jupiter.api.AfterEach;
3838
import org.junit.jupiter.api.BeforeAll;
3939
import org.junit.jupiter.api.BeforeEach;
40-
import org.junit.jupiter.api.Disabled;
4140
import org.junit.jupiter.api.Test;
4241
import org.junit.jupiter.api.Timeout;
4342
import org.junit.runner.RunWith;
4443
import org.junit.runners.JUnit4;
4544

46-
@Disabled("TODO: fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/9373")
4745
@RunWith(JUnit4.class)
4846
@Timeout(value = 10, unit = TimeUnit.MINUTES)
4947
public class InstanceTemplatesIT {

compute/cloud-client/src/test/java/compute/SnippetsIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@
4545
import org.junit.jupiter.api.AfterEach;
4646
import org.junit.jupiter.api.BeforeAll;
4747
import org.junit.jupiter.api.BeforeEach;
48-
import org.junit.jupiter.api.Disabled;
4948
import org.junit.jupiter.api.Test;
5049
import org.junit.jupiter.api.Timeout;
5150
import org.junit.runner.RunWith;
5251
import org.junit.runners.JUnit4;
5352

54-
@Disabled("TODO: fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/9373")
5553
@RunWith(JUnit4.class)
5654
@Timeout(value = 10, unit = TimeUnit.MINUTES)
5755
public class SnippetsIT {

compute/cloud-client/src/test/java/compute/customhostname/CustomHostnameInstanceIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@
3232
import org.junit.jupiter.api.AfterEach;
3333
import org.junit.jupiter.api.BeforeAll;
3434
import org.junit.jupiter.api.BeforeEach;
35-
import org.junit.jupiter.api.Disabled;
3635
import org.junit.jupiter.api.Test;
3736
import org.junit.jupiter.api.Timeout;
3837
import org.junit.runner.RunWith;
3938
import org.junit.runners.JUnit4;
4039

41-
@Disabled("TODO: fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/9373")
4240
@RunWith(JUnit4.class)
4341
@Timeout(value = 10, unit = TimeUnit.MINUTES)
4442
public class CustomHostnameInstanceIT {

compute/cloud-client/src/test/java/compute/custommachinetype/CustomMachineTypeIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@
3737
import org.junit.jupiter.api.Assertions;
3838
import org.junit.jupiter.api.BeforeAll;
3939
import org.junit.jupiter.api.BeforeEach;
40-
import org.junit.jupiter.api.Disabled;
4140
import org.junit.jupiter.api.Test;
4241
import org.junit.jupiter.api.Timeout;
4342
import org.junit.runner.RunWith;
4443
import org.junit.runners.JUnit4;
4544

46-
@Disabled("TODO: fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/9373")
4745
@RunWith(JUnit4.class)
4846
@Timeout(value = 10, unit = TimeUnit.MINUTES)
4947
public class CustomMachineTypeIT {

compute/cloud-client/src/test/java/compute/deleteprotection/DeleteProtectionIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@
3434
import org.junit.jupiter.api.AfterEach;
3535
import org.junit.jupiter.api.BeforeAll;
3636
import org.junit.jupiter.api.BeforeEach;
37-
import org.junit.jupiter.api.Disabled;
3837
import org.junit.jupiter.api.Test;
3938
import org.junit.jupiter.api.Timeout;
4039
import org.junit.runner.RunWith;
4140
import org.junit.runners.JUnit4;
4241

43-
@Disabled("TODO: fix https://github.com/GoogleCloudPlatform/java-docs-samples/issues/9373")
4442
@RunWith(JUnit4.class)
4543
@Timeout(value = 10, unit = TimeUnit.MINUTES)
4644
public class DeleteProtectionIT {

0 commit comments

Comments
 (0)