github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/container/kvm/package_test.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package kvm_test
     5  
     6  import (
     7  	"runtime"
     8  	"testing"
     9  
    10  	gc "gopkg.in/check.v1"
    11  
    12  	"github.com/juju/juju/core/arch"
    13  )
    14  
    15  func Test(t *testing.T) {
    16  	if runtime.GOOS != "linux" || !supportedArch() {
    17  		t.Skip("KVM is currently only supported on linux architectures amd64, arm64, and ppc64el")
    18  	}
    19  	gc.TestingT(t)
    20  }
    21  
    22  func supportedArch() bool {
    23  	for _, a := range []string{arch.AMD64, arch.ARM64, arch.PPC64EL} {
    24  		if runtime.GOARCH == a {
    25  			return true
    26  		}
    27  	}
    28  	return false
    29  }