From 4ee8f932328c029a966dc2dd7a17f8c500c26cab Mon Sep 17 00:00:00 2001 From: Ed Cook Date: Thu, 12 Sep 2019 17:36:17 +0100 Subject: [PATCH] Clean up runner tests to include scheme in url --- cf/login_runner_test.go | 6 +++--- om/runner_test.go | 6 +++--- open/runner_test.go | 4 ++-- pks/login_runner_test.go | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cf/login_runner_test.go b/cf/login_runner_test.go index 8709c61..8a0f8b7 100644 --- a/cf/login_runner_test.go +++ b/cf/login_runner_test.go @@ -35,7 +35,7 @@ var _ = Describe("cf login runner", func() { BeforeEach(func() { scriptRunner = new(scriptingfakes.FakeScriptRunner) - url, _ := url.Parse("www.test-url.io") + url, _ := url.Parse("https://www.test-url.io") data = environment.Config{ CFDomain: "sys.test-url.io", OpsManager: environment.OpsManager{ @@ -60,9 +60,9 @@ var _ = Describe("cf login runner", func() { lines, _, _ := scriptRunner.RunScriptArgsForCall(0) Expect(lines).To(Equal([]string{ - `prods="$(om -t www.test-url.io -k -u username -p password curl -s -p /api/v0/staged/products)"`, + `prods="$(om -t https://www.test-url.io -k -u username -p password curl -s -p /api/v0/staged/products)"`, `guid="$(echo "$prods" | jq -r '.[] | select(.type == "cf") | .guid')"`, - `creds="$(om -t www.test-url.io -k -u username -p password curl -s -p /api/v0/deployed/products/"$guid"/credentials/.uaa.admin_credentials)"`, `user="$(echo "$creds" | jq -r .credential.value.identity)"`, + `creds="$(om -t https://www.test-url.io -k -u username -p password curl -s -p /api/v0/deployed/products/"$guid"/credentials/.uaa.admin_credentials)"`, `user="$(echo "$creds" | jq -r .credential.value.identity)"`, `pass="$(echo "$creds" | jq -r .credential.value.password)"`, `cf login -a "api.sys.test-url.io" -u "$user" -p "$pass" --skip-ssl-validation`, })) diff --git a/om/runner_test.go b/om/runner_test.go index 7f1e676..179f18d 100644 --- a/om/runner_test.go +++ b/om/runner_test.go @@ -36,7 +36,7 @@ var _ = Describe("om runner", func() { BeforeEach(func() { scriptRunner = new(scriptingfakes.FakeScriptRunner) - url, _ := url.Parse("www.test-url.io") + url, _ := url.Parse("https://www.test-url.io") data = environment.Config{ OpsManager: environment.OpsManager{ URL: *url, @@ -64,7 +64,7 @@ var _ = Describe("om runner", func() { lines, prereqs, _ := scriptRunner.RunScriptArgsForCall(0) Expect(lines).To(Equal([]string{ - `echo "export OM_TARGET=www.test-url.io"`, + `echo "export OM_TARGET=https://www.test-url.io"`, `echo "export OM_USERNAME=username"`, `echo "export OM_PASSWORD=password"`, })) @@ -86,7 +86,7 @@ var _ = Describe("om runner", func() { lines, prereqs, _ := scriptRunner.RunScriptArgsForCall(0) Expect(lines).To(Equal([]string{ - `om -t 'www.test-url.io' -k -u 'username' -p 'password' 'arg1' 'arg2' 'arg3'`, + `om -t 'https://www.test-url.io' -k -u 'username' -p 'password' 'arg1' 'arg2' 'arg3'`, })) Expect(prereqs).To(ConsistOf("om")) }) diff --git a/open/runner_test.go b/open/runner_test.go index ce14ddf..c9b1ef8 100644 --- a/open/runner_test.go +++ b/open/runner_test.go @@ -35,7 +35,7 @@ var _ = Describe("open runner", func() { BeforeEach(func() { scriptRunner = new(scriptingfakes.FakeScriptRunner) - url, _ := url.Parse("www.test-url.io") + url, _ := url.Parse("https://www.test-url.io") data = environment.Config{ OpsManager: environment.OpsManager{ URL: *url, @@ -57,7 +57,7 @@ var _ = Describe("open runner", func() { lines, _, _ := scriptRunner.RunScriptArgsForCall(0) Expect(lines).To(Equal([]string{ - `open "www.test-url.io"`, + `open "https://www.test-url.io"`, `echo "password" | pbcopy`, })) }) diff --git a/pks/login_runner_test.go b/pks/login_runner_test.go index 20c1c4a..ef6fc87 100644 --- a/pks/login_runner_test.go +++ b/pks/login_runner_test.go @@ -35,7 +35,7 @@ var _ = Describe("pks login runner", func() { BeforeEach(func() { scriptRunner = new(scriptingfakes.FakeScriptRunner) - opsmanUrl, _ := url.Parse("www.test-url.io") + opsmanUrl, _ := url.Parse("https://www.test-url.io") pksApiUrl, _ := url.Parse("api.test-url.io") data = environment.Config{ OpsManager: environment.OpsManager{ @@ -65,9 +65,9 @@ var _ = Describe("pks login runner", func() { lines, _, _ := scriptRunner.RunScriptArgsForCall(0) Expect(lines).To(Equal([]string{ - `prods="$(om -t www.test-url.io -k -u username -p password curl -s -p /api/v0/staged/products)"`, + `prods="$(om -t https://www.test-url.io -k -u username -p password curl -s -p /api/v0/staged/products)"`, `guid="$(echo "$prods" | jq -r '.[] | select(.type == "pivotal-container-service") | .guid')"`, - `creds="$(om -t www.test-url.io -k -u username -p password curl -s -p /api/v0/deployed/products/"$guid"/credentials/.properties.uaa_admin_password)"`, + `creds="$(om -t https://www.test-url.io -k -u username -p password curl -s -p /api/v0/deployed/products/"$guid"/credentials/.properties.uaa_admin_password)"`, `pass="$(echo "$creds" | jq -r .credential.value.secret)"`, `pks login -a api.test-url.io -u admin -p "$pass" --skip-ssl-validation`, }))