Adds conditional SkipCheck for storage driver tests

This commit is contained in:
Brian Bland 2014-10-27 13:24:07 -07:00
parent bac40b2b35
commit ff81f3a719
4 changed files with 30 additions and 9 deletions

View file

@ -24,6 +24,13 @@ func init() {
return NewDriver(accessKey, secretKey, aws.GetRegion(region), true, bucket)
}
testsuites.RegisterInProcessSuite(s3DriverConstructor)
testsuites.RegisterIPCSuite("s3", map[string]string{"accessKey": accessKey, "secretKey": secretKey, "region": region, "bucket": bucket, "encrypt": encrypt})
skipCheck := func() string {
if accessKey == "" || secretKey == "" || region == "" || bucket == "" || encrypt == "" {
return "Must set ACCESS_KEY, SECRET_KEY, AWS_REGION, S3_BUCKET, and S3_ENCRYPT to run S3 tests"
}
return ""
}
testsuites.RegisterInProcessSuite(s3DriverConstructor, skipCheck)
testsuites.RegisterIPCSuite("s3", map[string]string{"accessKey": accessKey, "secretKey": secretKey, "region": region, "bucket": bucket, "encrypt": encrypt}, skipCheck)
}