github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/container/kvm/libvirt/package_test.go (about)

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