Exemple #1
0
		Expect(err).NotTo(HaveOccurred())

		procB, err = startClique(config.Config{
			TransferPort:     tPortB,
			RemoteHosts:      []string{hosts[0]},
			InitTransferSize: 1 * 1024 * 1024,
		}, "-debug")
		Expect(err).NotTo(HaveOccurred())
	})

	It("should print the clique result", func() {
		// wait to finish
		Eventually(procA.Buffer, 2.0).Should(gbytes.Say("new_state=done"))
		Eventually(procB.Buffer, 2.0).Should(gbytes.Say("new_state=done"))

		// exit to make sure all logs get pushed
		Expect(procA.Stop()).To(Succeed())
		Expect(procB.Stop()).To(Succeed())

		// grab contents
		procACont := string(procA.Buffer.Contents())
		procBCont := string(procB.Buffer.Contents())

		Expect(procACont).To(ContainSubstring("Incoming transfer is completed"))
		Expect(procACont).To(ContainSubstring("Outgoing transfer is completed"))

		Expect(procBCont).To(ContainSubstring("Incoming transfer is completed"))
		Expect(procBCont).To(ContainSubstring("Outgoing transfer is completed"))
	})
})
		})
		Expect(err).NotTo(HaveOccurred())

		srcClient = api.NewClient(
			"127.0.0.1", srcAPort, time.Millisecond*100,
		)

		destTPort = testhelpers.SelectPort(GinkgoParallelNode())
		destClique, err = startClique(config.Config{
			TransferPort: destTPort,
		})
		Expect(err).NotTo(HaveOccurred())
	})

	AfterEach(func() {
		Expect(srcClique.Stop()).To(Succeed())
		Expect(destClique.Stop()).To(Succeed())
	})

	It("should populate the RTT", func() {
		spec := api.TransferSpec{
			IP:   net.ParseIP("127.0.0.1"),
			Port: destTPort,
			Size: 10 * 1024 * 1024,
		}
		Expect(srcClient.CreateTransfer(spec)).To(Succeed())

		var resList []api.TransferResults
		Eventually(func() []api.TransferResults {
			var err error
			resList, err = srcClient.TransferResultsByIP(net.ParseIP("127.0.0.1"))