gvproxy: command: Add AddServiceEndpoint

This adds GvproxyCommand.AddServiceEndpoint() for the newly added
--services argument. This API is a helper for users of gvproxy to have a
more convenient way to generate its command line.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Christophe Fergeau
2024-12-02 15:24:04 +01:00
parent f0f18025e5
commit bc938b8551
2 changed files with 27 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ var _ = ginkgo.Describe("command-line format", func() {
ginkgo.It("should convert Command to command line format", func() {
command := types.NewGvproxyCommand()
command.AddEndpoint("unix:///tmp/network.sock")
command.AddServiceEndpoint("unix:///tmp/services.sock")
command.Debug = true
command.AddQemuSocket("tcp://0.0.0.0:1234")
command.PidFile = "~/gv-pidfile.txt"
@@ -33,6 +34,7 @@ var _ = ginkgo.Describe("command-line format", func() {
cmd := command.ToCmdline()
gomega.Expect(cmd).To(gomega.Equal([]string{
"-listen", "unix:///tmp/network.sock",
"-services", "unix:///tmp/services.sock",
"-debug",
"-mtu", "1500",
"-ssh-port", "2222",