From d2db2ecc1cc8adcd9c57badebcb05689a7070d97 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 7 Jun 2022 12:30:24 +0200 Subject: [PATCH] adding config mount for vmx --- nodes/vr_vmx/vr-vmx.go | 3 +++ nodes/vr_vqfx/vr-vqfx.go | 1 + 2 files changed, 4 insertions(+) diff --git a/nodes/vr_vmx/vr-vmx.go b/nodes/vr_vmx/vr-vmx.go index 8d8adf9a3..02be2b59f 100644 --- a/nodes/vr_vmx/vr-vmx.go +++ b/nodes/vr_vmx/vr-vmx.go @@ -62,6 +62,9 @@ func (s *vrVMX) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error { } s.cfg.Env = utils.MergeStringMaps(defEnv, s.cfg.Env) + // mount config dir to support startup-config functionality + s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(path.Join(s.cfg.LabDir, configDirName), ":/config")) + s.cfg.Cmd = fmt.Sprintf("--username %s --password %s --hostname %s --connection-mode %s --trace", s.cfg.Env["USERNAME"], s.cfg.Env["PASSWORD"], s.cfg.ShortName, s.cfg.Env["CONNECTION_MODE"]) diff --git a/nodes/vr_vqfx/vr-vqfx.go b/nodes/vr_vqfx/vr-vqfx.go index 55df01e4e..b9ad92ad1 100644 --- a/nodes/vr_vqfx/vr-vqfx.go +++ b/nodes/vr_vqfx/vr-vqfx.go @@ -63,6 +63,7 @@ func (s *vrVQFX) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error { } s.cfg.Env = utils.MergeStringMaps(defEnv, s.cfg.Env) + // mount config dir to support startup-config functionality s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(path.Join(s.cfg.LabDir, configDirName), ":/config")) if s.cfg.Env["CONNECTION_MODE"] == "macvtap" {