Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
domdom82 committed Jun 22, 2023
1 parent 1024867 commit f7739c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions acceptance-tests/basic_pcap_test.go
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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))
})
})
2 changes: 1 addition & 1 deletion acceptance-tests/bosh_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit f7739c5

Please sign in to comment.