Skip to content

Commit

Permalink
[sandbox] Drop old sandbox code to allow Qt5 build, breaking testcase…
Browse files Browse the repository at this point in the history
…s for now
  • Loading branch information
Bernd Wachter committed May 23, 2013
1 parent ed80440 commit 1cf47e0
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 46 deletions.
2 changes: 0 additions & 2 deletions libssu/libssu.pro
Expand Up @@ -12,14 +12,12 @@ public_headers = \

HEADERS = \
$${public_headers} \
sandbox_p.h \
ssucoreconfig.h \
mobility-booty/qofonoservice_linux_p.h \
mobility-booty/qsysteminfo_linux_common_p.h \
mobility-booty/qsysteminfo_dbus_p.h

SOURCES = \
sandbox.cpp \
ssu.cpp \
ssucoreconfig.cpp \
ssudeviceinfo.cpp \
Expand Down
1 change: 1 addition & 0 deletions libssu/ssu.cpp
Expand Up @@ -208,6 +208,7 @@ void Ssu::requestFinished(QNetworkReply *reply){
}
#endif

/// @TODO: indicate that the device is not registered if there's a 404 on credentials update url
// what sucks more, this or goto?
do {
if (settings->contains("home-url")){
Expand Down
26 changes: 6 additions & 20 deletions rpm/ssu.spec
Expand Up @@ -7,13 +7,11 @@ License: GPLv2
Source0: %{name}-%{version}.tar.gz
URL: https://github.com/nemomobile/ssu
BuildRequires: pkgconfig(boardname)
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(QtDBus)
BuildRequires: pkgconfig(QtDeclarative)
BuildRequires: pkgconfig(QtNetwork)
BuildRequires: pkgconfig(QtXml)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(libzypp)
BuildRequires: pkgconfig(qt-boostable)
BuildRequires: pkgconfig(libsystemd-journal)
BuildRequires: oneshot
BuildRequires: doxygen
Expand All @@ -40,6 +38,7 @@ Requires: ssu-vendor-data
%package vendor-data-example
Summary: Sample vendor configuration data
Group: System/Base
Provides: ssu-vendor-data

%description vendor-data-example
%{summary}. A vendor (including Nemo) is supposed to put those configuration on device.
Expand All @@ -65,19 +64,6 @@ Provides: rpm-macros
%{_bindir}/ssuks


%package rnd-ui
Summary: Shiny user interface for %{name}
Group: System/Base

%description rnd-ui
%{summary}. With ponies!

%files rnd-ui
%defattr(-,root,root,-)
%{_bindir}/rndregisterui
%{_datadir}/applications/*.desktop


%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Expand Down Expand Up @@ -136,7 +122,7 @@ Group: Documentation

%build
mkdir -p build && cd build
qmake DEFINES+='TARGET_ARCH=\\\"\"%{_target_cpu}\"\\\"' -recursive ..
qmake -qt=5 DEFINES+='TARGET_ARCH=\\\"\"%{_target_cpu}\"\\\"' -recursive ..
make %{?_smp_mflags}
cd .. && doxygen doc/Doxyfile

Expand Down
4 changes: 2 additions & 2 deletions ssuks/ssukickstarter.cpp
Expand Up @@ -21,8 +21,8 @@
*/


SsuKickstarter::SsuKickstarter(QString sandbox) {
pathPrefix = sandbox;
SsuKickstarter::SsuKickstarter() {
pathPrefix = SsuSettings::sandboxPrefix();

SsuDeviceInfo deviceInfo;
deviceModel = deviceInfo.deviceModel();
Expand Down
2 changes: 1 addition & 1 deletion ssuks/ssukickstarter.h
Expand Up @@ -21,7 +21,7 @@ class Q_CORE_EXPORT SsuKickstarter: public QObject {
*/
class SsuKickstarter {
public:
SsuKickstarter(QString sandbox="");
SsuKickstarter();
void setRepoParameters(QHash<QString, QString> parameters);
bool write(QString kickstart="");

Expand Down
19 changes: 5 additions & 14 deletions ssuks/ssuks.cpp
Expand Up @@ -15,7 +15,6 @@

#include "ssukickstarter.h"
#include "constants.h"
#include "libssu/sandbox_p.h"

#include "ssuks.h"

Expand Down Expand Up @@ -44,13 +43,14 @@ void SsuKs::run(){
}

QString sandbox;
Sandbox *sb;
if (repoParameters.contains("sandbox")){
setenv("SSU_SANDBOX_DIR", repoParameters.value("sandbox").toLatin1(), 1);
sandbox = repoParameters.value("sandbox");
repoParameters.remove("sandbox");
}


// work around sandbox not sandboxing directories
sandbox = SsuSettings::sandboxPrefix();
if (!sandbox.isEmpty()){
QDirIterator it(SSU_DATA_DIR, QDir::AllEntries|QDir::NoDot|QDir::NoDotDot, QDirIterator::Subdirectories);
while (it.hasNext()){
it.next();
Expand All @@ -72,18 +72,9 @@ void SsuKs::run(){
QString("%1/%2")
.arg(sandbox)
.arg(SSU_BOARD_MAPPING_CONFIGURATION_DIR));

sb = new Sandbox(sandbox, Sandbox::UseDirectly, Sandbox::ThisProcess);

if (sb->activate())
qout << "Using sandbox at " << sandbox << endl;
else {
qout << "Failed to activate sandbox" << endl;
return;
}
}

SsuKickstarter kickstarter(sandbox);
SsuKickstarter kickstarter;
kickstarter.setRepoParameters(repoParameters);
kickstarter.write(fileName);
} else
Expand Down
1 change: 0 additions & 1 deletion tests/tests.pro
Expand Up @@ -7,7 +7,6 @@ SUBDIRS = \
ut_deviceinfo \
ut_repomanager \
ut_rndssucli \
ut_sandbox \
ut_settings \
ut_ssuurlresolver \
ut_urlresolver \
Expand Down
3 changes: 2 additions & 1 deletion tests/ut_coreconfig/main.cpp
Expand Up @@ -7,15 +7,16 @@

#include <QtTest/QtTest>

#include "libssu/sandbox_p.h"
#include "coreconfigtest.h"

int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/

CoreconfigTest coreconfigTest;

Expand Down
3 changes: 2 additions & 1 deletion tests/ut_deviceinfo/main.cpp
Expand Up @@ -7,15 +7,16 @@

#include <QtTest/QtTest>

#include "libssu/sandbox_p.h"
#include "deviceinfotest.h"

int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/

DeviceInfoTest deviceinfoTest;

Expand Down
3 changes: 2 additions & 1 deletion tests/ut_repomanager/main.cpp
Expand Up @@ -7,15 +7,16 @@

#include <QtTest/QtTest>

#include "libssu/sandbox_p.h"
#include "repomanagertest.h"

int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/

RepoManagerTest repomanagerTest;

Expand Down
5 changes: 4 additions & 1 deletion tests/ut_rndssucli/rndssuclitest.cpp
Expand Up @@ -12,12 +12,12 @@

#include <QtTest/QtTest>

#include "libssu/sandbox_p.h"
#include "testutils/process.h"

typedef QStringList Args; // improve readability

void RndSsuCliTest::init(){
/*
Q_ASSERT(m_sandbox == 0);
m_sandbox = new Sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Expand All @@ -26,11 +26,14 @@ void RndSsuCliTest::init(){
QFAIL("Failed to activate sandbox");
}
setenv("LD_PRELOAD", qPrintable(QString("%1/libsandboxhook.so").arg(TESTS_PATH)), 1);
*/
}

void RndSsuCliTest::cleanup(){
/*
delete m_sandbox;
m_sandbox = 0;
*/
}

void RndSsuCliTest::testSubcommandFlavour(){
Expand Down
2 changes: 1 addition & 1 deletion tests/ut_settings/upgradetesthelper.cpp
Expand Up @@ -136,7 +136,7 @@ void UpgradeTestHelper::fillDefaultSettings(QSettings *defaultSettings, const QL
defaultSettings->beginGroup(group);

foreach (const TestCase &testCase, testCases){
switch (testCase.history().at(revision - 1).toAscii()){
switch (testCase.history().at(revision - 1).toLatin1()){
case 'S': // (S)et value
lastSetValue[testCase.key()] = QString("v%1-default").arg(revision);
defaultSettings->setValue(testCase.key(), lastSetValue[testCase.key()]);
Expand Down
3 changes: 2 additions & 1 deletion tests/ut_urlresolver/main.cpp
Expand Up @@ -7,15 +7,16 @@

#include <QtTest/QtTest>

#include "libssu/sandbox_p.h"
#include "urlresolvertest.cpp"

int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/

UrlResolverTest urlResolverTest;

Expand Down

0 comments on commit 1cf47e0

Please sign in to comment.