Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Change-Id: Ie247329095ae92f3c030b33c9583a56db11081df
Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+do_afm_test()
+{
+set -x
+ if [ $SERVICE_USER -eq 1 -o $APPLICATION_USER -eq 1 ];then
+ su - $AGLDRIVER -c "aft-test $*"
+ else
+ afm-test -l $*
+ fi
+ return $?
+}
+
if [ ! -f index.html ] ; then
wget -q $BASEURL -O index.html
if [ $? -ne 0 ];then
if [ ! -f index.html ] ; then
wget -q $BASEURL -O index.html
if [ $? -ne 0 ];then
+WGTNAME="$(grep -o '[a-z-]*.wgt' index.html | sed 's,.wgt$,,' | sed 's,-debug$,,' | sed 's,-coverage$,,' | sed 's,-test$,,' | uniq)"
+
grep -o '[a-z-]*.wgt' index.html | sort | uniq |
while read wgtfile
do
# remove extension and the debug state
grep -o '[a-z-]*.wgt' index.html | sort | uniq |
while read wgtfile
do
# remove extension and the debug state
- WGTNAME=$(echo $wgtfile | sed 's,.wgt$,,' | sed 's,-debug$,,')
- SERVICE_PLATFORM=0
- SERVICE_USER=0
- APPLICATION_USER=0
+ #export WGTNAME=$(echo $wgtfile | sed 's,.wgt$,,' | sed 's,-debug$,,' | sed 's,-coverage$,,' | sed 's,-test$,,')
echo "DEBUG: fetch $wgtfile"
if [ ! -f $wgtfile ] ; then
echo "DEBUG: fetch $wgtfile"
if [ ! -f $wgtfile ] ; then
+done
+
+echo "$WGTNAME"
+
+inspectwgt()
+{
+
+ wgtfile=$1
CURDIR="$(pwd)"
ZIPOUT="$(mktemp -d)"
cd $ZIPOUT
CURDIR="$(pwd)"
ZIPOUT="$(mktemp -d)"
cd $ZIPOUT
# we are a service, now determine the scope ...
grep "urn:AGL:permission::partner:scope-platform" config.xml
if [ $? -eq 0 ];then
# we are a service, now determine the scope ...
grep "urn:AGL:permission::partner:scope-platform" config.xml
if [ $? -eq 0 ];then
+ export SERVICE_PLATFORM=1
fi
else
# we are an application
fi
else
# we are an application
+ export APPLICATION_USER=1
# no other type known (yet)
fi
else
# no other type known (yet)
fi
else
+}
+
+# cases:
+# a) (release).wgt -> lifecycle
+# b) -test.wgt -> run afm-test $wgt
+# later: c) -coverage wgt -> install coverage AND run afm-test $wgt
+for RUNIT in runrelease runtest ; do
+
+ SERVICE_PLATFORM=0
+ SERVICE_USER=0
+ APPLICATION_USER=0
+
+ if [ x"runrelease" = x"$RUNIT" ] ; then
+ eval wgtfile="${WGTNAME}.wgt"
+ inspectwgt $wgtfile
+
echo "DEBUG: list current pkgs"
# TODO mktemp
LIST='list'
echo "DEBUG: list current pkgs"
# TODO mktemp
LIST='list'
else
lava-test-case afm-util-status2-$WGTNAME --result pass
fi
else
lava-test-case afm-util-status2-$WGTNAME --result pass
fi
+ fi
+ if [ x"runtest" = x"$RUNIT" ] ; then
+ eval wgtfile="${WGTNAME}-test.wgt"
+ inspectwgt $wgtfile
+ afm-test -l $wgtfile
+ journalctl -b | grep ${WGTNAME}-test
+ ( journalctl -b | grep ${WGTNAME}-test | grep ERROR ) || true
+ fi
+