aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/gce/gce_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-01-23 11:12:16 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-01-23 11:46:45 +0000
commitbf3b32eb43d4b6b620b3c2b9f2f54aeadc8f17f6 (patch)
tree6f9448268d2f483a22fac65d379f3050f6dff1ee /pkg/gce/gce_test.go
parent135863f822c9f4b7c4f15126c66b713e8c11b4c2 (diff)
vm/gce: use regional serial port connections
It's now the recommended approach. Co-authored-by: Alex Tyler <alextyler@google.com> Co-authored-by: Aleksandr Nogikh <nogikh@google.com>
Diffstat (limited to 'pkg/gce/gce_test.go')
-rw-r--r--pkg/gce/gce_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/gce/gce_test.go b/pkg/gce/gce_test.go
new file mode 100644
index 000000000..39f086bdc
--- /dev/null
+++ b/pkg/gce/gce_test.go
@@ -0,0 +1,21 @@
+// Copyright 2024 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+package gce
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestValidateZone(t *testing.T) {
+ assert.True(t, validateZone("us-west1-b"))
+ assert.True(t, validateZone("us-central1-a"))
+ assert.False(t, validateZone("us-central1"))
+}
+
+func TestZoneToRegion(t *testing.T) {
+ assert.Equal(t, "us-west1", zoneToRegion("us-west1-b"))
+ assert.Equal(t, "northamerica-northeast2", zoneToRegion("northamerica-northeast2-a"))
+}