Fixes: NB#217662 - applauncherd depends on WRT

Changes: Library preloading warnings not printed unless --debug is given.

RevBy: Jussi Lind
pull/1/head
Antti Kervinen 15 years ago
parent 89363301fa
commit 0d74c5c35d

@ -23,7 +23,7 @@ if (${QTVERSION} VERSION_LESS 4.6.0)
message(FATAL_ERROR "You need Qt4.6, found ${QTVERSION}.")
endif (${QTVERSION} VERSION_LESS 4.6.0)
# Find libmeegotouch for MBooster, WRTBooster and the test programs
# Find libmeegotouch for MBooster and the test programs
include(FindPkgConfig)
pkg_check_modules(MEEGOTOUCH meegotouch>=0.20 REQUIRED)
include_directories(${MEEGOTOUCH_INCLUDE_DIRS})

@ -76,7 +76,7 @@ binary by using -fvisibility=hidden and -fvisibility-inlines-hidden flags as wel
1.1 Build configuration for MeeGo Touch applications
Use these instructions if you are building a MeeGo Touch / WRT application.
Use these instructions if you are building a MeeGo Touch application.
In this case your application must build-depend on libmeegotouch-dev. It will
install the .pc file for pkg-config and the feature file for QMake.
@ -266,10 +266,10 @@ Rename appication binary to <application_name>.launch and replace the original
binary by a wrapper script that executes invoker with correct application type and
the name of the application binary as a parameter.
Use --type=m parameter for MeeGo Touch applications, --type=wrt for Web Runtime
applications and --type=qt for plain Qt applications and everything else (see
section 7). In these examples --type=m is used. Here is a launch script example
for a typical application:
Use --type=m parameter for MeeGo Touch applications and --type=qt for
plain Qt applications and everything else (see section 7). In these
examples --type=m is used. Here is a launch script example for a
typical application:
#!/bin/sh
echo "/usr/bin/invoker --type=m" $0.launch $@
@ -280,7 +280,7 @@ straightly in the .service-file without any wrapper scripts:
[D-BUS Service]
Name=com.nokia.<application_name>
Exec=/usr/bin/invoker --delay <seconds> --type=m /usr/bin/<application_name>.launch
Exec=/usr/bin/invoker --type=m /usr/bin/<application_name>.launch
Note: when launching through D-Bus, it is important to add enough delay to
invoker so that it won't exit before the launched application gets its D-Bus
@ -348,11 +348,6 @@ modification. Any MeeGo Touch boostable application can be launched
with this booster type as well, but it will result in a slower start
up because of empty cache in libmeegotouch.
Wrt booster, used with invoker --type=wrt, populates MComponentCache
with MApplication and MApplicationWindow, just like the MeeGo Touch
booster. However, in this case MApplication uses a graphics system
which suits better for rendering web content.
8. FURTHER READING

@ -2,5 +2,4 @@ usr/bin/applauncherd.bin
usr/lib/applauncherd/libapplauncherd.so
usr/bin/applauncherd
usr/lib/applauncherd/libmbooster.so
usr/lib/applauncherd/libwrtbooster.so
usr/lib/applauncherd/libqtbooster.so

@ -6,5 +6,4 @@ usr/share/applauncherd-tests/ut_connection
usr/share/applauncherd-tests/ut_mbooster
usr/share/applauncherd-tests/ut_qtbooster
usr/share/applauncherd-tests/ut_socketmanager
usr/share/applauncherd-tests/ut_wrtbooster

10
debian/changelog vendored

@ -1,4 +1,12 @@
applauncherd (0.16.0) unstable; urgency=low
applauncherd (0.16.1) unstable; urgency=low
* Changes: WRT Booster and related tests removed.
* Changes: Library preloading warnings are printed only if --debug commandline parameter is given.
* Fixes: NB#217662 - applauncherd depends on WRT
-- Antti Kervinen <antti.kervinen@nokia.com> Thu, 13 Jan 2011 12:00:00 +0200
applauncherd (0.16.0) stable; urgency=low
* Changes: Single instance test skeletons added

2
debian/control vendored

@ -2,7 +2,7 @@ Source: applauncherd
Section: admin
Priority: important
Maintainer: Jussi Lind <jussi.lind@nokia.com>
Build-Depends: cmake (>= 2.6.0), debhelper (>= 7), libqt4-dev (>= 4.5.0), libmeegotouch-dev, libcreds2-dev [arm armel], aegis-builder (>= 1.4) [arm armel], libwrt-dev, libxtst-dev, libxext-dev, libxi-dev
Build-Depends: cmake (>= 2.6.0), debhelper (>= 7), libqt4-dev (>= 4.5.0), libmeegotouch-dev, libcreds2-dev [arm armel], aegis-builder (>= 1.4) [arm armel], libxtst-dev, libxext-dev, libxi-dev
Standards-Version: 3.8.0
Package: applauncherd

@ -10,9 +10,6 @@ add_subdirectory(launcherlib)
# Sub build: mbooster plugin
add_subdirectory(mbooster)
# Sub build: wrtbooster plugin
add_subdirectory(wrtbooster)
# Sub build: qtbooster plugin
add_subdirectory(qtbooster)

@ -30,6 +30,5 @@ void invoke_send_str(int fd, char *str);
#define INVOKER_M_SOCK "/tmp/boostm"
#define INVOKER_QT_SOCK "/tmp/boostq"
#define INVOKER_WRT_SOCK "/tmp/boostw"
#endif

