Use Ginkgo Skip() to avoid failing when tests are skipped

- Added util methods: Skipf, SkipUnlessNodeCountIsAtLeast, SkipIfProviderIs,
  and SkipUnlessProviderIs
This commit is contained in:
Karl Isenberg
2015-06-22 14:14:54 -07:00
parent 57f62976c5
commit 32a09cfcee
19 changed files with 173 additions and 216 deletions

View File

@@ -50,6 +50,12 @@ var _ = Describe("Reboot", func() {
var err error
c, err = loadClient()
Expect(err).NotTo(HaveOccurred())
// These tests requires SSH, so the provider check should be identical to there
// (the limiting factor is the implementation of util.go's getSigner(...)).
// Cluster must support node reboot
SkipUnlessProviderIs("gce", "aws")
})
It("each node by ordering clean reboot and ensure they function upon restart", func() {
@@ -90,15 +96,6 @@ var _ = Describe("Reboot", func() {
})
func testReboot(c *client.Client, rebootCmd string) {
// This test requires SSH, so the provider check should be identical to
// there (the limiting factor is the implementation of util.go's
// getSigner(...)).
provider := testContext.Provider
if !providerIs("aws", "gce") {
By(fmt.Sprintf("Skipping reboot test, which is not implemented for %s", provider))
return
}
// Get all nodes, and kick off the test on each.
nodelist, err := listNodes(c, labels.Everything(), fields.Everything())
if err != nil {
@@ -106,7 +103,7 @@ func testReboot(c *client.Client, rebootCmd string) {
}
result := make(chan bool, len(nodelist.Items))
for _, n := range nodelist.Items {
go rebootNode(c, provider, n.ObjectMeta.Name, rebootCmd, result)
go rebootNode(c, testContext.Provider, n.ObjectMeta.Name, rebootCmd, result)
}
// Wait for all to finish and check the final result.