Commit 0b2236c5 authored by Ben Walker's avatar Ben Walker Committed by Darek Stojaczyk
Browse files

vhost: Delete scripts for manual testing



These scripts aren't tests - they're just shortcuts to be used from
the command line to run tests. But we're moving to a model where
users can run individual tests directly by passing in the 'iso' flag,
so these aren't useful any longer.

Change-Id: I0789a4d267c6ab0e111a6b2f4ffd3b6ce21d9638
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454091


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 3d11b2fe
Loading
Loading
Loading
Loading

test/vhost/common/run_vhost.sh

deleted100755 → 0
+0 −51
Original line number Diff line number Diff line
#!/usr/bin/env bash

BASE_DIR=$(readlink -f $(dirname $0))
[[ -z "$COMMON_DIR" ]] && COMMON_DIR="$(cd $BASE_DIR/../common && pwd)"
[[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../../../ && pwd)"

vhost_num=""

function usage()
{
	[[ ! -z $2 ]] && ( echo "$2"; echo ""; )
	echo "Shortcut script for running vhost app."
	echo "Usage: $(basename $1) [-x] [-h|--help] [--clean-build] [--work-dir=PATH]"
	echo "-h, --help           print help and exit"
	echo "-x                   Set -x for script debug"
	echo "    --work-dir=PATH  Where to find source/project. [default=$TEST_DIR]"
	echo "    --conf-dir=PATH  Path to directory with configuration for vhost"
	echo "    --vhost-num=NUM  Optional: vhost instance NUM to start. Default: 0"

	exit 0
}

run_in_background=false
while getopts 'xh-:' optchar; do
	case "$optchar" in
		-)
		case "$OPTARG" in
			help) usage $0 ;;
			work-dir=*) TEST_DIR="${OPTARG#*=}" ;;
			conf-dir=*) CONF_DIR="${OPTARG#*=}" ;;
			vhost-num=*) vhost_num="${OPTARG}" ;;
			*) usage $0 echo "Invalid argument '$OPTARG'" ;;
		esac
		;;
	h) usage $0 ;;
	x) set -x ;;
	*) usage $0 "Invalid argument '$optchar'" ;;
	esac
done

if [[ $EUID -ne 0 ]]; then
	fail "Go away user come back as root"
fi

notice "$0"
notice ""

. $COMMON_DIR/../common.sh

# Starting vhost with valid options
spdk_vhost_run $vhost_num --conf-path=$CONF_DIR

test/vhost/common/vm_run.sh

deleted100755 → 0
+0 −48
Original line number Diff line number Diff line
#!/usr/bin/env bash

BASE_DIR=$(readlink -f $(dirname $0))
[[ -z "$COMMON_DIR" ]] && COMMON_DIR="$(cd $BASE_DIR/../common && pwd)"
[[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../../../ && pwd)"

function usage()
{
	[[ ! -z $2 ]] && ( echo "$2"; echo ""; )
	echo "Shortcut script for enabling VMs"
	echo "Usage: $(basename $1) [OPTIONS] VM..."
	echo
	echo "-h, --help                print help and exit"
	echo "    --work-dir=WORK_DIR   Where to find build file. Must exist. [default: ./..]"
	echo "-a                        Run all VMs in WORK_DIR"
	echo "-x                        set -x for script debug"
	exit 0
}
run_all=false
while getopts 'xah-:' optchar; do
	case "$optchar" in
		-)
		case "$OPTARG" in
			help) usage $0 ;;
			work-dir=*) TEST_DIR="${OPTARG#*=}" ;;
			*) usage $0 "Invalid argument '$OPTARG'" ;;
		esac
		;;
	h) usage $0 ;;
	a) run_all=true ;;
	x) set -x ;;
	*) usage $0 "Invalid argument '$OPTARG'"
	esac
done

. $COMMON_DIR/../common.sh

if [[ $EUID -ne 0 ]]; then
	fail "Go away user come back as root"
fi

if $run_all; then
	vm_run -a
else
	shift $((OPTIND-1))
	notice "running VMs: $@"
	vm_run "$@"
fi

test/vhost/common/vm_setup.sh

deleted100755 → 0
+0 −78
Original line number Diff line number Diff line
#!/usr/bin/env bash

