jjb: xci: xci-run-functest: Escape the 'var' variable 01/55601/1
authorMarkos Chandras <mchandras@suse.de>
Thu, 12 Apr 2018 15:14:19 +0000 (16:14 +0100)
committerMarkos Chandras <mchandras@suse.de>
Thu, 12 Apr 2018 15:15:02 +0000 (16:15 +0100)
Commit 33073c5a3426c1867411db446bc9e5d84d2a7747 ("jjb: xci:
xci-run-functest.sh: Ensure env vars are quoted during reload") added
support for reloading the OPNFV host environment in a safe way but that
didn't work because the internal '$var' variable was not escaped so it
was evaluated on the local host instead of the remote one. This fixes
the problem by properly escaping the variable.

Change-Id: I7c90ae18f77aca076579f70c7c0e9a72aaaad7c8
Signed-off-by: Markos Chandras <mchandras@suse.de>
jjb/xci/xci-run-functest.sh

index fad2d7b..6d43c97 100755 (executable)
@@ -47,7 +47,7 @@ fi
 export XCI_PATH=/home/devuser/releng-xci
 export XCI_VENV=${XCI_PATH}/venv
 
-ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "source $XCI_VENV/bin/activate; while read var; do declare -x \"${var}\" 2>/dev/null; done < ${XCI_PATH}/.cache/xci.env && cd releng-xci/xci && ansible-playbook -i installer/osa/files/$XCI_FLAVOR/inventory playbooks/prepare-functest.yml"
+ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "source $XCI_VENV/bin/activate; while read var; do declare -x \"\${var}\" 2>/dev/null; done < ${XCI_PATH}/.cache/xci.env && cd releng-xci/xci && ansible-playbook -i installer/osa/files/$XCI_FLAVOR/inventory playbooks/prepare-functest.yml"
 echo "Running functest"
 ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "/root/run-functest.sh"
 # Record exit code