-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: move test utils files to the test-utils folder
Tests that are currently on the main branch only runs against a qemu VM. We have other use cases that needs to be tested like running against a vfkit VM. This commit reorganizes the tests code a bit by moving the files that can be shared to support different implementation in their own folder. The reasoning behind this is that every hypervisor should have its own beforeSuite func to download/run a specific VM image. By moving the utils files we can reuse the same code. For the same reason the code targeting qemu is moved to the test-qemu folder. By doing so, we can run the tests within the test-qemu folder on the ubuntu workflow and, in future, when the nested virt will be enabled on github runners, the vfkit tests on macOS. Signed-off-by: Luca Stocchi <[email protected]>
- Loading branch information
Showing
13 changed files
with
225 additions
and
106 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 | ||
|
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
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
Oops, something went wrong.