Commit a2eeec65 authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Tomasz Zawadzki
Browse files

scripts/vagrant: synchronize artifacts from vm to host



Sync "output" directory (containing all build results,
like doc, coverage, test completions, etc.)
from guest to host.

Change-Id: I9a57a72eb610aacde011fc39bb8d39c74486cef1
Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1044


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 2a75be1a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ Vagrant.configure(2) do |config|
  emulated_nvme_types=(ENV['NVME_DISKS_TYPE'] || "nvme").split(',')
  nvme_namespaces=(ENV['NVME_DISKS_NAMESPACES'] || "").split(',')
  nvme_file=(ENV['NVME_FILE'] || "").split(',')
  vagrantfile_dir=(ENV['VAGRANTFILE_DIR'] || "none")

  config.ssh.forward_agent = true
  config.ssh.forward_x11 = true
@@ -194,6 +195,11 @@ Vagrant.configure(2) do |config|
    config.vm.synced_folder "#{spdk_dir}", "/home/vagrant/spdk_repo/spdk", owner: "vagrant", group: "vagrant", type: "rsync", rsync__auto: false
  end

  # rsync artifacts from build
  if ENV['COPY_SPDK_ARTIFACTS'] == "1"
    config.vm.synced_folder "#{vagrantfile_dir}", "/home/vagrant/spdk_repo/output", type: "sshfs"
  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|
+9 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ display_help() {
	echo "  -c                              Create all above disk, default 0"
	echo "  -u                              Use password authentication to the VM instead of SSH keys."
	echo "  -l                              Use a local copy of spdk, don't try to rsync from the host."
	echo "  -a                              Copy spdk/autorun.sh artifacts from VM to host system."
	echo "  -d                              Deploy a test vm by provisioning all prerequisites for spdk autotest"
	echo "  --qemu-emulator=<path>          Path to custom QEMU binary. Only works with libvirt provider"
	echo "  --vagrantfiles-dir=<path>       Destination directory to put Vagrantfile into."
@@ -62,6 +63,7 @@ SPDK_VAGRANT_HTTP_PROXY=""
VERBOSE=0
HELP=0
COPY_SPDK_DIR=1
COPY_SPDK_ARTIFACTS=0
DRY_RUN=0
DEPLOY_TEST_VM=0
SPDK_VAGRANT_DISTRO="distro"
@@ -78,7 +80,7 @@ VAGRANTFILE_DIR=""
VAGRANT_PASSWORD_AUTH=0
VAGRANT_PACKAGE_BOX=0

while getopts ":b:n:s:x:p:u:vcrldh-:" opt; do
while getopts ":b:n:s:x:p:u:vcraldh-:" opt; do
	case "${opt}" in
		-)
		case "${OPTARG}" in
@@ -115,6 +117,9 @@ while getopts ":b:n:s:x:p:u:vcrldh-:" opt; do
			display_help >&2
			exit 0
		;;
		a)
			COPY_SPDK_ARTIFACTS=1
		;;
		l)
			COPY_SPDK_DIR=0
		;;
@@ -228,6 +233,7 @@ export SPDK_VAGRANT_VMCPU
export SPDK_VAGRANT_VMRAM
export SPDK_DIR
export COPY_SPDK_DIR
export COPY_SPDK_ARTIFACTS
export DEPLOY_TEST_VM
export NVME_DISKS_TYPE
export NVME_DISKS_NAMESPACES
@@ -262,6 +268,7 @@ if [ ${DRY_RUN} = 1 ]; then
fi
if [ -z "$VAGRANTFILE_DIR" ]; then
	VAGRANTFILE_DIR="${VAGRANT_TARGET}/${SPDK_VAGRANT_DISTRO}-${SPDK_VAGRANT_PROVIDER}"
	export VAGRANTFILE_DIR
fi

if [ -d "${VAGRANTFILE_DIR}" ]; then
@@ -289,6 +296,7 @@ http_proxy: ${http_proxy}
EOF
		fi
	fi
	mkdir -p "${VAGRANTFILE_DIR}/output"
	vagrant up $provider
	if [ ${VAGRANT_PACKAGE_BOX} == 1 ]; then
		vagrant ssh -c 'sudo spdk_repo/spdk/scripts/vagrant/update.sh'