Skip to content

Commit 0c0001c

Browse files
committed
CI: pass setmcell-os to BDRATs specs
Previously the stemcell os in the BDRATs fixture (small-deployment.yml) was mutated using `sed`. The BDRATs now[1] accept stemcell-os as configuration removing the need to mutuate the fixture. [1] cloudfoundry/bosh-disaster-recovery-acceptance-tests#236
1 parent f42f398 commit 0c0001c

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

ci/tasks/test-bdrats.sh

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ set -euo 'pipefail'
55
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
66
src_dir="${script_dir}/../../.."
77

8-
export BOSH_RELEASE_PATH="${PWD}/bosh-release/$(basename bosh-release/*.tgz)"
8+
BOSH_RELEASE_PATH="${PWD}/bosh-release/$(basename bosh-release/*.tgz)"
9+
export BOSH_RELEASE_PATH
910

1011
mkdir -p bbr-binary
1112
export BBR_BINARY_PATH="${PWD}/bbr-binary/bbr"
12-
cp bbr-cli-binary/bbr-[0-9]*-linux-amd64 $BBR_BINARY_PATH
13+
cp bbr-cli-binary/bbr-[0-9]*-linux-amd64 "${BBR_BINARY_PATH}"
1314
chmod +x "${BBR_BINARY_PATH}"
1415

1516
export OVERRIDDEN_BOSH_DEPLOYMENT="${src_dir}/bosh-deployment"
@@ -21,44 +22,33 @@ source start-bosh \
2122
-o bbr.yml \
2223
-o local-bosh-release-tarball.yml \
2324
-o hm/disable.yml \
24-
-v local_bosh_release=${BOSH_RELEASE_PATH}
25+
-v local_bosh_release="${BOSH_RELEASE_PATH}"
2526

2627
source /tmp/local-bosh/director/env
2728

2829
STEMCELL_PATH="${PWD}/stemcell/$(basename stemcell/*.tgz)"
2930
BOSH_SSH_KEY="$(bosh int /tmp/local-bosh/director/creds.yml --path /jumpbox_ssh/private_key --json | jq .Blocks[0])"
3031
BOSH_HOST="${BOSH_ENVIRONMENT}"
3132

33+
stemcell_os="$(cut -d- -f8-9 < stemcell/url )"
34+
bosh_ca_cert_json_value="$(awk '{printf "%s\\n", $0}' "${BOSH_CA_CERT}")"
35+
3236
cat > integration-config.json <<EOF
3337
{
3438
"bosh_host": "${BOSH_HOST}",
3539
"bosh_ssh_username": "jumpbox",
3640
"bosh_ssh_private_key": ${BOSH_SSH_KEY},
3741
"bosh_client": "${BOSH_CLIENT}",
3842
"bosh_client_secret": "${BOSH_CLIENT_SECRET}",
39-
"bosh_ca_cert": "$(awk '{printf "%s\\n", $0}' ${BOSH_CA_CERT})",
43+
"bosh_ca_cert": "${bosh_ca_cert_json_value}",
4044
"timeout_in_minutes": 30,
4145
"stemcell_src": "${STEMCELL_PATH}",
46+
"stemcell_os": "${stemcell_os}",
4247
"include_deployment_testcase": true,
4348
"include_truncate_db_blobstore_testcase": true
4449
}
4550
EOF
4651

47-
set -x # debugging info
48-
export INTEGRATION_CONFIG_PATH=${PWD}/integration-config.json
49-
export GOPATH="${PWD}/gopath"
50-
export PATH="${PATH}:${GOPATH}/bin"
51-
52-
# Note: this must happen in the context of a `go.mod` file, otherwise `@{VERSION}` must be used
53-
# => https://go.dev/doc/go-get-install-deprecation
54-
export GINKGO_VERSION="v1.16.5"
55-
go install "github.com/onsi/ginkgo/ginkgo@${GINKGO_VERSION}"
56-
57-
58-
# Hotfix until PR is merged: https://github.com/cloudfoundry/bosh-disaster-recovery-acceptance-tests/pull/41
59-
sed -i "s/^ os:.*/ os: $(cat stemcell/url | cut -d- -f8-9)/g" $(find -name small-deployment.yml)
52+
export INTEGRATION_CONFIG_PATH="${PWD}/integration-config.json"
6053

61-
export GINKGO_TIMEOUT="24h0m0s"
62-
pushd gopath/src/github.com/cloudfoundry-incubator/bosh-disaster-recovery-acceptance-tests
63-
./scripts/_run_acceptance_tests.sh
64-
popd
54+
./bosh-disaster-recovery-acceptance-tests/scripts/_run_acceptance_tests.sh

ci/tasks/test-bdrats.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ inputs:
66
- name: stemcell
77
- name: bosh-release
88
- name: bosh-disaster-recovery-acceptance-tests
9-
path: gopath/src/github.com/cloudfoundry-incubator/bosh-disaster-recovery-acceptance-tests
109
- name: bbr-cli-binary
1110
- name: bosh-deployment
1211
optional: true

0 commit comments

Comments
 (0)