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

@ -329,7 +329,7 @@ reset
tmppipe=$(mktemp -u)
mkfifo -m 600 "$tmppipe"
cat << EOF | clixon_cli -f $cfg >> /dev/null &
cat << EOF | $clixon_cli -f $cfg >> /dev/null &
set table parameter eth0
commit confirmed 60
shell echo >> $tmppipe
@ -349,7 +349,7 @@ rm $tmppipe
new "14. cli persistent confirmed-commit"
reset
cat << EOF | clixon_cli -f $cfg >> /dev/null
cat << EOF | $clixon_cli -f $cfg >> /dev/null
set table parameter eth0
commit confirmed persist a
quit
@ -357,7 +357,7 @@ EOF
assert_config_equals "running" "$CONFIGB"
cat << EOF | clixon_cli -f $cfg >> /dev/null
cat << EOF | $clixon_cli -f $cfg >> /dev/null
set table parameter eth1
commit persist-id a confirmed persist ab
quit
@ -384,7 +384,7 @@ expectpart "$($clixon_cli -lo -1 -f $cfg commit persist-id ab cancel)" 255 "no c
new "18. cli persistent confirmed-commit with timeout"
reset
cat << EOF | clixon_cli -f $cfg >> /dev/null
cat << EOF | $clixon_cli -f $cfg >> /dev/null
set table parameter eth0
commit confirmed persist abcd 3
EOF
@ -396,13 +396,13 @@ assert_config_equals "running" ""
new "19. cli persistent confirmed-commit with reset timeout"
reset
cat << EOF | clixon_cli -f $cfg >> /dev/null
cat << EOF | $clixon_cli -f $cfg >> /dev/null
set table parameter eth0
commit confirmed persist abcd 5
EOF
assert_config_equals "running" "$CONFIGB"
cat << EOF | clixon_cli -f $cfg >> /dev/null
cat << EOF | $clixon_cli -f $cfg >> /dev/null
set table parameter eth1
commit persist-id abcd confirmed persist abcdef 10
EOF