-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from lstocchi/test-vfkit
Tests: basic implementation for testing against vfkit
- Loading branch information
Showing
16 changed files
with
454 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package e2eqemu | ||
|
||
import ( | ||
"github.com/containers/gvisor-tap-vsock/pkg/types" | ||
e2e "github.com/containers/gvisor-tap-vsock/test" | ||
"github.com/onsi/ginkgo" | ||
"github.com/onsi/gomega" | ||
) | ||
|
||
var _ = ginkgo.Describe("connectivity with qemu", func() { | ||
e2e.BasicConnectivityTests(e2e.BasicTestProps{ | ||
SSHExec: sshExec, | ||
}) | ||
}) | ||
|
||
var _ = ginkgo.Describe("dns with qemu", func() { | ||
e2e.BasicDNSTests(e2e.BasicTestProps{ | ||
SSHExec: sshExec, | ||
Sock: sock, | ||
}) | ||
}) | ||
|
||
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.Debug = true | ||
command.AddQemuSocket("tcp://0.0.0.0:1234") | ||
command.PidFile = "~/gv-pidfile.txt" | ||
command.LogFile = "~/gv.log" | ||
command.AddForwardUser("demouser") | ||
|
||
cmd := command.ToCmdline() | ||
gomega.Expect(cmd).To(gomega.Equal([]string{ | ||
"-listen", "unix:///tmp/network.sock", | ||
"-debug", | ||
"-mtu", "1500", | ||
"-ssh-port", "2222", | ||
"-listen-qemu", "tcp://0.0.0.0:1234", | ||
"-forward-user", "demouser", | ||
"-pid-file", "~/gv-pidfile.txt", | ||
"-log-file", "~/gv.log", | ||
})) | ||
}) | ||
}) |
2 changes: 1 addition & 1 deletion
2
test/efi_darwin_arm64_test.go → test-qemu/efi_darwin_arm64_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package e2e | ||
package e2eqemu | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
//go:build !(darwin && arm64) | ||
|
||
package e2e | ||
package e2eqemu | ||
|
||
func efiArgs() (string, error) { | ||
return "", nil | ||
|
2 changes: 1 addition & 1 deletion
2
test/port_forwarding_test.go → test-qemu/port_forwarding_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package e2e | ||
package e2eqemu | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package e2e | ||
package e2eutils | ||
|
||
import ( | ||
"encoding/json" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package e2eutils | ||
|
||
import ( | ||
"net" | ||
"strconv" | ||
) | ||
|
||
func IsPortAvailable(port int) bool { | ||
return IsHostPortAvailable("127.0.0.1", port) | ||
} | ||
|
||
func IsHostPortAvailable(host string, port int) bool { | ||
listener, err := net.Listen("tcp", net.JoinHostPort(host, strconv.Itoa(port))) | ||
if err != nil { | ||
return false | ||
} | ||
listener.Close() | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.