From bf3b32eb43d4b6b620b3c2b9f2f54aeadc8f17f6 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 23 Jan 2024 11:12:16 +0100 Subject: vm/gce: use regional serial port connections It's now the recommended approach. Co-authored-by: Alex Tyler Co-authored-by: Aleksandr Nogikh --- pkg/gce/gce_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pkg/gce/gce_test.go (limited to 'pkg/gce/gce_test.go') 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")) +} -- cgit mrf-deployment