Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
katatestutils: Use the configured virtiofs daemon path
Browse files Browse the repository at this point in the history
The current path is hardcoded as follows:
  virtio_fs_daemon = "/path/to/virtiofsd"

Switch to using the value of config.VirtioFSDaemon instead.

Fixes: #2686

Signed-off-by: Christophe de Dinechin <[email protected]>
  • Loading branch information
c3d committed Jun 5, 2020
1 parent 82ee834 commit 5a3b665
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cli/kata-env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
pcieRootPort := uint32(2)
disableNewNetNs := false
sharedFS := "virtio-9p"
virtioFSdaemon := filepath.Join(prefixDir, "virtiofsd")

filesToCreate := []string{
hypervisorPath,
Expand Down Expand Up @@ -168,6 +169,7 @@ func makeRuntimeConfig(prefixDir string) (configFile string, config oci.RuntimeC
AgentDebug: agentDebug,
AgentTrace: agentTrace,
SharedFS: sharedFS,
VirtioFSDaemon: virtioFSdaemon,
}

runtimeConfig := katatestutils.MakeRuntimeConfigFileData(configFileOptions)
Expand Down
2 changes: 2 additions & 0 deletions containerd-shim-v2/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config string, err err
pcieRootPort := uint32(2)
disableNewNetNs := false
sharedFS := "virtio-9p"
virtioFSdaemon := path.Join(dir, "virtiofsd")

configFileOptions := ktu.RuntimeConfigOptions{
Hypervisor: "qemu",
Expand All @@ -420,6 +421,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config string, err err
PCIeRootPort: pcieRootPort,
DisableNewNetNs: disableNewNetNs,
SharedFS: sharedFS,
VirtioFSDaemon: virtioFSdaemon,
}

runtimeConfigFileData := ktu.MakeRuntimeConfigFileData(configFileOptions)
Expand Down
3 changes: 2 additions & 1 deletion pkg/katatestutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type RuntimeConfigOptions struct {
AgentTraceMode string
AgentTraceType string
SharedFS string
VirtioFSDaemon string
PCIeRootPort uint32
DisableBlock bool
EnableIOThreads bool
Expand Down Expand Up @@ -65,7 +66,7 @@ func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
enable_debug = ` + strconv.FormatBool(config.HypervisorDebug) + `
guest_hook_path = "` + config.DefaultGuestHookPath + `"
shared_fs = "` + config.SharedFS + `"
virtio_fs_daemon = "/path/to/virtiofsd"
virtio_fs_daemon = "` + config.VirtioFSDaemon + `"
[proxy.kata]
enable_debug = ` + strconv.FormatBool(config.ProxyDebug) + `
Expand Down
4 changes: 3 additions & 1 deletion pkg/katautils/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
pcieRootPort := uint32(2)
disableNewNetNs := false
sharedFS := "virtio-9p"
virtioFSdaemon := path.Join(dir, "virtiofsd")

configFileOptions := ktu.RuntimeConfigOptions{
Hypervisor: "qemu",
Expand Down Expand Up @@ -117,6 +118,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
AgentDebug: agentDebug,
AgentTrace: agentTrace,
SharedFS: sharedFS,
VirtioFSDaemon: virtioFSdaemon,
}

runtimeConfigFileData := ktu.MakeRuntimeConfigFileData(configFileOptions)
Expand Down Expand Up @@ -167,7 +169,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
GuestHookPath: defaultGuestHookPath,
VhostUserStorePath: defaultVhostUserStorePath,
SharedFS: sharedFS,
VirtioFSDaemon: "/path/to/virtiofsd",
VirtioFSDaemon: virtioFSdaemon,
VirtioFSCache: defaultVirtioFSCacheMode,
}

Expand Down

0 comments on commit 5a3b665

Please sign in to comment.