Always use variable substition for command

Can't do a sudo inside an expect so we run the expect inside the sudo.
This commit is contained in:
Philip Prindeville 2023-08-25 13:39:50 -06:00 committed by Olof Hagsand
parent 5919ba6c6a
commit 62401b72d0
5 changed files with 18 additions and 11 deletions

View file

@ -160,7 +160,9 @@ wait_backend
xpath="/es:members/es:member[es:member-id=\'bob\']/es:favorites/es:uint64-numbers"
new "cli show pagination config using expect"
expect ./test_pagination_expect.exp "$cfg" "$xpath" "uint64-numbers 18" "uint64-numbers 19"
sudo="sudo -g ${CLICON_USER}" ## cheat
clixon_cli_="${clixon_cli##$sudo }"
clixon_cli="$clixon_cli_" $sudo --preserve-env=clixon_cli expect ./test_pagination_expect.exp "$cfg" "$xpath" "uint64-numbers 18" "uint64-numbers 19"
if [ $? -ne 0 ]; then
err1 "Failed: CLI show paginate config scroll using expect"
fi