From 4892b9353d8f218f8a05a8b52d636db5d98eec17 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 5 Jun 2020 17:22:50 +0200 Subject: [PATCH] vm_setup: Add arg for disabling use of tsocks This mainly concerns QEMU compilation. For system which have installed tsocks, vm_setup.sh always tries to pass --with-git to QEMU's configure even when tsocks is not really used (it determines that based on $CONF which by default has tsocks enabled and presence of the tsocks binary). Since in that scenario qemu compilation would simply fail, allow user to force vm_setup.sh into simply ignoring tsocks alltogether. This is an alternative for a change which potentially could break the compatibility by removing tsocks from default $CONF list (I guess there may be some systems out there that relay on tsocks and its default setup in the $CONF). Change-Id: Id3583357878002c79e1a554df664c297a0e39cb3 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2787 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Karol Latecki --- test/common/config/pkgdep/git | 2 +- test/common/config/vm_setup.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index 245bf2d74..4d75abcb9 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -176,7 +176,7 @@ function install_qemu() { # Most tsocks proxies rely on a configuration file in /etc/tsocks.conf. # If using tsocks, please make sure to complete this config before trying to build qemu. - if [[ $INSTALL_TSOCKS == true ]]; then + if [[ $INSTALL_TSOCKS == true && $NO_TSOCKS != true ]]; then if hash tsocks 2> /dev/null; then opt_params+=("--with-git='tsocks git'") fi diff --git a/test/common/config/vm_setup.sh b/test/common/config/vm_setup.sh index cde8b6c72..0fee6ea9f 100755 --- a/test/common/config/vm_setup.sh +++ b/test/common/config/vm_setup.sh @@ -55,6 +55,7 @@ function usage() { echo " -t --test-conf List of test configurations to enable (${CONF})" echo " -c --conf-path Path to configuration file" echo " -d --dir-git Path to where git sources should be saved" + echo " -s --disable-tsocks Disable use of tsocks" exit 0 } @@ -79,7 +80,7 @@ else fi # Parse input arguments # -while getopts 'd:iuht:c:-:' optchar; do +while getopts 'd:siuht:c:-:' optchar; do case "$optchar" in -) case "$OPTARG" in @@ -89,6 +90,7 @@ while getopts 'd:iuht:c:-:' optchar; do test-conf=*) CONF="${OPTARG#*=}" ;; conf-path=*) CONF_PATH="${OPTARG#*=}" ;; dir-git=*) GIT_REPOS="${OPTARG#*=}" ;; + disable-tsocks) NO_TSOCKS=true ;; *) echo "Invalid argument '$OPTARG'" usage @@ -101,6 +103,7 @@ while getopts 'd:iuht:c:-:' optchar; do t) CONF="$OPTARG" ;; c) CONF_PATH="$OPTARG" ;; d) GIT_REPOS="$OPTARG" ;; + s) NO_TSOCKS=true ;; *) echo "Invalid argument '$OPTARG'" usage