test fixes: ssh clalhome centos8, auth mem-leak, etc
This commit is contained in:
parent
f7d4df01a6
commit
dcc19d3edf
5 changed files with 30 additions and 9 deletions
|
|
@ -55,3 +55,4 @@ else
|
|||
ssh -t $h sudo systemctl stop nginx
|
||||
fi
|
||||
ssh -t $h "(cd src/clixon/test; ./sum.sh)"
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -180,6 +180,11 @@ expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+xml
|
|||
new "Check running empty"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><get-config><source><running/></source></get-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><data/></rpc-reply>]]>]]>$"
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
new "Kill restconf daemon"
|
||||
stop_restconf
|
||||
fi
|
||||
|
||||
if [ $BE -ne 0 ]; then
|
||||
new "Kill backend"
|
||||
# Check if premature kill
|
||||
|
|
@ -194,4 +199,7 @@ fi
|
|||
# Set by restconf_config
|
||||
unset RESTCONFIG
|
||||
|
||||
new "Endtest"
|
||||
endtest
|
||||
|
||||
rm -rf $dir
|
||||
|
|
|
|||
|
|
@ -334,9 +334,10 @@ if [ $BE -eq 0 ]; then
|
|||
stop_backend -f $cfg
|
||||
fi
|
||||
|
||||
endtest
|
||||
|
||||
# Set by restconf_config
|
||||
unset RESTCONFIG
|
||||
|
||||
new "Endtest"
|
||||
endtest
|
||||
|
||||
rm -rf $dir
|
||||
|
|
|
|||
|
|
@ -4,12 +4,18 @@
|
|||
# Magic line must be first in script (see README.md)
|
||||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
||||
|
||||
# Skip it no openssh
|
||||
# Skip it if no openssh
|
||||
if ! [ -x "$(command -v ssh)" ]; then
|
||||
echo "...ssh not installed"
|
||||
if [ "$s" = $0 ]; then exit 0; else return 0; fi # skip
|
||||
fi
|
||||
|
||||
# Dont run this test with valgrind
|
||||
if [ $valgrindtest -ne 0 ]; then
|
||||
echo "...skipped "
|
||||
return 0 # skip
|
||||
fi
|
||||
|
||||
: ${clixon_netconf_ssh_callhome:="clixon_netconf_ssh_callhome"}
|
||||
: ${clixon_netconf_ssh_callhome_client:="clixon_netconf_ssh_callhome_client"}
|
||||
|
||||
|
|
@ -65,16 +71,19 @@ cp $key.pub $authfile
|
|||
# The result is not checked, only the client-side
|
||||
function callhomefn()
|
||||
{
|
||||
sleep 1
|
||||
|
||||
cat<<EOF>$sshdcfg
|
||||
cat<<EOF>$sshdcfg
|
||||
PasswordAuthentication no
|
||||
AuthorizedKeysFile $authfile
|
||||
|
||||
EOF
|
||||
sleep 1 # There may be a far-fetched race condition here if this is too early
|
||||
|
||||
new "Start Callhome in background"
|
||||
echo "sudo clixon_netconf_ssh_callhome} -D 1 -a 127.0.0.1 -C $sshdcfg -c $cfg"
|
||||
expectpart "$(sudo ${clixon_netconf_ssh_callhome} -D 1 -a 127.0.0.1 -C $sshdcfg -c $cfg)" 255 ""
|
||||
# sudo does not look in /usr/local/bin on eg cento8
|
||||
cmd=$(which ${clixon_netconf_ssh_callhome})
|
||||
echo "sudo ${cmd} -D 1 -a 127.0.0.1 -C $sshdcfg -c $cfg"
|
||||
expectpart "$(sudo ${cmd} -D 1 -a 127.0.0.1 -C $sshdcfg -c $cfg)" 255 ""
|
||||
|
||||
rm -f $authfile
|
||||
}
|
||||
|
||||
|
|
@ -111,6 +120,7 @@ callhomefn &
|
|||
|
||||
cat<<EOF > $dir/knownhosts
|
||||
. $(cat /etc/ssh/ssh_host_ed25519_key.pub)
|
||||
. $(cat /etc/ssh/ssh_host_ecdsa_key.pub)
|
||||
EOF
|
||||
cat<<EOF > $sshcfg
|
||||
StrictHostKeyChecking yes
|
||||
|
|
@ -119,7 +129,7 @@ HashKnownHosts no
|
|||
EOF
|
||||
|
||||
new "Start Listener client"
|
||||
echo "ssh -s -v -i $key -o ProxyUseFdpass=yes -o ProxyCommand=\"clixon_netconf_ssh_callhome_client -a 127.0.0.1\" . netconf"
|
||||
echo "ssh -s -F $sshcfg -v -i $key -o ProxyUseFdpass=yes -o ProxyCommand=\"clixon_netconf_ssh_callhome_client -a 127.0.0.1\" . netconf"
|
||||
#-F $sshcfg
|
||||
expectpart "$(ssh -s -F $sshcfg -v -i $key -o ProxyUseFdpass=yes -o ProxyCommand="${clixon_netconf_ssh_callhome_client} -a 127.0.0.1" . netconf < $rpccmd)" 0 "<hello $DEFAULTNS><capabilities><capability>urn:ietf:params:netconf:base:1.0</capability><capability>urn:ietf:params:netconf:capability:yang-library:1.0?revision=2019-01-04&module-set-id=42</capability><capability>urn:ietf:params:netconf:capability:candidate:1.0</capability><capability>urn:ietf:params:netconf:capability:validate:1.1</capability><capability>urn:ietf:params:netconf:capability:startup:1.0</capability><capability>urn:ietf:params:netconf:capability:xpath:1.0</capability><capability>urn:ietf:params:netconf:capability:notification:1.0</capability></capabilities><session-id>2</session-id></hello>]]>]]>" "<rpc-reply $DEFAULTNS><data/></rpc-reply>]]>]]>"
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ APPNAME=example
|
|||
|
||||
cfg=$dir/conf_startup.xml
|
||||
|
||||
# Dont run this test with valgrind
|
||||
if [ $valgrindtest -ne 0 ]; then
|
||||
echo "...skipped "
|
||||
return 0 # skip
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue