github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/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  	"github.com/juju/utils/arch"
    11  	gc "gopkg.in/check.v1"
    12  )
    13  
    14  func Test(t *testing.T) {
    15  	if runtime.GOOS != "linux" || !supportedArch() {
    16  		t.Skip("KVM is currently only supported on linux architectures amd64, arm64, and ppc64el")
    17  	}
    18  	gc.TestingT(t)
    19  }
    20  
    21  func supportedArch() bool {
    22  	for _, a := range []string{arch.AMD64, arch.ARM64, arch.PPC64EL} {
    23  		if runtime.GOARCH == a {
    24  			return true
    25  		}
    26  	}
    27  	return false
    28  }