Experimental optimized XPath, multiple keys

This commit is contained in:
Olof hagsand 2019-12-31 13:29:25 +01:00
parent 7fb452f96e
commit b340c36f79
17 changed files with 681 additions and 279 deletions

View file

@ -78,7 +78,11 @@ testname=
: ${RCLOG:=}
# Wait after daemons (backend/restconf) start. See mem.sh for valgrind
: ${RCWAIT:=2}
if [ "$(arch)" = "armv7l" ]; then
: ${RCWAIT:=4}
else
: ${RCWAIT:=2}
fi
# www user (on linux typically www-data, freebsd www)
# could be taken from configure

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Run valgrind leak test for cli, restconf, netconf or background.
# Stop on first error
# Typical run: ./mem.sh 2>&1 | tee mylog
# Pattern to run tests, default is all, but you may want to narrow it down
: ${pattern:=test_*.sh}
@ -66,6 +67,19 @@ memonce(){
fi
}
# Print a line with ==== under
println(){
str=$1
echo "$str"
length=$(echo "$str" | wc -c)
let i=1
while [ $i -lt $length ]; do
echo -n "="
let i++
done
echo
}
if [ -z "$*" ]; then
cmds="backend restconf cli netconf"
else
@ -86,20 +100,7 @@ done
testnr=0
for c in $cmds; do
if [ $testnr != 0 ]; then echo; fi
echo "Mem test $c begin"
length=$(echo "Mem test $c begin" | wc -c)
let i=1
while [ $i -lt $length ]; do
echo -n "="
let i++
done
echo
println "Mem test $c begin"
memonce $c
echo "Mem test $c done"
let i=1
while [ $i -lt $length ]; do
echo -n "="
let i++
done
echo
println "Mem test $c done"
done

View file

@ -177,7 +177,6 @@ OK='^<rpc-reply><data><x xmlns="urn:example:nacm">0</x></data></rpc-reply>$'
ERROR='^<rpc-reply><rpc-error><error-type>application</error-type><error-tag>access-denied</error-tag><error-severity>error</error-severity><error-message>'
# UNIX socket, no user, loop mode. All fail since null user cant access anything
if true; then
new "Credentials: mode=none, fam=UNIX user=none"
testrun none "" UNIX $dir/backend.sock "$OK" ""
@ -186,10 +185,8 @@ testrun exact "" UNIX $dir/backend.sock "$OK" ""
new "Credentials: mode=except, fam=UNIX user=none"
testrun except "" UNIX $dir/backend.sock "$OK" ""
fi
# UNIX socket, myuser, loop mode. All should work
if true; then
new "Credentials: mode=none, fam=UNIX user=me"
testrun none "$USER" UNIX $dir/backend.sock "$OK" ""
@ -198,10 +195,8 @@ testrun exact "$USER" UNIX $dir/backend.sock "$OK" ""
new "Credentials: mode=except, fam=UNIX user=me"
testrun except "$USER" UNIX $dir/backend.sock "$OK" ""
fi
# UNIX socket, admin user. First should work
if true; then
new "Credentials: mode=none, fam=UNIX user=admin"
testrun none admin UNIX $dir/backend.sock "$OK" ""
@ -210,10 +205,8 @@ testrun exact admin UNIX $dir/backend.sock "$ERROR" ""
new "Credentials: mode=except, fam=UNIX user=admin"
testrun except admin UNIX $dir/backend.sock "$ERROR" ""
fi
# UNIX socket, admin user. sudo self to root. First and last should work
if true; then
new "Credentials: mode=none, fam=UNIX user=admin sudo"
testrun none admin UNIX $dir/backend.sock "$OK" sudo
@ -222,10 +215,8 @@ testrun exact admin UNIX $dir/backend.sock "$ERROR" sudo
new "Credentials: mode=except, fam=UNIX user=admin sudo"
testrun except admin UNIX $dir/backend.sock "$OK" sudo
fi
# IPv4 socket, admin user. First should work
if true; then
new "Credentials: mode=none, fam=UNIX user=admin sudo"
testrun none $USER IPv4 127.0.0.1 "$OK" ""
@ -234,6 +225,5 @@ testrun exact $USER IPv4 127.0.0.1 "$ERROR" ""
new "Credentials: mode=except, fam=UNIX user=admin sudo"
testrun except $USER IPv4 127.0.0.1 "$ERROR" ""
fi
rm -rf $dir