Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
set -euxo pipefail

STEMCELL_OS="${STEMCELL_OS:-ubuntu-xenial}"
STEMCELL_VERSION="${STEMCELL_VERSION:-latest}"

STEMCELL_URL="https://bosh.io/d/stemcells/bosh-google-kvm-${STEMCELL_OS}-go_agent"
if [[ "${STEMCELL_VERSION}" != "latest" ]]; then
STEMCELL_URL="${STEMCELL_URL}?v=${STEMCELL_VERSION}"
fi

pushd "$(dirname "$0")/.."
bosh create-release --force --version="$(date "+%s")"
bosh upload-release
popd

bosh upload-stemcell "https://bosh.io/d/stemcells/bosh-google-kvm-${STEMCELL_OS}-go_agent"
bosh upload-stemcell "${STEMCELL_URL}"

pushd "$(dirname "$0")/../tests"
go install github.com/onsi/ginkgo/v2/ginkgo
Expand Down
3 changes: 2 additions & 1 deletion tests/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ var _ = Describe("Forwarding loglines to a TCP syslog drain", func() {

session := BoshCmd("deploy", "manifests/broken-rules.yml",
"-v", fmt.Sprintf("deployment=%s", DeploymentName()),
"-v", fmt.Sprintf("stemcell-os=%s", StemcellOS()))
"-v", fmt.Sprintf("stemcell-os=%s", StemcellOS()),
"-v", fmt.Sprintf("stemcell-version=%s", StemcellVersion()))
Eventually(session, 10*time.Minute).Should(gexec.Exit(1))
Eventually(BoshCmd("locks")).ShouldNot(gbytes.Say(DeploymentName()))
})
Expand Down
13 changes: 11 additions & 2 deletions tests/boshhelpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ func StemcellOS() string {
return "ubuntu-bionic"
}

func StemcellVersion() string {
if v, ok := os.LookupEnv("STEMCELL_VERSION"); ok {
return v
}
return "latest"
}

func BoshCmd(args ...string) *gexec.Session {
boshArgs := []string{"-n", "-d", DeploymentName()}
boshArgs = append(boshArgs, args...)
Expand Down Expand Up @@ -64,7 +71,8 @@ func Deploy(manifest string) *gexec.Session {
By("Deploying")
session := BoshCmd("deploy", manifest,
"-v", fmt.Sprintf("deployment=%s", DeploymentName()),
"-v", fmt.Sprintf("stemcell-os=%s", StemcellOS()))
"-v", fmt.Sprintf("stemcell-os=%s", StemcellOS()),
"-v", fmt.Sprintf("stemcell-version=%s", StemcellVersion()))
Eventually(session, 40*time.Minute).Should(gexec.Exit(0))
Eventually(BoshCmd("locks")).ShouldNot(gbytes.Say(DeploymentName()))
return session
Expand All @@ -73,7 +81,8 @@ func Deploy(manifest string) *gexec.Session {
func DeployWithVarsStore(manifest string) *gexec.Session {
session := BoshCmd("deploy", manifest,
"-v", fmt.Sprintf("deployment=%s", DeploymentName()), fmt.Sprintf("--vars-store=/tmp/%s-vars.yml", DeploymentName()),
"-v", fmt.Sprintf("stemcell-os=%s", StemcellOS()))
"-v", fmt.Sprintf("stemcell-os=%s", StemcellOS()),
"-v", fmt.Sprintf("stemcell-version=%s", StemcellVersion()))
Eventually(session, 40*time.Minute).Should(gexec.Exit(0))
Eventually(BoshCmd("locks")).ShouldNot(gbytes.Say(DeploymentName()))
return session
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/blackbox-unpriv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/broken-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/debug-filtering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/disabled-no-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/environment-identifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/good-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/relp-tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/tcp-blackbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/tls-forwarding-mtls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/tls-forwarding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/udp-blackbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/manifests/vcap-filtering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ releases:
stemcells:
- alias: default
os: ((stemcell-os))
version: latest
version: ((stemcell-version))
instance_groups:
- name: forwarder
instances: 1
Expand Down