Skip to content

Commit

Permalink
Add space before extra arguments for renumber_topo and restart_ptf (#…
Browse files Browse the repository at this point in the history
…3558)

In the testbed-cli.sh tool, extra arguments can be passed to the playbook for
renumber_topo and restart_ptf. However, there is no whitespace before the
extra arguments `$@`. Then the extra arguments will be part of value of ansible
variable `ptf_ipv6`. This command works:
  ./testbed-cli.sh restart-ptf <testbed_name> password.txt

  This command will fail:
  ./testbed-cli.sh restart-ptf <testbed_name> password.txt -vv

The last "-vv" will be appended to value of ansible variable `ptf_ipv6`.

The fix is just to add a white space before `$@`.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
  • Loading branch information
wangxin authored Jun 1, 2021
1 parent 0d1afb1 commit 79b9e47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ansible/testbed-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function renumber_topo

read_file ${topology}

ANSIBLE_SCP_IF_SSH=y ansible-playbook -i $vmfile testbed_renumber_vm_topology.yml --vault-password-file="${passwd}" -l "$server" -e topo_name="$topo_name" -e duts_name="$duts" -e VM_base="$vm_base" -e ptf_ip="$ptf_ip" -e topo="$topo" -e vm_set_name="$vm_set_name" -e ptf_imagename="$ptf_imagename" -e ptf_ipv6="$ptf_ipv6"$@
ANSIBLE_SCP_IF_SSH=y ansible-playbook -i $vmfile testbed_renumber_vm_topology.yml --vault-password-file="${passwd}" -l "$server" -e topo_name="$topo_name" -e duts_name="$duts" -e VM_base="$vm_base" -e ptf_ip="$ptf_ip" -e topo="$topo" -e vm_set_name="$vm_set_name" -e ptf_imagename="$ptf_imagename" -e ptf_ipv6="$ptf_ipv6" $@

ansible-playbook fanout_connect.yml -i $vmfile --limit "$server" --vault-password-file="${passwd}" -e "dut=$duts" $@

Expand All @@ -325,9 +325,9 @@ function restart_ptf

echo "Restart ptf for testbed '${vm_set_name}'"

ANSIBLE_SCP_IF_SSH=y ansible-playbook -i $vmfile testbed_renumber_vm_topology.yml --vault-password-file="${passwd}" -l "$server" -e topo_name="$topo_name" -e duts_name="$duts" -e VM_base="$vm_base" -e ptf_ip="$ptf_ip" -e topo="$topo" -e vm_set_name="$vm_set_name" -e ptf_imagename="$ptf_imagename" -e ptf_ipv6="$ptf_ipv6"$@
ANSIBLE_SCP_IF_SSH=y ansible-playbook -i $vmfile testbed_renumber_vm_topology.yml --vault-password-file="${passwd}" -l "$server" -e topo_name="$topo_name" -e duts_name="$duts" -e VM_base="$vm_base" -e ptf_ip="$ptf_ip" -e topo="$topo" -e vm_set_name="$vm_set_name" -e ptf_imagename="$ptf_imagename" -e ptf_ipv6="$ptf_ipv6" $@

echo Done
echo Done
}

function refresh_dut
Expand Down

0 comments on commit 79b9e47

Please sign in to comment.