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
|
ssh -t $h sudo systemctl stop nginx
|
||||||
fi
|
fi
|
||||||
ssh -t $h "(cd src/clixon/test; ./sum.sh)"
|
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"
|
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>]]>]]>$"
|
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
|
if [ $BE -ne 0 ]; then
|
||||||
new "Kill backend"
|
new "Kill backend"
|
||||||
# Check if premature kill
|
# Check if premature kill
|
||||||
|
|
@ -194,4 +199,7 @@ fi
|
||||||
# Set by restconf_config
|
# Set by restconf_config
|
||||||
unset RESTCONFIG
|
unset RESTCONFIG
|
||||||
|
|
||||||
|
new "Endtest"
|
||||||
|
endtest
|
||||||
|
|
||||||
rm -rf $dir
|
rm -rf $dir
|
||||||
|
|
|
||||||
|
|
@ -334,9 +334,10 @@ if [ $BE -eq 0 ]; then
|
||||||
stop_backend -f $cfg
|
stop_backend -f $cfg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
endtest
|
|
||||||
|
|
||||||
# Set by restconf_config
|
# Set by restconf_config
|
||||||
unset RESTCONFIG
|
unset RESTCONFIG
|
||||||
|
|
||||||
|
new "Endtest"
|
||||||
|
endtest
|
||||||
|
|
||||||
rm -rf $dir
|
rm -rf $dir
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,18 @@
|
||||||
# Magic line must be first in script (see README.md)
|
# Magic line must be first in script (see README.md)
|
||||||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
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
|
if ! [ -x "$(command -v ssh)" ]; then
|
||||||
echo "...ssh not installed"
|
echo "...ssh not installed"
|
||||||
if [ "$s" = $0 ]; then exit 0; else return 0; fi # skip
|
if [ "$s" = $0 ]; then exit 0; else return 0; fi # skip
|
||||||
fi
|
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:="clixon_netconf_ssh_callhome"}
|
||||||
: ${clixon_netconf_ssh_callhome_client:="clixon_netconf_ssh_callhome_client"}
|
: ${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
|
# The result is not checked, only the client-side
|
||||||
function callhomefn()
|
function callhomefn()
|
||||||
{
|
{
|
||||||
sleep 1
|
cat<<EOF>$sshdcfg
|
||||||
|
|
||||||
cat<<EOF>$sshdcfg
|
|
||||||
PasswordAuthentication no
|
PasswordAuthentication no
|
||||||
AuthorizedKeysFile $authfile
|
AuthorizedKeysFile $authfile
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
sleep 1 # There may be a far-fetched race condition here if this is too early
|
||||||
|
|
||||||
new "Start Callhome in background"
|
new "Start Callhome in background"
|
||||||
echo "sudo clixon_netconf_ssh_callhome} -D 1 -a 127.0.0.1 -C $sshdcfg -c $cfg"
|
# sudo does not look in /usr/local/bin on eg cento8
|
||||||
expectpart "$(sudo ${clixon_netconf_ssh_callhome} -D 1 -a 127.0.0.1 -C $sshdcfg -c $cfg)" 255 ""
|
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
|
rm -f $authfile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,6 +120,7 @@ callhomefn &
|
||||||
|
|
||||||
cat<<EOF > $dir/knownhosts
|
cat<<EOF > $dir/knownhosts
|
||||||
. $(cat /etc/ssh/ssh_host_ed25519_key.pub)
|
. $(cat /etc/ssh/ssh_host_ed25519_key.pub)
|
||||||
|
. $(cat /etc/ssh/ssh_host_ecdsa_key.pub)
|
||||||
EOF
|
EOF
|
||||||
cat<<EOF > $sshcfg
|
cat<<EOF > $sshcfg
|
||||||
StrictHostKeyChecking yes
|
StrictHostKeyChecking yes
|
||||||
|
|
@ -119,7 +129,7 @@ HashKnownHosts no
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
new "Start Listener client"
|
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
|
#-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>]]>]]>"
|
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
|
cfg=$dir/conf_startup.xml
|
||||||
|
|
||||||
|
# Dont run this test with valgrind
|
||||||
if [ $valgrindtest -ne 0 ]; then
|
if [ $valgrindtest -ne 0 ]; then
|
||||||
echo "...skipped "
|
echo "...skipped "
|
||||||
return 0 # skip
|
return 0 # skip
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue