From f7739c5b428d7d289befdaac554141ce5d90ce9f Mon Sep 17 00:00:00 2001 From: Dominik Froehlich Date: Thu, 22 Jun 2023 16:21:59 +0200 Subject: [PATCH] wip --- acceptance-tests/basic_pcap_test.go | 17 ++++++++++------- acceptance-tests/bosh_helpers.go | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/acceptance-tests/basic_pcap_test.go b/acceptance-tests/basic_pcap_test.go index 85fab565..aea67271 100644 --- a/acceptance-tests/basic_pcap_test.go +++ b/acceptance-tests/basic_pcap_test.go @@ -1,10 +1,11 @@ package acceptance_tests import ( + "fmt" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "math/rand" "os/exec" - "time" ) var _ = Describe("Pcap Deployment", func() { @@ -19,17 +20,19 @@ var _ = Describe("Pcap Deployment", func() { true, ) - err := downloadFile(info, "/var/vcap/packages/pcap-api/bin/cli/build/pcap-bosh-cli-linux-amd64", "/usr/local/bin/pcap-bosh-cli", 0755) - Expect(err).NotTo(HaveOccurred()) + rnd := rand.New(rand.NewSource(GinkgoRandomSeed())) + + boshCli := fmt.Sprintf("/usr/local/bin/pcap-bosh-cli-%d", rnd.Uint64()) - time.Sleep(2 * time.Hour) + By("Downloading remote pcap-bosh-cli-linux-amd64 to " + boshCli) + err := downloadFile(info, "/var/vcap/packages/pcap-api/bin/cli/build/pcap-bosh-cli-linux-amd64", boshCli, 0755) + Expect(err).NotTo(HaveOccurred()) - cmd := exec.Command("which", "pcap-bosh-cli") + cmd := exec.Command(boshCli, "--help") helpTest, err := cmd.Output() Expect(err).NotTo(HaveOccurred()) - GinkgoLogr.Info(string(helpTest)) - + writeLog(string(helpTest)) }) }) diff --git a/acceptance-tests/bosh_helpers.go b/acceptance-tests/bosh_helpers.go index 064206a9..ce77c2f1 100644 --- a/acceptance-tests/bosh_helpers.go +++ b/acceptance-tests/bosh_helpers.go @@ -288,5 +288,5 @@ func writeLog(s string) { } func downloadFile(info pcapAPIInfo, remotePath, localPath string, permissions os.FileMode) error { - return copyFileFromRemote(info.SSHUser, info.PublicIP, info.SSHPrivateKey, "/var/vcap/packages/pcap-api/bin/cli/build/pcap-bosh-cli-linux-amd64", "/usr/local/bin/pcap-bosh-cli", 0755) + return copyFileFromRemote(info.SSHUser, info.PublicIP, info.SSHPrivateKey, remotePath, localPath, permissions) }