Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/gophercloud/gophercloud i…
…nto zun-exp Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
- Loading branch information
Showing
321 changed files
with
22,278 additions
and
1,915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package clients | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
// RequireAdmin will restrict a test to only be run by admin users. | ||
func RequireAdmin(t *testing.T) { | ||
if os.Getenv("OS_USERNAME") != "admin" { | ||
t.Skip("must be admin to run this test") | ||
} | ||
} | ||
|
||
// RequireDNS will restrict a test to only be run in environments | ||
// that support DNSaaS. | ||
func RequireDNS(t *testing.T) { | ||
if os.Getenv("OS_DNS_ENVIRONMENT") == "" { | ||
t.Skip("this test requires DNSaaS") | ||
} | ||
} | ||
|
||
// RequireGuestAgent will restrict a test to only be run in | ||
// environments that support the QEMU guest agent. | ||
func RequireGuestAgent(t *testing.T) { | ||
if os.Getenv("OS_GUEST_AGENT") == "" { | ||
t.Skip("this test requires support for qemu guest agent and to set OS_GUEST_AGENT to 1") | ||
} | ||
} | ||
|
||
// RequireIdentityV2 will restrict a test to only be run in | ||
// environments that support the Identity V2 API. | ||
func RequireIdentityV2(t *testing.T) { | ||
if os.Getenv("OS_IDENTITY_API_VERSION") != "2.0" { | ||
t.Skip("this test requires support for the identity v2 API") | ||
} | ||
} | ||
|
||
// RequireLiveMigration will restrict a test to only be run in | ||
// environments that support live migration. | ||
func RequireLiveMigration(t *testing.T) { | ||
if os.Getenv("OS_LIVE_MIGRATE") == "" { | ||
t.Skip("this test requires support for live migration and to set OS_LIVE_MIGRATE to 1") | ||
} | ||
} | ||
|
||
// RequireLong will ensure long-running tests can run. | ||
func RequireLong(t *testing.T) { | ||
if testing.Short() { | ||
t.Skip("skipping test in short mode") | ||
} | ||
} | ||
|
||
// RequireNovaNetwork will restrict a test to only be run in | ||
// environments that support nova-network. | ||
func RequireNovaNetwork(t *testing.T) { | ||
if os.Getenv("OS_NOVANET") == "" { | ||
t.Skip("this test requires nova-network and to set OS_NOVANET to 1") | ||
} | ||
} |
Oops, something went wrong.