| 1 | package e2eqemu |
| 2 | |
| 3 | import ( |
| 4 | "github.com/containers/gvisor-tap-vsock/pkg/types" |
| 5 | e2e "github.com/containers/gvisor-tap-vsock/test" |
| 6 | "github.com/onsi/ginkgo" |
| 7 | "github.com/onsi/gomega" |
| 8 | ) |
| 9 | |
| 10 | var _ = ginkgo.Describe("connectivity with qemu", func() { |
| 11 | e2e.BasicConnectivityTests(e2e.BasicTestProps{ |
| 12 | SSHExec: sshExec, |
| 13 | }) |
| 14 | }) |
| 15 | |
| 16 | var _ = ginkgo.Describe("dns with qemu", func() { |
| 17 | e2e.BasicDNSTests(e2e.BasicTestProps{ |
| 18 | SSHExec: sshExec, |
| 19 | Sock: sock, |
| 20 | }) |
| 21 | }) |
| 22 | |
| 23 | var _ = ginkgo.Describe("dhcp with qemu", func() { |
| 24 | e2e.BasicDHCPTests(e2e.BasicTestProps{ |
| 25 | SSHExec: sshExec, |
| 26 | Sock: sock, |
| 27 | }) |
| 28 | }) |
| 29 | |
| 30 | var _ = ginkgo.Describe("command-line format", func() { |
| 31 | ginkgo.It("should convert Command to command line format", func() { |
| 32 | command := types.NewGvproxyCommand() |
| 33 | command.AddEndpoint("unix:///tmp/network.sock") |
| 34 | command.AddServiceEndpoint("unix:///tmp/services.sock") |
| 35 | command.Debug = true |
| 36 | command.AddQemuSocket("tcp://0.0.0.0:1234") |
| 37 | command.PidFile = "~/gv-pidfile.txt" |
| 38 | command.LogFile = "~/gv.log" |
| 39 | command.AddForwardUser("demouser") |
| 40 | |
| 41 | cmd := command.ToCmdline() |
| 42 | gomega.Expect(cmd).To(gomega.Equal([]string{ |
| 43 | "-listen", "unix:///tmp/network.sock", |
| 44 | "-services", "unix:///tmp/services.sock", |
| 45 | "-debug", |
| 46 | "-mtu", "1500", |
| 47 | "-ssh-port", "2222", |
| 48 | "-listen-qemu", "tcp://0.0.0.0:1234", |
| 49 | "-forward-user", "demouser", |
| 50 | "-pid-file", "~/gv-pidfile.txt", |
| 51 | "-log-file", "~/gv.log", |
| 52 | })) |
| 53 | }) |
| 54 | }) |