From b9e3b917e7ee6feb3dffeb3df872f3f27460fd8c Mon Sep 17 00:00:00 2001 From: Pawel Piatek Date: Mon, 10 Aug 2020 16:05:03 +0200 Subject: [PATCH] script/vagrant: split into functions - deploy test vm Signed-off-by: Pawel Piatek Change-Id: I301a100f24f8bb7d20756ccfd0fcd29405956cfc Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3717 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Karol Latecki --- scripts/vagrant/Vagrantfile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index d007b9859..fb1c5185b 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -196,6 +196,17 @@ def setup_vagrant_cachier(config, plugins_sync_backend) end end +def deploy_test_vm(config) + return unless ENV['DEPLOY_TEST_VM'] == "1" + return unless ENV['SPDK_DIR'] + + config.vm.provision "shell" do |setup| + setup.path = ENV['SPDK_DIR'] + '/test/common/config/vm_setup.sh' + setup.privileged = false + setup.args = ["-u", "-i"] + end +end + Vagrant.configure(2) do |config| # Pick the right distro and bootstrap, default is fedora30 @@ -336,11 +347,5 @@ Vagrant.configure(2) do |config| end # provision the vm with all of the necessary spdk dependencies for running the autorun.sh tests - if ENV['DEPLOY_TEST_VM'] == "1" && spdk_dir != "none" - config.vm.provision "shell" do |setup| - setup.path = "#{spdk_dir}/test/common/config/vm_setup.sh" - setup.privileged = false - setup.args = ["-u", "-i"] - end - end + deploy_test_vm(config) end