Skip to content

Commit

Permalink
fix: Fix to allow users to configure disk size for finch space
Browse files Browse the repository at this point in the history
Signed-off-by: Hayato Kiwata <[email protected]>
  • Loading branch information
haytok committed Dec 7, 2023
1 parent 086df29 commit 097187a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion e2e/vm/additional_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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"
)
Expand All @@ -19,7 +20,7 @@ const (
networkName = "test-network"
)

var testAdditionalDisk = func(o *option.Option) {
var testAdditionalDisk = func(o *option.Option, installed bool) {
ginkgo.Describe("Additional disk", ginkgo.Serial, func() {
ginkgo.It("Retains container user data after the VM is deleted", func() {
command.Run(o, "volume", "create", volumeName)
Expand Down Expand Up @@ -55,6 +56,15 @@ var testAdditionalDisk = func(o *option.Option) {
command.Run(o, "start", containerName)
gomega.Expect(command.StdoutStr(o, "exec", containerName, "cat", "/tmp/test.txt")).
Should(gomega.Equal("foo"))

})

ginkgo.It("finch vm init by the disk size for finch area configured in finchDiskSize of ~/.finch.yaml", func() {
resetVM(o, installed)
resetDisks(o, installed)
writeFile(finchConfigFilePath, []byte("cpus: 6\nmemory: 4GiB\nvmType: qemu\nrosetta: false\nfinchDiskSize: 3GB"))
initCmdSession := command.New(o, virtualMachineRootCmd, "init").WithTimeoutInSeconds(600).Run()
gomega.Expect(initCmdSession).Should(gexec.Exit(0))
})
})
}
2 changes: 1 addition & 1 deletion e2e/vm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestVM(t *testing.T) {

ginkgo.Describe("", func() {
testVMLifecycle(o)
testAdditionalDisk(o)
testAdditionalDisk(o, *e2e.Installed)
testConfig(o, *e2e.Installed)
testFinchConfigFile(o)
testVersion(o)
Expand Down

0 comments on commit 097187a

Please sign in to comment.