Only run Swift tests when Swift is available
Only run the Swift remote tests when OpenStack seems to have been set up and when the autho host is reachable.
This commit is contained in:
parent
258b1a4263
commit
4fc6dd0141
|
@ -3,6 +3,7 @@ package remote
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSwiftClient_impl(t *testing.T) {
|
func TestSwiftClient_impl(t *testing.T) {
|
||||||
|
@ -10,8 +11,13 @@ func TestSwiftClient_impl(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSwiftClient(t *testing.T) {
|
func TestSwiftClient(t *testing.T) {
|
||||||
if _, err := http.Get("http://google.com"); err != nil {
|
os_auth_url := os.Getenv("OS_AUTH_URL")
|
||||||
t.Skipf("skipping, internet seems to not be available: %s", err)
|
if os_auth_url == "" {
|
||||||
|
t.Skipf("skipping, OS_AUTH_URL and friends must be set")
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := http.Get(os_auth_url); err != nil {
|
||||||
|
t.Skipf("skipping, unable to reach %s: %s", os_auth_url, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := swiftFactory(map[string]string{
|
client, err := swiftFactory(map[string]string{
|
||||||
|
|
Loading…
Reference in New Issue