BASE_DIR=$(readlink -f $(dirname $0))
[[ -z "$COMMON_DIR" ]] && COMMON_DIR="$(cd $BASE_DIR/../common && pwd)"
[[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../../../ && pwd)"

function usage()
{
	[[ ! -z $2 ]] && ( echo "$2"; echo ""; )
	echo "Shortcut script for setting up VMs for tests"
	echo "Usage: $(basename $1) [OPTIONS] VM_NUM"
	echo
	echo "-h, --help                    Print help and exit"
	echo "    --work-dir=WORK_DIR       Where to find build file. Must exit. (default: $TEST_DIR)"
	echo "    --force=VM_NUM            Force VM_NUM reconfiguration if already exist"
	echo "    --disk-type=TYPE          Perform specified test:"
	echo "                              virtio - test host virtio-scsi-pci using file as disk image"
	echo "                              kernel_vhost - use kernel driver vhost-scsi"
	echo "                              spdk_vhost_scsi - use spdk vhost scsi"
	echo "                              spdk_vhost_blk - use spdk vhost block"
	echo "    --read-only=true|false    Enable/Disable read only for vhost_blk tests"
	echo "    --raw-cache=CACHE         Use CACHE for virtio test: "
	echo "                              writethrough, writeback, none, unsafe or directsyns"
	echo "    --disk=PATH[,disk_type]   Disk to use in test. test specific meaning:"
	echo "                              virtio - disk path (file or block device ex: /dev/nvme0n1)"
	echo "                              kernel_vhost - the WWN number to be used"
	echo "                              spdk_vhost_[scsi|blk] - the socket path."
	echo "                              optional disk_type - set disk type for disk (overwrites test-type)"
	echo "                              e.g. /dev/nvme0n1,spdk_vhost_scsi"
	echo "    --os=OS_QCOW2             Custom OS qcow2 image file"
	echo "    --os-mode=MODE            MODE how to use provided image: default: backing"
	echo "                              backing - create new image but use provided backing file"
	echo "                              copy - copy provided image and use a copy"
	echo "                              orginal - use file directly. Will modify the provided file"
	echo "    --incoming=VM_NUM         Use VM_NUM as source migration VM."
	echo "    --migrate-to=VM_NUM       Use VM_NUM as target migration VM."
	echo "    --vhost-num=NUM       Optional: vhost instance NUM to be used by this VM. Default: 0"
	echo "-x                            Turn on script debug (set -x)"
	echo "-v                            Be more verbose"
	exit 0
}

setup_params=()
for param in "$@"; do
	case "$param" in
		--help|-h) usage $0 ;;
		--work-dir=*)
			TEST_DIR="${param#*=}"
			continue
			;;
		--raw-cache=*) ;;
		--disk-type=*) ;;
		--disks=*) ;;
		--os=*) ;;
		--os-mode=*) ;;
		--force=*) ;;
		--incoming=*) ;;
		--migrate-to=*) ;;
		--read-only=*) ;;
		-x)
			set -x
			continue
			;;
		-v)
			SPDK_VHOST_VERBOSE=true
			continue
			;;
		*) usage $0 "Invalid argument '$param'" ;;
	esac

	setup_params+=( "$param" )
done

. $COMMON_DIR/../common.sh

vm_setup ${setup_params[@]}

trap -- ERR

test/vhost/common/vm_shutdown.sh

deleted100755 → 0
+0 −66
Original line number Diff line number Diff line
#!/usr/bin/env bash

BASE_DIR=$(readlink -f $(dirname $0))
[[ -z "$COMMON_DIR" ]] && COMMON_DIR="$(cd $BASE_DIR/../common && pwd)"
[[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../../../ && pwd)"

function usage()
{
	[[ ! -z $2 ]] && ( echo "$2"; echo ""; )
	echo "Shortcut script for shutting down VMs"
	echo "Usage: $(basename $1) [OPTIONS] [VMs]"
	echo
	echo "-h, --help                print help and exit"
	echo "    --work-dir=WORK_DIR   Where to find build file. Must exist. [default: ./..]"
	echo "-a                        kill/shutdown all running VMs"
	echo "-k                        kill instead of shutdown"
	exit 0
}
optspec='akh-:'
do_kill=false
all=false

while getopts "$optspec" optchar; do
	case "$optchar" in
		-)
		case "$OPTARG" in
			help)       usage $0 ;;
			work-dir=*) TEST_DIR="${OPTARG#*=}" ;;
			*)           usage $0 "Invalid argument '$OPTARG'" ;;
		esac
		;;
	h) usage $0 ;;
	k) do_kill=true ;;
	a) all=true ;;
	*) usage $0 "Invalid argument '$OPTARG'"
	esac
done

. $COMMON_DIR/../common.sh

if $do_kill && [[ $EUID -ne 0 ]]; then
	echo "Go away user come back as root"
	exit 1
fi

if $all; then
	if do_kill; then
		notice "killing all VMs"
		vm_kill_all
	else
		notice "shutting down all VMs"
		vm_shutdown_all
	fi
else
	shift $((OPTIND-1))

	if do_kill; then
		notice "INFO: killing VMs: $@"
		for vm in $@; do
			vm_kill $vm
		done
	else
		notice "shutting down all VMs"
		vm_shutdown_all
	fi
fi

test/vhost/common/vm_ssh.sh

deleted100755 → 0
+0 −58
Original line number Diff line number Diff line
#!/usr/bin/env bash

BASE_DIR=$(readlink -f $(dirname $0))
[[ -z "$COMMON_DIR" ]] && COMMON_DIR="$(cd $BASE_DIR/../common && pwd)"
[[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../../../ && pwd)"

function usage()
{
	[[ ! -z $2 ]] && ( echo "$2"; echo ""; )
	echo "Shortcut script for connecting to or executing command on selected VM"
	echo "Usage: $(basename $1) [OPTIONS] VM_NUMBER"
	echo
	echo "-h, --help                print help and exit"
	echo "    --work-dir=WORK_DIR   Where to find build file. Must exist. [default: $TEST_DIR]"
	echo "-w                        Don't wait for vm to boot"
	echo "-x                        set -x for script debug"
	exit 0
}

boot_wait=true
while getopts 'xwh-:' optchar; do
	case "$optchar" in
		-)
		case "$OPTARG" in
			help)	usage $0 ;;
			work-dir=*) TEST_DIR="${OPTARG#*=}" ;;
			*) usage $0 "Invalid argument '$OPTARG'" ;;
		esac ;;
	h) usage $0 ;;
	w) boot_wait=false ;;
	x) set -x ;;
	*) usage $0 "Invalid argument '$OPTARG'" ;;
	esac
done

. $COMMON_DIR/../common.sh

shift $((OPTIND-1))
vm_num="$1"
shift


if ! vm_num_is_valid $vm_num; then
	usage $0 "Invalid VM num $vm_num"
	exit 1
fi

if $boot_wait; then
	while ! vm_os_booted $vm_num; do
		if ! vm_is_running $vm_num; then
			fail "VM$vm_num is not running"
		fi
		notice "waiting for VM$vm_num to boot"
		sleep 1
	done
fi

vm_ssh $vm_num "$@"