Skip to content

Commit

Permalink
removing redundant .Expect
Browse files Browse the repository at this point in the history
Signed-off-by: Channing Gaddy <[email protected]>
  • Loading branch information
CodeChanning committed Aug 10, 2023
1 parent f2d03ad commit 8074323
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions e2e/vm/soci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import (

"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
"github.com/runfinch/common-tests/command"
"github.com/runfinch/common-tests/option"
)

const (
FfmpegSociImage = "public.ecr.aws/soci-workshop-examples/ffmpeg:latest"
ffmpegSociImage = "public.ecr.aws/soci-workshop-examples/ffmpeg:latest"
sociMountString = "fuse.rawBridge"
)

Expand All @@ -41,15 +40,14 @@ var testSoci = func(o *option.Option, installed bool) {
resetDisks(o, installed)
writeFile(finchConfigFilePath, []byte("cpus: 6\nmemory: 4GiB\nsnapshotter: soci\n"+
"vmType: qemu\nrosetta: false"))
initCmdSession := command.New(o, virtualMachineRootCmd, "init").WithTimeoutInSeconds(600).Run()
gomega.Expect(initCmdSession).Should(gexec.Exit(0))
command.New(o, "pull", FfmpegSociImage).WithTimeoutInSeconds(30).Run()
command.New(o, virtualMachineRootCmd, "init").WithTimeoutInSeconds(600).Run()
command.New(o, "pull", ffmpegSociImage).WithTimeoutInSeconds(30).Run()
finchPullMounts := countMounts(limactlO)
command.Run(o, "rmi", "-f", FfmpegSociImage)
command.Run(o, "rmi", "-f", ffmpegSociImage)
command.New(limactlO, "shell", "finch",
"sudo", "nerdctl", "--snapshotter=soci", "pull", FfmpegSociImage).WithTimeoutInSeconds(30).Run()
"sudo", "nerdctl", "--snapshotter=soci", "pull", ffmpegSociImage).WithTimeoutInSeconds(30).Run()
nerdctlPullMounts := countMounts(limactlO)
command.Run(o, "rmi", "-f", FfmpegSociImage)
command.Run(o, "rmi", "-f", ffmpegSociImage)
gomega.Expect(finchPullMounts).Should(gomega.Equal(nerdctlPullMounts))
})

Expand All @@ -58,15 +56,14 @@ var testSoci = func(o *option.Option, installed bool) {
resetDisks(o, installed)
writeFile(finchConfigFilePath, []byte("cpus: 6\nmemory: 4GiB\nsnapshotter: soci\n"+
"vmType: qemu\nrosetta: false"))
initCmdSession := command.New(o, virtualMachineRootCmd, "init").WithTimeoutInSeconds(600).Run()
gomega.Expect(initCmdSession).Should(gexec.Exit(0))
command.New(o, "run", FfmpegSociImage).WithTimeoutInSeconds(30).Run()
command.New(o, virtualMachineRootCmd, "init").WithTimeoutInSeconds(600).Run()
command.New(o, "run", ffmpegSociImage).WithTimeoutInSeconds(30).Run()
finchPullMounts := countMounts(limactlO)
command.Run(o, "rmi", "-f", FfmpegSociImage)
command.Run(o, "rmi", "-f", ffmpegSociImage)
command.New(limactlO, "shell", "finch",
"sudo", "nerdctl", "--snapshotter=soci", "run", FfmpegSociImage).WithTimeoutInSeconds(30).Run()
"sudo", "nerdctl", "--snapshotter=soci", "run", ffmpegSociImage).WithTimeoutInSeconds(30).Run()
nerdctlPullMounts := countMounts(limactlO)
command.Run(o, "rmi", "-f", FfmpegSociImage)
command.Run(o, "rmi", "-f", ffmpegSociImage)
gomega.Expect(finchPullMounts).Should(gomega.Equal(nerdctlPullMounts))
})
})
Expand Down

0 comments on commit 8074323

Please sign in to comment.