From f0566a277411087196f94629bd6109c2db05b720 Mon Sep 17 00:00:00 2001 From: Thyagarajan Balakrishnan Date: Fri, 11 Nov 2011 12:07:29 +0200 Subject: [PATCH] Changes: new test case for /usr/lib trigger RevBy: Olli Leppanen new test package is added to test if reexec is triggered when a file is installed/modified/deleted in the /usr/lib directory and the test case is put in the red-tests --- debian/rules | 1 + tests/harmattan/red-tests/tests.xml | 3 + .../applauncherd-usrlib-test.pro | 63 ++++++++++++++ .../applauncherd-usrlib-test.txt | 4 + .../applauncherd-usrlib-test/debian/README | 6 ++ .../applauncherd-usrlib-test/debian/changelog | 11 +++ .../applauncherd-usrlib-test/debian/compat | 1 + .../applauncherd-usrlib-test/debian/control | 21 +++++ .../applauncherd-usrlib-test/debian/copyright | 16 ++++ .../applauncherd-usrlib-test/debian/files | 1 + .../applauncherd-usrlib-test/debian/rules | 69 ++++++++++++++++ .../applauncherd-usrlib-test/main.cpp | 9 ++ .../applauncherd-usrlib-test_1.0_armel.deb | Bin 0 -> 3582 bytes .../applauncherd-usrlib-test_1.1_armel.deb | Bin 0 -> 3608 bytes .../testscripts/test-func-launcher.py | 77 ++++++++++++++++++ tests/harmattan/testscripts/utils.py | 38 +++++---- 16 files changed, 304 insertions(+), 16 deletions(-) create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.pro create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.txt create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/debian/README create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/debian/changelog create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/debian/compat create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/debian/control create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/debian/copyright create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/debian/files create mode 100755 tests/harmattan/testapps/applauncherd-usrlib-test/debian/rules create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test/main.cpp create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test_1.0_armel.deb create mode 100644 tests/harmattan/testapps/applauncherd-usrlib-test_1.1_armel.deb diff --git a/debian/rules b/debian/rules index 42e953c..39ca8e4 100755 --- a/debian/rules +++ b/debian/rules @@ -50,6 +50,7 @@ install: build DESTDIR=debian/tmp make install cp tests/harmattan/testapps/applauncherd-token-test_1.0_armel.deb debian/tmp/usr/share/fala_images + cp tests/harmattan/testapps/applauncherd-usrlib-test_1.?_armel.deb debian/tmp/usr/share/fala_images #tests/harmattan/testapps/applauncherd-token-test_1.0_armel.deb: # cd tests/harmattan/testapps/applauncherd-token-test-1.0 && dpkg-buildpackage diff --git a/tests/harmattan/red-tests/tests.xml b/tests/harmattan/red-tests/tests.xml index 15d285d..f26c101 100644 --- a/tests/harmattan/red-tests/tests.xml +++ b/tests/harmattan/red-tests/tests.xml @@ -82,6 +82,9 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-security.py test_reexec_when_new_token_is_installed + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_reexec_when_file_in_usrlib_modified + false true diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.pro b/tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.pro new file mode 100644 index 0000000..3418a8b --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.pro @@ -0,0 +1,63 @@ +## This file is part of test package applauncherd-token-test +# +# Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# +# Contact: Thyagarajan Balakrishnan +# +# This software, including documentation, is protected by copyright +# controlled by Nokia Corporation. All rights are reserved. Copying, +# including reproducing, storing, adapting or translating, any or all +# of this material requires the prior written consent of Nokia +# Corporation. This material also contains confidential information +# which may not be disclosed to others without the prior written +# consent of Nokia. +## + +QMAKEVERSION = $$[QMAKE_VERSION] +ISQT4 = $$find(QMAKEVERSION, ^[2-9]) +isEmpty( ISQT4 ) { + error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4"); +} + +QT += core +QT -= gui + +TARGET = fala-usrlib-test-app +TEMPLATE = app +CONFIG += warn_on link_pkgconfig +CONFIG += console +CONFIG -= app_bundle + +DESTDIR = bin +OBJECTS_DIR = obj +MOC_DIR = obj + +SOURCES += main.cpp + +# Flags to reduce binary size where possible +QMAKE_CXXFLAGS += -fdata-sections -ffunction-sections +QMAKE_LFLAGS += --discard-local --discard-all -Wl --gc-sections +QMAKE_CXXFLAGS -= -O2 +QMAKE_CXXFLAGS += -Os + +unix { + #VARIABLES + isEmpty(PREFIX) { + PREFIX = /usr + } + BINDIR = $$PREFIX/bin + LIBDIR =$$PREFIX/lib + + DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" + + #MAKE INSTALL + + INSTALLS += target usrlib + + target.path =$$BINDIR + + usrlib.files = applauncherd-usrlib-test.txt + usrlib.path = /usr/lib +} + diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.txt b/tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.txt new file mode 100644 index 0000000..a252508 --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/applauncherd-usrlib-test.txt @@ -0,0 +1,4 @@ +File to test triggering of applauncherd when a new file in /usr/lib is added + +version 1.1: test for file being modified + diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/debian/README b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/README new file mode 100644 index 0000000..9434bef --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/README @@ -0,0 +1,6 @@ +The Debian Package applauncherd-usrlib-test +---------------------------- + +This package is used to test that applauncherd is triggered for re-exec when installed application is adding/modifying a file in /usr/lib directory. + + -- Thyagarajan Balakrishnan Wed, 09 Nov 2011 16:05:43 +0200 diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/debian/changelog b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/changelog new file mode 100644 index 0000000..38356ce --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/changelog @@ -0,0 +1,11 @@ +applauncherd-usrlib-test (1.1) stable; urgency=low + + * test for upgrade. + + -- Thyagarajan Balakrishnan Thu, 10 Nov 2011 16:05:43 +0200 + +applauncherd-usrlib-test (1.0) stable; urgency=low + + * Initial Release. + + -- Thyagarajan Balakrishnan Wed, 09 Nov 2011 16:05:43 +0200 diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/debian/compat b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/compat @@ -0,0 +1 @@ +7 diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/debian/control b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/control new file mode 100644 index 0000000..c4b9047 --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/control @@ -0,0 +1,21 @@ +Source: applauncherd-usrlib-test +Section: unknown +Priority: extra +Maintainer: Thyagarajan Balakrishnan +Build-Depends: pkg-config, debhelper (>= 7.0.50~), libqt4-dev, applauncherd +Standards-Version: 3.9.1 + +Package: applauncherd-usrlib-test +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-core, libqtgui4, applauncherd, libmeegotouchcore0 +Description: Application tests applauncherd reexec for new files in /usr/lib + This application is used to test that installation of new files in /usr/lib + triggers reexec in applauncherd + +#Package: applauncherd-usrlib-test-dbg +#Architecture: devel +#Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-core, libqtgui4, applauncherd, libmeegotouchcore0, applauncherd-usrlib-test (= ${binary:Version}) +#Description: Application tests applauncherd reexec for new files in /usr/lib +# This application is used to test that installation of new files in /usr/lib +# triggers reexec in applauncherd. - with debug symbols + diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/debian/copyright b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/copyright new file mode 100644 index 0000000..13ceb72 --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/copyright @@ -0,0 +1,16 @@ +This work was packaged for Debian by: + + Thyagarajan Balakrishnan Wed, 09 Nov 2011 16:05:43 +0200 + +Copyright: + + Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + All rights reserved. + +This software, including documentation, is protected by copyright +controlled by Nokia Corporation. All rights are reserved. Copying, +including reproducing, storing, adapting or translating, any or all +of this material requires the prior written consent of Nokia +Corporation. This material also contains confidential information +which may not be disclosed to others without the prior written +consent of Nokia. diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/debian/files b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/files new file mode 100644 index 0000000..f46f156 --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/files @@ -0,0 +1 @@ +applauncherd-usrlib-test_1.1_armel.deb unknown extra diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/debian/rules b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/rules new file mode 100755 index 0000000..4f6fbff --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/debian/rules @@ -0,0 +1,69 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g + +APPNAME := applauncherd-usrlib-test + +Makefile: + qmake-qt4 + +build: build-stamp + +build-stamp: Makefile + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch $@ + +clean: Makefile + dh_testdir + dh_testroot + rm -f build-stamp + $(MAKE) clean + dh_clean + +install: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/your_appname + $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install + +# Build architecture-independent files here. +binary-indep: +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installman + dh_link +# dh_strip --dbg-package=$(APPNAME)-dbg + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure Makefile + diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test/main.cpp b/tests/harmattan/testapps/applauncherd-usrlib-test/main.cpp new file mode 100644 index 0000000..fcfeb77 --- /dev/null +++ b/tests/harmattan/testapps/applauncherd-usrlib-test/main.cpp @@ -0,0 +1,9 @@ +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + + return a.exec(); +} + diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test_1.0_armel.deb b/tests/harmattan/testapps/applauncherd-usrlib-test_1.0_armel.deb new file mode 100644 index 0000000000000000000000000000000000000000..1d9d3456cbb0f5101565e86a43f3ebe723c2e545 GIT binary patch literal 3582 zcmaizc{~%2|HsKOMDFBXLZgUiZY#+dG3Q5W#LO|*+(%Z#DvXlcgpef3nQMvuC=YK#9#8l^ANK&2dp-f~s3;&1 zsIGBYOb6H7!ZmIM5>0mqf`;m|J(;_ zga6%^P3B_xAF*w`oDLjO6X-n5$9+kARb9D3Fn9UfEx=ECpsC*7I`1kpqN$24_1C8~ zg_whDt&o)AC;ZG&<@PCzG;A|^%QrX(^xRzM&a=ab6)lg-n~67t&QjuD2G;^nTkO2; zPT2Isx^ajX^};dCqD|RqdLBX8!+b~UF7A;I5JtowkogyV9K~mu08+l1dHwX?1=A9u zWRdlYQI_lqN+S0PUUnubYotfz@F-S#iUJf-g+_`CEf&Jt4=MS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`#SPeuPaWZxveO3U=yJu_a(&8!r3uKKWm0iOY?&`d$q1ff;H4s^!Yu(yq^5v2TM`d9Mw+0RovYj4*iZn664r8H!7t*7vmpSGR;BHk|D4gP-5fF|uc zBhxu2qlEcMENoX5Tr_DyV~z_1!3eyT4vi~*tSsYL8fx+D&yKj>KRr3_i!>8>*v$i&eirNE^BMX z$!Q>YSD3Nyy@YUGmT0CQJZa{dm7C}+SnwOZxk?7_d!5vxQL8&6Bf+W(U3NL}JH%77 zl#LHcx`(>BuHG9`#IJ{?8XHxu6e_RAo~&SZSbuy*`R2ovLe?pm*Jo}ad9!rjwRrY_ T4n>I!zSjvW2P`%$EIj`L>rVZ# literal 0 HcmV?d00001 diff --git a/tests/harmattan/testapps/applauncherd-usrlib-test_1.1_armel.deb b/tests/harmattan/testapps/applauncherd-usrlib-test_1.1_armel.deb new file mode 100644 index 0000000000000000000000000000000000000000..92c049a509bb38fcb54905f10ede3082157f2eb0 GIT binary patch literal 3608 zcmai$S5(uB(#4S~p$bUHpddx0_g)04(iB8m2p~;b5Tu6Q6y%5^(z^m8frtq;fCL1Q z&_fBmMyU#f8u;I{zH-;SPiL=Lvu7Um+i%vI>l)A?H!m%a`(sycsK2DEw?8x}Tu@L@ zR$fjQGrdl=Fg3KPe;!&S^X=&v{$y~q`WIh&Yxqz)Cuma_B< zDeMm>^=?JK2TZ?neN%#y8S^i4PPozq2DG73+CZYKiRa}?GPsaIUuD$)P3X?($Eb3b zm0|U688%Dgdl{WvIkqrwY9aoo*7pTJRZt4A{IKWvDO7foH=?7;x3LOuk1MZ7<27`^ z>prbGkLTKr7pTqn&`qHuz;L5@v1+C+#(MY$9=IQfIC$^llH^*5zz_f8Y-@&ePJ8~w zgv^053*0@O8pfc`KHs^^OrvrA{TnHK25r;a~(Q3CLy;ZeM{xfK|N01aYcpgdJ3LHko2H(#axfR z7d=((%4dpR#JGE)>>ma20N;{7xEneBg~s4?E!8WHA_f_|8q-k+n5%hTKXXM^%8M&e zykzhn-u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GIm%Ec=*v~GzqyiV)`fR6JC=_Tcb>kDngr@_{g$NG#?y3J&nSQ zghZyg<|LbDU1Du0XFIJbGAJplMwk%qoPqoYCv2FQvXDDX_RsLQK0Ujnr2g?%OSSlP z8zQfV(q3KdBgZ1zE7xZ}(6s+r-K5Mm#rvOVhh&o77A^H>u;OO@_78+2Z?nvt;ym zZ&DXHXSrC32{aRQ`yxw`59_FJW!jenwVNcko>6ndGR)3N-M*TNXT=Ts` zuu}B-vF*!O+i&9S{BJG?#K-1e#?c8FTP*Xkp6D~3Vbu~-%|z%Ap(GVoD14PEv&L_w z_hZ^ve$6%)xTedF{V0XfaR#pTw1cFDE9ZsX3PxDXYpg(wfk_7iKWW7!^t72EAhXkUxTnwUYuah2*P@|Xd|+`I&R3%csRuQ^UG#gi zNV(K``g-fn3p z!{E}3y%DcS8K&*^q4mqoqJ@tEKA7X1~}TWG3d-IL%X4P{cyh0+Z>=zZ;UNGx|{JW?6Zd1 zib395-~h=qPJ+(+WK=g#NbfeWJn=E=ZYhSDt@oH>^+N)1KF7Li&a|Nt{N(VyGVL8{ z74{|5uu5ZtmhWx91?H|pqfMJo_nOq}?V29i5h98MJL*5J#Z9c~rRWHY5}VL99;xm* zuckrza*_|<2`=At40&ag;9=EYZJuFd|2^0Q`=CV$Umv46P$gE8U zD#R1M+#78lE>;vFon(fi*;X)v{BF=of##GshAYH5H<~)PxFcGu--fpdNTUHtgu`9d7YNsGTI)8tiAA;noc?Vt;K(9P4Xz;Nj4 z{;9WC0ddnZFh8&_n=qwIHK%O?;Qg 1 and time.time() < start + timeout: - - debug("waiting %s secs for single applauncherd" %sleep) time.sleep(sleep) - - pid = get_pid('applauncherd') + pid = get_pid('applauncherd', False) count = len(pid.split("\n")) if count == 1: break + debug("got single applauncherd pid %s in %.1fs" % (pid, time.time()-start)) return pid def get_booster_pid(timeout = 20): @@ -356,18 +355,17 @@ def get_groups_for_user(): return groups -def send_sighup_to_applauncherd(): - - #checks if there is a change in booster pids until 5 seconds - def wait_for_new_boosters(ref_pids): - boosterpids2 = ref_pids - for count in range(4): - boosterpids2 = get_pid('booster') - if(ref_pids != boosterpids2): +#checks if there is a change in booster pids until 5 seconds +def wait_for_new_boosters(old_booster_pids): + new_booster_pids = old_booster_pids + for count in range(4): + new_booster_pids = get_pid('booster') + if(old_booster_pids != new_booster_pids): break time.sleep(1) - return boosterpids2 + return new_booster_pids +def send_sighup_to_applauncherd(): wait_for_single_applauncherd() (e1, d1, q1, m1) = get_booster_pid() launcher_pid1 = get_oldest_pid('applauncherd') @@ -410,3 +408,11 @@ def wait_for_windows(windowName, minCount=1, timeout=20) : op = None return op + +def isPackageInstalled(packageName): + st, op = commands.getstatusoutput("dpkg -l %s" % packageName) + if(st == 0): # success, check if version is "" or a valid version + m = re.search('.*%s\s*(\S*)\s*.*'%packageName, op) + if(m and m.group(1).find("none")==-1): #m.group(1) contains version + return True + return False