@ -58,9 +58,8 @@ static const unsigned char EXIT_STATUS_APPLICATION_NOT_FOUND = 0x7f;
// Enumeration of possible application types:
// M_APP : MeeGo Touch application
// QT_APP : Qt/generic application
// WRT_APP : Web runtime application
//
enum APP_TYPE { M_APP, QT_APP, WRT_APP, UNKNOWN_APP };
enum APP_TYPE { M_APP, QT_APP, UNKNOWN_APP };
// Environment
extern char ** environ;
@ -206,10 +205,6 @@ static int invoker_init(enum APP_TYPE app_type)
{
strncpy(sun.sun_path, INVOKER_QT_SOCK, maxSize);
}
else if (app_type == WRT_APP)
{
strncpy(sun.sun_path, INVOKER_WRT_SOCK, maxSize);
}
else
{
die(1, "Unknown type of application: %d\n", app_type);
@ -404,7 +399,6 @@ static void usage(int status)
"Possible values for TYPE: \n"
" m Launch a MeeGo Touch application.\n"
" qt Launch a Qt application.\n"
" wrt Launch a web runtime application.\n\n"
"Options:\n"
" -c, --creds Print Aegis security credentials (if enabled).\n"
" -d, --delay SECS After invoking sleep for SECS seconds (default %d).\n"
@ -629,8 +623,6 @@ int main(int argc, char *argv[])
app_type = M_APP;
else if (strcmp(optarg, "q") == 0 || strcmp(optarg, "qt") == 0)
app_type = QT_APP;
else if (strcmp(optarg, "w") == 0 || strcmp(optarg, "wrt") == 0)
app_type = WRT_APP;
else
{
report(report_error, "Unknown application type: %s \n", optarg);

@ -26,6 +26,8 @@
typedef int (*entry_t)(int, char **);
int g_debugPrinting;
//! Load libraries from the given array
static void loadLibraries(const char * const libs[], unsigned int numLibs)
{
@ -63,9 +65,9 @@ static void loadLibraries(const char * const libs[], unsigned int numLibs)
flags = RTLD_NOW | RTLD_GLOBAL;
}
// Open the library
// Open the library. Print possible errors only in debug mode.
dlerror();
if (!dlopen(lib + skipChar, flags))
if (!dlopen(lib + skipChar, flags) && g_debugPrinting)
{
fprintf(stderr, "Warning: can't preload %s\n", lib + skipChar);
}
@ -121,8 +123,17 @@ static int invokeLauncherLib(int argc, char ** argv)
//! Entry point
int main(int argc, char ** argv)
{
// Parse command line
g_debugPrinting = 0;
for (int i = 1; i < argc; ++i)
{
if (strcmp(argv[i], "--debug")) g_debugPrinting = 1;
}
// Preload libraries
loadLibraries(gLibs, sizeof(gLibs) / sizeof(char *));
// Start the real applauncherd.
if (!invokeLauncherLib(argc, argv))
{
fprintf(stderr, "FATAL!!: Failed to load the launcher library\n");
@ -131,4 +142,3 @@ int main(int argc, char ** argv)
return EXIT_SUCCESS;
}

@ -13,14 +13,6 @@ set(SRC appdata.cpp booster.cpp boosterfactory.cpp boosterpluginregistry.cpp
qt4_wrap_cpp(MOC_SRC ${MOC_HDRS})
# Use webruntime if found
# this is necessary for wrt booster to work efficiently
pkg_check_modules(WRT webruntime)
if(WRT_FOUND)
add_definitions(-DHAVE_WRT)
include_directories(${WRT_INCLUDE_DIRS})
endif(WRT_FOUND)
# Set libraries to be linked. Shared libraries to be preloaded are not linked in anymore,
# but dlopen():ed and listed in src/launcher/preload.h instead.
link_libraries(${LIBDL} )

@ -31,7 +31,7 @@ class BoosterFactory
{
public:
/*! \brief Creates a new booster.
* \param type Wanted booster type: 'q' = Qt, 'm' = MeeGo Touch, 'w' = WRT.
* \param type Wanted booster type: 'q' = Qt, 'm' = MeeGo Touch.
* \return Pointer to Booster on success, NULL if failed
*/
static Booster * create(char type);

@ -1,27 +0,0 @@
# Qt support
include(${QT_USE_FILE})
set(LAUNCHER "${CMAKE_HOME_DIRECTORY}/src/launcherlib")
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER})
# Hide all symbols except the ones explicitly exported in the code (like main())
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
# Set sources
set(SRC wrtbooster.cpp pluginfactory.cpp eventhandler.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp
${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp
${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp)
set(MOC_HDRS eventhandler.h)
qt4_wrap_cpp(MOC_SRC ${MOC_HDRS})
# Set libraries to be linked.
link_libraries(${MEEGOTOUCH_LIBRARIES} ${LIBDL} ${QT_QTCORE_LIBRARY})
# Set executable
add_library(wrtbooster MODULE ${SRC} ${MOC_SRC})
# Add install rule
install(FILES libwrtbooster.so DESTINATION /usr/lib/applauncherd/)

@ -1,118 +0,0 @@
#include "eventhandler.h"
#include "connection.h"
#include "logger.h"
#include "booster.h"
#include <sys/socket.h>
#include <QtConcurrentRun>
#include <MApplication>
int EventHandler::m_sighupFd[2];
struct sigaction EventHandler::m_oldSigAction;
EventHandler::EventHandler(Booster* parent) : m_item(0), m_parent(parent)
{
}
void EventHandler::runEventLoop()
{
// Exit from event loop when invoker is ready to connect
connect(this, SIGNAL(connectionAccepted()), MApplication::instance() , SLOT(quit()));
// Enable theme change handler
m_item = new MGConfItem(MEEGOTOUCH_THEME_GCONF_KEY, 0);
connect(m_item, SIGNAL(valueChanged()), this, SLOT(notifyThemeChange()));
// Start another thread to listen connection from invoker
QtConcurrent::run(this, &EventHandler::accept);
// Create socket pair for SIGHUP
bool handlerIsSet = false;
if (::socketpair(AF_UNIX, SOCK_STREAM, 0, m_sighupFd))
{
Logger::logError("EventHandler: Couldn't create HUP socketpair");
}
else
{
// Install signal handler e.g. to exit cleanly if launcher dies.
// This is a problem because MBooster runs a Qt event loop.
EventHandler::setupUnixSignalHandlers();
// Install a socket notifier on the socket
connect(new QSocketNotifier(m_sighupFd[1], QSocketNotifier::Read, this),
SIGNAL(activated(int)), this, SLOT(handleSigHup()));
handlerIsSet = true;
}
// Run event loop so MApplication and MApplicationWindow objects can receive notifications
MApplication::exec();
// Disable theme change handler
disconnect(m_item, 0, this, 0);
delete m_item;
m_item = NULL;
// Restore signal handlers to previous values
if (handlerIsSet)
{
restoreUnixSignalHandlers();
}
}
void EventHandler::accept()
{
if (m_parent->connection()->accept(m_parent->appData()))
{
emit connectionAccepted();
}
}
void EventHandler::notifyThemeChange()
{
MApplication::quit();
::_exit(EXIT_SUCCESS);
}
//
// All this signal handling code is taken from Qt's Best Practices:
// http://doc.qt.nokia.com/latest/unix-signals.html
//
void EventHandler::hupSignalHandler(int)
{
char a = 1;
::write(m_sighupFd[0], &a, sizeof(a));
}
void EventHandler::handleSigHup()
{
MApplication::quit();
::_exit(EXIT_SUCCESS);
}
bool EventHandler::setupUnixSignalHandlers()
{
struct sigaction hup;
hup.sa_handler = hupSignalHandler;
sigemptyset(&hup.sa_mask);
hup.sa_flags |= SA_RESTART;
if (sigaction(SIGHUP, &hup, &m_oldSigAction) > 0)
{
return false;
}
return true;
}
bool EventHandler::restoreUnixSignalHandlers()
{
if (sigaction(SIGHUP, &m_oldSigAction, 0) > 0)
{
return false;
}
return true;
}

@ -1,67 +0,0 @@
#include <QObject>
#include <MGConfItem>
#include <signal.h>
#include <tr1/memory>
#include <QSocketNotifier>
using std::tr1::shared_ptr;
class Connection;
class Booster;
class EventHandler : public QObject
{
Q_OBJECT
public:
//! \brief Constructor
EventHandler(Booster* parent);
//! \brief Destructor
virtual ~EventHandler() {}
void runEventLoop();
//! UNIX signal handler for SIGHUP
static void hupSignalHandler(int unused);
//! Setup UNIX signal handlers
static bool setupUnixSignalHandlers();
//! Restore UNIX signal handlers to previous values
static bool restoreUnixSignalHandlers();
private:
//! wait for socket connection
void accept();
//! Socket pair used to get SIGHUP
static int m_sighupFd[2];
//! Socket notifier used for m_sighupFd
shared_ptr<QSocketNotifier> m_snHup;
//! Old sigaction struct
static struct sigaction m_oldSigAction;
//! GConf item to listen theme change
MGConfItem* m_item;
// Parent object
Booster* m_parent;
private slots:
//! Qt signal handler for SIGHUP.
void handleSigHup();
//! Qt signal handler for theme change
void notifyThemeChange();
signals:
void connectionAccepted();
};

@ -1,45 +0,0 @@
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of applauncherd
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#include "wrtbooster.h"
#include <QtCore>
extern "C"
{
// Create a new plugin instance.
Q_DECL_EXPORT void * create()
{
return new WRTBooster;
}
Q_DECL_EXPORT char type()
{
return WRTBooster::type();
}
Q_DECL_EXPORT const char * socketName()
{
return WRTBooster::socketName().c_str();
}
Q_DECL_EXPORT const char * temporaryProcessName()
{
return WRTBooster::temporaryProcessName().c_str();
}
}

@ -1,109 +0,0 @@
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of applauncherd
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#include "wrtbooster.h"
#include "logger.h"
#include "connection.h"
#include <QtConcurrentRun>
#include <MApplication>
#include <sys/socket.h>
#ifdef HAVE_MCOMPONENTCACHE
#include <mcomponentcache.h>
#endif
#ifdef HAVE_WRT
#include <wrtcomponentcache.h>
#endif
const string WRTBooster::m_socketId = "/tmp/boostw";
const string WRTBooster::m_temporaryProcessName = "booster-w";
WRTBooster::WRTBooster()
{}
//
// All this signal handling code is taken from Qt's Best Practices:
// http://doc.qt.nokia.com/latest/unix-signals.html
//
const string & WRTBooster::socketId() const
{
return m_socketId;
}
bool WRTBooster::preload()
{
#ifdef HAVE_MCOMPONENTCACHE
MComponentCache::populateForWRTApplication();
#endif
#ifdef HAVE_WRT
WrtComponentCache::populateCache();
#endif
return true;
}
const string & WRTBooster::socketName()
{
return m_socketId;
}
const string & WRTBooster::temporaryProcessName()
{
return m_temporaryProcessName;
}
const string & WRTBooster::boosterTemporaryProcessName() const
{
return temporaryProcessName();
}
char WRTBooster::type()
{
return 'w';
}
bool WRTBooster::receiveDataFromInvoker(int socketFd)
{
// Setup the conversation channel with the invoker.
setConnection(new Connection(socketFd));
EventHandler handler(this);
handler.runEventLoop();
// Receive application data from the invoker
if(!connection()->receiveApplicationData(appData()))
{
connection()->close();
return false;
}
// Close the connection if exit status doesn't need
// to be sent back to invoker
if (!connection()->isReportAppExitStatusNeeded())
{
connection()->close();
}
return true;
}

@ -1,102 +0,0 @@
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of applauncherd
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef WRTBOOSTER_H
#define WRTBOOSTER_H
#include "booster.h"
#include "eventhandler.h"
#include <tr1/memory>
using std::tr1::shared_ptr;
#include <signal.h>
/*!
\class WRTBooster
\brief Booster for web runtime applications running on top of MeeGo Touch.
WRTBooster effectively fills MComponentCache with fresh objects
similarly to MBooster. However, the cache content is optimized for
web runtime's use.
*/
class WRTBooster : public Booster
{
public:
//! \brief Constructor
WRTBooster();
//! \brief Destructor
virtual ~WRTBooster() {};
//! \reimp
virtual bool preload();
/*!
* \brief Return the socket name common to all WRTBooster objects.
* \return Path to the socket file.
*/
static const string & socketName();
//! Return the process name to be used when booster is not
//! yet transformed into a running application
static const string & temporaryProcessName();
//! \reimp
virtual const string & boosterTemporaryProcessName() const;
//! \reimp
virtual char boosterType() const { return type(); }
/*!
* \brief Return a unique character ('d') represtenting the type of WRTBoosters.
* \return Type character.
*/
static char type();
//! \reimp
virtual const string & socketId() const;
protected:
//! \reimp
virtual bool receiveDataFromInvoker(int socketFd);
private:
//! Disable copy-constructor
WRTBooster(const WRTBooster & r);
//! Disable assignment operator
WRTBooster & operator= (const WRTBooster & r);
static const string m_socketId;
//! Process name to be used when booster is not
//! yet transformed into a running application
static const string m_temporaryProcessName;
#ifdef UNIT_TEST
friend class Ut_WRTBooster;
#endif
};
#endif // WRTBOOSTER_H

@ -5,7 +5,6 @@ add_subdirectory(ut_daemon)
add_subdirectory(ut_mbooster)
add_subdirectory(ut_qtbooster)
add_subdirectory(ut_socketmanager)
add_subdirectory(ut_wrtbooster)
install(FILES tests.xml DESTINATION /usr/share/applauncherd-tests)

@ -46,10 +46,6 @@
<step expected_result="0">/usr/share/applauncherd-tests/ut_qtbooster</step>
</case>
<case name="WRTBooster" type="Functional" description="Unit tests for WRTBooster class" level="Component" timeout="20">
<step expected_result="0">source /tmp/session_bus_address.user &amp;&amp; DISPLAY=:0 /usr/share/applauncherd-tests/ut_wrtbooster</step>
</case>
<environments>
<scratchbox>true</scratchbox>
<hardware>true</hardware>

@ -1,30 +0,0 @@
set(LAUNCHER ${CMAKE_HOME_DIRECTORY}/src/launcherlib)
set(WRTBOOSTER ${CMAKE_HOME_DIRECTORY}/src/wrtbooster)
# Set sources
set(SRC ut_wrtbooster.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp
${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp ${WRTBOOSTER}/wrtbooster.cpp ${WRTBOOSTER}/eventhandler.cpp
${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp)
# Set moc headers
set(MOC_HDRS ut_wrtbooster.h ${WRTBOOSTER}/eventhandler.h)
# Run moc
qt4_wrap_cpp(MOC_SRC ${MOC_HDRS})
# Enable test library
set(QT_USE_QTTEST TRUE)
# Set include paths
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${WRTBOOSTER})
link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${LIBCREDS})
# Enable Qt (may not be needed, because already defined on higher level)
include(${QT_USE_FILE})
add_executable(ut_wrtbooster ${SRC} ${MOC_SRC} )
# Install
install(PROGRAMS ut_wrtbooster DESTINATION /usr/share/applauncherd-tests/)

@ -1,67 +0,0 @@
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of applauncherd
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#include "ut_wrtbooster.h"
#include "wrtbooster.h"
#ifdef HAVE_MCOMPONENTCACHE
#include <MComponentCache>
#endif
Ut_WRTBooster::Ut_WRTBooster() :
m_subject(new WRTBooster)
{}
Ut_WRTBooster::~Ut_WRTBooster()
{}
void Ut_WRTBooster::initTestCase()
{}
void Ut_WRTBooster::cleanupTestCase()
{}
void Ut_WRTBooster::testSocketName()
{
QVERIFY(WRTBooster::socketName() == WRTBooster::m_socketId);
QVERIFY(m_subject->socketId() == WRTBooster::m_socketId);
}
void Ut_WRTBooster::testType()
{
QVERIFY(WRTBooster::type() == 'w');
QVERIFY(m_subject->boosterType() == 'w');
}
void Ut_WRTBooster::testPreload()
{
#ifdef HAVE_MCOMPONENTCACHE
m_subject->preload();
const char * argv[] = {"foo"};
int argc = 1;
QVERIFY(MComponentCache::mApplication(argc, const_cast<char **>(argv)));
QVERIFY(MComponentCache::mApplicationWindow());
#endif
}
QTEST_APPLESS_MAIN(Ut_WRTBooster);

@ -1,51 +0,0 @@
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of applauncherd
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef UT_WRTBOOSTER_H
#define UT_WRTBOOSTER_H
#include<QtTest/QtTest>
#include<QObject>
#include <tr1/memory>
#define UNIT_TEST
class WRTBooster;
class Ut_WRTBooster : public QObject
{
Q_OBJECT
public:
Ut_WRTBooster();
virtual ~Ut_WRTBooster();
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void testSocketName();
void testType();
void testPreload();
private:
std::tr1::shared_ptr<WRTBooster> m_subject;
};
#endif // UT_WRTBOOSTER_H

@ -1,3 +1,3 @@
install(PROGRAMS fala_sf_m.sh fala_sf_wrt.sh fala_sf_qt.sh DESTINATION /usr/share/applauncherd-testscripts/signal-forward)
install(PROGRAMS fala_sf_m.py fala_sf_wrt.py fala_sf_qt.py DESTINATION /usr/share/applauncherd-testscripts/signal-forward)
install(PROGRAMS fala_sf_m.sh fala_sf_qt.sh DESTINATION /usr/share/applauncherd-testscripts/signal-forward)
install(PROGRAMS fala_sf_m.py fala_sf_qt.py DESTINATION /usr/share/applauncherd-testscripts/signal-forward)

@ -1,15 +0,0 @@
#!/usr/bin/env python
import os
import time
import commands
#Launching application from the script
os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_wrt.sh &")
time.sleep(2)
st, op = commands.getstatusoutput("pgrep fala_ft_hello")
#Killing application with a signal 11 (Segmentation Fault)
commands.getoutput("kill -10 %s" %op)
time.sleep(2)

@ -1,3 +0,0 @@
#!/bin/sh
invoker --type=wrt --wait-term /usr/bin/fala_ft_hello.launch

@ -38,12 +38,12 @@ graphics:
* take screenshot of themed widgets (2)
* verify that (1) and (2) are equal
Testing that booster-m and booster-w are restarted after theme change
Testing that booster-m is restarted after theme change
* get the pids of booster-m and booster-w (1)
* get the pid of booster-m (1)
* launch application
* change theme
* Again get the new pids of booster-m and booster-w (2)
* Again get the new pid of booster-m (2)
* Make sure 1 and 2 differ.
"""
@ -178,9 +178,7 @@ class TC_Theming < Test::Unit::TestCase
def test_theme_change_booster_restart
m_pid = `pgrep -n booster-m`
w_pid = `pgrep -n booster-w`
print "Current booster-m %s" % m_pid
print "Current booster-w %s" % w_pid
app_name = 'fala_ft_hello'
system("pkill #{app_name}")
@ -196,18 +194,13 @@ class TC_Theming < Test::Unit::TestCase
sleep(6)
new_mpid = `pgrep -n booster-m`
new_wpid = `pgrep -n booster-w`
system("pkill #{app_name}")
print "New booster-m %s" % new_mpid
print "New booster-w %s" % new_wpid
verify_true(2,"The booster-m was not restarted"){
m_pid != new_mpid}
verify_true(2,"The booster-w was not restarted"){
w_pid != new_wpid}
end
end

@ -457,15 +457,6 @@ class launcher_tests (unittest.TestCase):
self.assert_(op.split('\n')[-1] == 'Aborted (core dumped)', "The invoker(q-booster) was not killed by the same signal")
time.sleep(2)
#Test for w-booster
debug("Test for w-booster")
st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_wrt.py")
debug("The Invoker killed by : %s" %op)
self.assert_(op == 'User defined signal 1', "The invoker(w-booster) was not killed by the same signal")
time.sleep(2)
def test_launch_wo_applauncherd(self):
"""
To Test that invoker can launch applications even when the
@ -529,10 +520,6 @@ class launcher_tests (unittest.TestCase):
self.assert_(len(mpid.split("\n")) == 1, "multiple instances of booster-m running")
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
self.assert_(len(wpid.split("\n")) == 1, "multiple instances of booster-w running")
self.assert_(wpid != None, "No booster process running")
#stop applauncherd
stop_applauncherd()
@ -548,9 +535,6 @@ class launcher_tests (unittest.TestCase):
mpid_new = get_pid('booster-m')
self.assert_(mpid_new == None, "booster-m still running")
wpid_new = get_pid('booster-w')
self.assert_(wpid_new == None, "booster-w still running")
#Now start the applauncherd
start_applauncherd()
@ -567,10 +551,6 @@ class launcher_tests (unittest.TestCase):
self.assert_(len(mpid.split("\n")) == 1, "multiple instances of booster-m running")
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
self.assert_(len(wpid.split("\n")) == 1, "multiple instances of booster-w running")
self.assert_(wpid != None, "No booster process running")
#Now kill applauncherd
debug("Now kill applauncherd")
kill_process('applauncherd')
@ -590,11 +570,6 @@ class launcher_tests (unittest.TestCase):
self.assert_(mpid_new != None, "No booster process running")
self.assert_(mpid_new != mpid, "booster process was not killed")
wpid_new = get_pid('booster-w')
self.assert_(len(wpid_new.split("\n")) == 1, "multiple instances of booster-w running")
self.assert_(wpid_new != None, "No booster process running")
self.assert_(wpid_new != wpid, "booster process was not killed")
def test_invoker_param_creds(self):
p = run_app_as_user('invoker --creds')
self.assert_(p.wait() == 0, "'invoker --creds' failed")
@ -652,19 +627,6 @@ class launcher_tests (unittest.TestCase):
self.assert_(qpid_new != None, "No booster process running")
self.assert_(qpid_new != qpid, "booster-q process did not receive the new pid")
kill_process('fala_ft_hello')
#Launching application with booster-w
wpid = get_pid('booster-w')
p = run_app_as_user('invoker --type=wrt --no-wait fala_ft_hello.launch')
time.sleep(4)
app_pid = get_pid('fala_ft_hello')
wpid_new = get_pid('booster-w')
self.assert_(app_pid != None, "Application is not running")
self.assert_(app_pid == wpid, "Application is not assigned the booster-w pid")
self.assert_(wpid_new != None, "No booster process running")
self.assert_(wpid_new != wpid, "booster-w process did not receive the new pid")
kill_process('fala_ft_hello')
def test_stress_boosted_apps(self):
"""
@ -723,20 +685,6 @@ class launcher_tests (unittest.TestCase):
self.assert_(op1.split(",")[0] == '"fala_wl.launch"','Application name is incorrect')
kill_process('fala_wl')
#For booster-w
#Check though the process list
p = run_app_as_user('invoker --type=wrt --no-wait fala_wl.launch -faulty')
time.sleep(2)
pid = get_pid('fala_wl')
st, op = commands.getstatusoutput('cat /proc/%s/cmdline' %pid)
self.assert_(op.split('0')[0] == "fala_wl.launch",'Application name is incorrect')
#check through the window property
st, op = commands.getstatusoutput("xwininfo -root -tree| awk '/Applauncherd testapp/ {print $1}'")
st, op1 = commands.getstatusoutput("xprop -id %s | awk '/WM_COMMAND/{print $4}'" %op)
self.assert_(op1.split(",")[0] == '"fala_wl.launch"','Application name is incorrect')
kill_process('fala_wl')
def test_oom_adj(self):
"""
Test that oom.adj is 0 for launched application process

@ -138,21 +138,6 @@ class launcher_perf_tests (unittest.TestCase):
self.kill_process(appname)
return app_time
def run_with_wrt_launcher(self, appname):
"""starts the testapp with wrt-launcher and with duihome"""
os.system ('mcetool --set-tklock-mode=unlocked')
if os.path.exists(LOG_FILE) and os.path.isfile(LOG_FILE):
os.system('rm %s' %LOG_FILE)
self.start_timer()
os.system('invoker --type=wrt --no-wait %s' %TESTAPP)
debug("app", TESTAPP, "started with wrt-launcher")
time.sleep(5)
self.read_log()
app_time = self.app_start_time()
self.kill_process(appname)
return app_time
def run_with_launcher_without_duihome(self, appname):
"""starts the testapp with launcher but without duihome"""
os.system ('mcetool --set-tklock-mode=unlocked')
@ -202,13 +187,6 @@ class launcher_perf_tests (unittest.TestCase):
return with_l_with_d, with_l_no_d
def perftest_with_wrt_launcher(self, appname):
debug("run app with wrt-launcher with duihome")
wrt_l_with_dld = self.run_with_wrt_launcher(appname)
time.sleep(5)
return wrt_l_with_dld
def perftest_without_launcher(self, appname):
"""Runs all the 4 scenarios with and without launcher"""
debug("run app without launcher with duihome")
@ -238,25 +216,24 @@ class launcher_perf_tests (unittest.TestCase):
if with_without_times == []: return
writeline("")
rowformat = "%12s %12s %12s %12s %12s"
rowformat = "%12s %12s %12s %12s"
writeline('Startup times [s]:')
writeline(rowformat % ('launcher-Yes', 'launcher-Yes', 'launcher-No', 'launcher-No', 'wrtlauncher-Yes'))
writeline(rowformat % ('duihome-Yes', 'duihome-No', 'duihome-Yes', 'duihome-No', 'duihome-Yes'))
writeline(rowformat % ('launcher-Yes', 'launcher-Yes', 'launcher-No', 'launcher-No'))
writeline(rowformat % ('duihome-Yes', 'duihome-No', 'duihome-Yes', 'duihome-No'))
t1,t2,t3,t4,t5 = [], [], [], [], []
for no_l_with_d, no_l_no_d, with_l_with_d, with_l_no_d, wrt_l_with_d in with_without_times:
t1,t2,t3,t4 = [], [], [], []
for no_l_with_d, no_l_no_d, with_l_with_d, with_l_no_d in with_without_times:
t1.append(no_l_with_d)
t2.append(no_l_no_d)
t3.append(with_l_with_d)
t4.append(with_l_no_d)
t5.append(wrt_l_with_d)
writeline(rowformat % (fmtfloat(no_l_with_d), fmtfloat(no_l_no_d),
fmtfloat(with_l_with_d), fmtfloat(with_l_no_d), fmtfloat(wrt_l_with_d)))
fmtfloat(with_l_with_d), fmtfloat(with_l_no_d)))
writeline('Average times:')
writeline(rowformat % (fmtfloat(sum(t1)/len(t1)), fmtfloat(sum(t2)/len(t2)),
fmtfloat(sum(t3)/len(t3)), fmtfloat(sum(t4)/len(t4)), fmtfloat(sum(t5)/len(t5))))
fmtfloat(sum(t3)/len(t3)), fmtfloat(sum(t4)/len(t4))))
return fmtfloat(sum(t1)/len(t1))
def test_001(self):
@ -266,7 +243,7 @@ class launcher_perf_tests (unittest.TestCase):
times = []
times1, times2, times3 = [], [], []
times1, times2 = [], [], []
for i in xrange(3):
times1.append(self.perftest_with_launcher(TESTAPP))
@ -274,10 +251,7 @@ class launcher_perf_tests (unittest.TestCase):
for i in xrange(3):
times2.append(self.perftest_without_launcher(TESTAPP))
for i in xrange(3):
times3.append(self.perftest_with_wrt_launcher(TESTAPP))
times = [[t1[0], t1[1], times2[i][0], times2[i][1], times3[i]] for i, t1 in enumerate(times1)]
times = [[t1[0], t1[1], times2[i][0], times2[i][1]] for i, t1 in enumerate(times1)]
avg_with_launcher = self.print_test_report(times, sys.stdout)
self.assert_(float(avg_with_launcher) < float(0.75), "application launched with launcher takes more than 0.75 sec")

@ -1,3 +1,3 @@
install(PROGRAMS fala_sf_m.sh fala_sf_wrt.sh fala_sf_qt.sh DESTINATION /usr/share/applauncherd-M-testscripts/signal-forward)
install(PROGRAMS fala_sf_m.py fala_sf_wrt.py fala_sf_qt.py DESTINATION /usr/share/applauncherd-M-testscripts/signal-forward)
install(PROGRAMS fala_sf_m.sh fala_sf_qt.sh DESTINATION /usr/share/applauncherd-M-testscripts/signal-forward)
install(PROGRAMS fala_sf_m.py fala_sf_qt.py DESTINATION /usr/share/applauncherd-M-testscripts/signal-forward)

@ -1,15 +0,0 @@
#!/usr/bin/env python
import os
import time
import commands
#Launching application from the script
os.system("/usr/share/applauncherd-M-testscripts/signal-forward/fala_sf_wrt.sh &")
time.sleep(2)
st, op = commands.getstatusoutput("pgrep fala_ft_hello")
#Killing application with a signal 11 (Segmentation Fault)
commands.getoutput("kill -10 %s" %op)
time.sleep(2)

@ -1,3 +0,0 @@
#!/bin/sh
invoker --type=wrt --wait-term /usr/bin/fala_ft_hello.launch

@ -38,12 +38,12 @@ graphics:
* take screenshot of themed widgets (2)
* verify that (1) and (2) are equal
Testing that booster-m and booster-w are restarted after theme change
Testing that booster-m is restarted after theme change
* get the pids of booster-m and booster-w (1)
* get the pid of booster-m (1)
* launch application
* change theme
* Again get the new pids of booster-m and booster-w (2)
* Again get the new pids of booster-m (2)
* Make sure 1 and 2 differ.
"""
@ -178,9 +178,7 @@ class TC_Theming < Test::Unit::TestCase
def test_booster_killer
m_pid = `pgrep -n booster-m`
w_pid = `pgrep -n booster-w`
print "Current booster-m %s" % m_pid
print "Current booster-w %s" % w_pid
app_name = 'fala_ft_hello'
system("pkill #{app_name}")
@ -196,18 +194,13 @@ class TC_Theming < Test::Unit::TestCase
sleep(6)
new_mpid = `pgrep -n booster-m`
new_wpid = `pgrep -n booster-w`
system("pkill #{app_name}")
print "New booster-m %s" % new_mpid
print "New booster-w %s" % new_wpid
verify_true(2,"The booster-m was not restarted"){
m_pid != new_mpid}
verify_true(2,"The booster-w was not restarted"){
w_pid != new_wpid}
end
end

@ -461,14 +461,6 @@ class launcher_tests (unittest.TestCase):
self.assert_(op.split('\n')[-1] == 'Aborted (core dumped)', "The invoker(q-booster) was not killed by the same signal")
time.sleep(2)
#Test for w-booster
st, op = commands.getstatusoutput("/usr/share/applauncherd-M-testscripts/signal-forward/fala_sf_wrt.py")
print ("The Invoker killed by : %s" %op)
self.assert_(op == 'User defined signal 1', "The invoker(w-booster) was not killed by the same signal")
time.sleep(2)
def test_020_launch_wo_applauncherd(self):
"""
To Test that invoker can launch applications even when the
@ -542,10 +534,6 @@ class launcher_tests (unittest.TestCase):
print "Pid of booster-m before killing :%s" %mpid
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
print "Pid of booster-w before killing :%s" %mpid
self.assert_(wpid != None, "No booster process running")
#stop applauncherd
os.system("initctl stop xsession/applauncherd")
@ -557,15 +545,10 @@ class launcher_tests (unittest.TestCase):
print "Pid of booster-q after killing :%s" %qpid_new
self.assert_(qpid_new == None, "booster-q still running")
mpid_new = get_pid('booster-m')
print "Pid of booster-m after killing :%s" %mpid_new
self.assert_(mpid_new == None, "booster-m still running")
wpid_new = get_pid('booster-w')
print "Pid of booster-w after killing :%s" %wpid_new
self.assert_(wpid_new == None, "booster-w still running")
#Now start the applauncherd
os.system("initctl start xsession/applauncherd")
@ -581,10 +564,6 @@ class launcher_tests (unittest.TestCase):
print "Pid of booster-m before killing :%s" %mpid
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
print "Pid of booster-w before killing :%s" %mpid
self.assert_(wpid != None, "No booster process running")
#Now kill applauncherd
kill_process('applauncherd')
@ -601,12 +580,6 @@ class launcher_tests (unittest.TestCase):
print "Pid of booster-m after killing :%s" %mpid_new
self.assert_(mpid_new != None, "No booster process running")
self.assert_(mpid_new != mpid, "booster process was not killed")
wpid_new = get_pid('booster-w')
print "Pid of booster-w after killing :%s" %wpid_new
self.assert_(wpid_new != None, "No booster process running")
self.assert_(wpid_new != wpid, "booster process was not killed")
# main
if __name__ == '__main__':

@ -138,21 +138,6 @@ class launcher_perf_tests (unittest.TestCase):
self.kill_process(appname)
return app_time
def run_with_wrt_launcher(self, appname):
"""starts the testapp with wrt-launcher and with duihome"""
os.system ('mcetool --set-tklock-mode=unlocked')
if os.path.exists(LOG_FILE) and os.path.isfile(LOG_FILE):
os.system('rm %s' %LOG_FILE)
self.start_timer()
os.system('invoker --type=wrt --no-wait %s' %TESTAPP)
debug("app", TESTAPP, "started with wrt-launcher")
time.sleep(5)
self.read_log()
app_time = self.app_start_time()
self.kill_process(appname)
return app_time
def run_with_launcher_without_duihome(self, appname):
"""starts the testapp with launcher but without duihome"""
os.system ('mcetool --set-tklock-mode=unlocked')
@ -202,13 +187,6 @@ class launcher_perf_tests (unittest.TestCase):
return with_l_with_d, with_l_no_d
def perftest_with_wrt_launcher(self, appname):
debug("run app with wrt-launcher with duihome")
wrt_l_with_dld = self.run_with_wrt_launcher(appname)
time.sleep(5)
return wrt_l_with_dld
def perftest_without_launcher(self, appname):
"""Runs all the 4 scenarios with and without launcher"""
debug("run app without launcher with duihome")
@ -238,25 +216,24 @@ class launcher_perf_tests (unittest.TestCase):
if with_without_times == []: return
writeline("")
rowformat = "%12s %12s %12s %12s %12s"
rowformat = "%12s %12s %12s %12s"
writeline('Startup times [s]:')
writeline(rowformat % ('launcher-Yes', 'launcher-Yes', 'launcher-No', 'launcher-No', 'wrtlauncher-Yes'))
writeline(rowformat % ('duihome-Yes', 'duihome-No', 'duihome-Yes', 'duihome-No', 'duihome-Yes'))
writeline(rowformat % ('launcher-Yes', 'launcher-Yes', 'launcher-No', 'launcher-No'))
writeline(rowformat % ('duihome-Yes', 'duihome-No', 'duihome-Yes', 'duihome-No'))
t1,t2,t3,t4,t5 = [], [], [], [], []
for no_l_with_d, no_l_no_d, with_l_with_d, with_l_no_d, wrt_l_with_d in with_without_times:
t1,t2,t3,t4 = [], [], [], []
for no_l_with_d, no_l_no_d, with_l_with_d, with_l_no_d in with_without_times:
t1.append(no_l_with_d)
t2.append(no_l_no_d)
t3.append(with_l_with_d)
t4.append(with_l_no_d)
t5.append(wrt_l_with_d)
writeline(rowformat % (fmtfloat(no_l_with_d), fmtfloat(no_l_no_d),
fmtfloat(with_l_with_d), fmtfloat(with_l_no_d), fmtfloat(wrt_l_with_d)))
fmtfloat(with_l_with_d), fmtfloat(with_l_no_d)))
writeline('Average times:')
writeline(rowformat % (fmtfloat(sum(t1)/len(t1)), fmtfloat(sum(t2)/len(t2)),
fmtfloat(sum(t3)/len(t3)), fmtfloat(sum(t4)/len(t4)), fmtfloat(sum(t5)/len(t5))))
fmtfloat(sum(t3)/len(t3)), fmtfloat(sum(t4)/len(t4))))
return fmtfloat(sum(t1)/len(t1))
def test_001(self):
@ -266,7 +243,7 @@ class launcher_perf_tests (unittest.TestCase):
times = []
times1, times2, times3 = [], [], []
times1, times2 = [], []
for i in xrange(3):
times1.append(self.perftest_with_launcher(TESTAPP))
@ -274,10 +251,7 @@ class launcher_perf_tests (unittest.TestCase):
for i in xrange(3):
times2.append(self.perftest_without_launcher(TESTAPP))
for i in xrange(3):
times3.append(self.perftest_with_wrt_launcher(TESTAPP))
times = [[t1[0], t1[1], times2[i][0], times2[i][1], times3[i]] for i, t1 in enumerate(times1)]
times = [[t1[0], t1[1], times2[i][0], times2[i][1]] for i, t1 in enumerate(times1)]
avg_with_launcher = self.print_test_report(times, sys.stdout)
self.assert_(float(avg_with_launcher) < float(0.75), "application launched with launcher takes more than 0.75 sec")

Loading…
Cancel
Save