github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/pkg/gce/gce_test.go (about) 1 // Copyright 2024 syzkaller project authors. All rights reserved. 2 // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 package gce 5 6 import ( 7 "testing" 8 9 "github.com/stretchr/testify/assert" 10 ) 11 12 func TestValidateZone(t *testing.T) { 13 assert.True(t, validateZone("us-west1-b")) 14 assert.True(t, validateZone("us-central1-a")) 15 assert.False(t, validateZone("us-central1")) 16 } 17 18 func TestZoneToRegion(t *testing.T) { 19 assert.Equal(t, "us-west1", zoneToRegion("us-west1-b")) 20 assert.Equal(t, "northamerica-northeast2", zoneToRegion("northamerica-northeast2-a")) 21 } 22 23 func TestDiskSizeGB(t *testing.T) { 24 assert.Equal(t, 10, diskSizeGB("c4a-standard-2")) 25 assert.Equal(t, 0, diskSizeGB("e2-standard-2")) 26 }