Skip to content

Commit

Permalink
Remove low value test
Browse files Browse the repository at this point in the history
The test incorrectly was skipped if you had ANY alphnumeric characters in your username and password.

However, the original intent of the test, to run if you had any special characters in your username or password,
is not useful, as every other test also would cover this same behavior.

Signed-off-by: Joseph Palermo <[email protected]>
  • Loading branch information
malba authored and jpalermo committed Apr 11, 2022
1 parent 7ddc817 commit bd24f01
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions integration/construct/construct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"regexp"
"time"

"github.com/cloudfoundry/stembuild/test/helpers"
Expand Down Expand Up @@ -62,19 +61,6 @@ var _ = Describe("stembuild construct", func() {
Eventually(session.Out, constructOutputTimeout).Should(Say(`Attempting to enable WinRM on the guest vm...WinRm enabled on the guest VM`))
})

It("handles special characters", func() {
isAlphaNumeric, err := regexp.Compile("[a-zA-Z0-9]+")
Expect(err).ToNot(HaveOccurred())

if isAlphaNumeric.MatchString(conf.VCenterUsername) && isAlphaNumeric.MatchString(conf.VCenterPassword) {
Skip("vCenter username or password must contain special characters")
}
session := helpers.Stembuild(stembuildExecutable, "construct", "-vm-ip", conf.TargetIP, "-vm-username", conf.VMUsername, "-vm-password", conf.VMPassword, "-vcenter-url", conf.VCenterURL, "-vcenter-username", conf.VCenterUsername, "-vcenter-password", conf.VCenterPassword, "-vm-inventory-path", conf.VMInventoryPath, "-vcenter-ca-certs", conf.VCenterCACert)

Eventually(session, constructOutputTimeout).Should(Exit(0))
Eventually(session.Out).Should(Say(`mock stemcell automation script executed`))
})

It("successfully runs even when a user has logged in", func() {
fmt.Printf("Logged on VM for test has IP: %s\n", conf.LoggedInVMIP)

Expand Down

0 comments on commit bd24f01

Please sign in to comment.