Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb38303' into 'master'
Extract libsandboxhook.so from tests package and fix documentation a little

See merge request !11
  • Loading branch information
pvuorela committed Aug 14, 2017
2 parents fddd582 + e16cd29 commit e5b748c
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 14 deletions.
8 changes: 5 additions & 3 deletions libssu/ssudeviceinfo.h
Expand Up @@ -41,13 +41,15 @@ class SsuDeviceInfo: public QObject
* Check if a given model is available in the deviceinfo database, either directly,
* or as variant. If no model is provided as argument the autodetected or previously
* set model is used.
*
* @attention This function temporarily changes the detected model, and
* therefore should not be used in a multithreaded environment, unless you
* like funny results.
*/
bool contains(const QString &model = QString());

/**
* Try to find the device family for the system this is running on. This function
* temporarily changes the detected model, and therefore should not be used in a
* multithreaded environment, unless you like funny results.
* Try to find the device family for the system this is running on.
*/
Q_INVOKABLE QString deviceFamily();

Expand Down
1 change: 1 addition & 0 deletions rpm/ssu.spec
Expand Up @@ -31,6 +31,7 @@ Requires: ssu-network-proxy
%{_libdir}/zypp/plugins/urlresolver/*
%{_bindir}/ssu
%{_libdir}/libssu.so.*
%{_libdir}/ssu/libsandboxhook.so
%dir %{_sysconfdir}/zypp/credentials.d
# ssu itself does not use the package-update triggers, but provides
# them for the vendor data packages to use
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions sandboxhook/sandboxhook.pri
@@ -0,0 +1,2 @@
SSU_SANDBOX_PATH = /usr/lib/ssu/libsandboxhook.so
DEFINES += SSU_SANDBOX_PATH="'\"$${SSU_SANDBOX_PATH}\"'"
14 changes: 14 additions & 0 deletions sandboxhook/sandboxhook.pro
@@ -0,0 +1,14 @@
include(../ssu_common.pri)
include(sandboxhook_dependencies.pri)

TEMPLATE = lib
TARGET = sandboxhook

CONFIG += unversioned_libname

SOURCES = sandboxhook.cpp

DESTDIR = $$DESTDIR_LIB

target.path = /usr/lib/ssu
INSTALLS += target
1 change: 1 addition & 0 deletions sandboxhook/sandboxhook_dependencies.pri
@@ -0,0 +1 @@
include(../libssu/libssu.pri)
5 changes: 3 additions & 2 deletions ssu.pro
Expand Up @@ -7,11 +7,12 @@ ssuconfhack {
SUBDIRS += ssuconfperm
}

SUBDIRS += tests tools
SUBDIRS += sandboxhook tests tools

ssucli.depends = libssu
ssuurlresolver.depends = libssu
tests.depends = libssu
sandboxhook.depends = libssu
tests.depends = libssu sandboxhook
ssuks.depends = libssu
ssud.depends = libssu
ssuslipstream.depends = libssu
Expand Down
1 change: 0 additions & 1 deletion tests/tests.pro
Expand Up @@ -3,7 +3,6 @@ CONFIG += ordered coverage debug
SUBDIRS = \
testutils \
formatoutput \
testutils/sandboxhook.pro \
ut_coreconfig \
ut_deviceinfo \
ut_featuremodel \
Expand Down
5 changes: 0 additions & 5 deletions tests/testutils/sandboxhook.pro

This file was deleted.

1 change: 0 additions & 1 deletion tests/testutils/sandboxhook_dependencies.pri

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ut_ssucli/ssuclitest.cpp
Expand Up @@ -30,7 +30,7 @@ void SsuCliTest::init()
qDebug() << "Using in-tree sandbox";
setenv("LD_PRELOAD", getenv("SSU_SANDBOX_PATH"), 1);
} else
setenv("LD_PRELOAD", qPrintable(QString("%1/libsandboxhook.so").arg(TESTS_PATH)), 1);
setenv("LD_PRELOAD", SSU_SANDBOX_PATH, 1);

m_bus = new QProcess(this);
m_bus->start("dbus-daemon",
Expand Down
1 change: 1 addition & 0 deletions tests/ut_ssucli/ut_ssucli_dependencies.pri
@@ -1,2 +1,3 @@
include(../../libssu/libssu.pri)
include(../../sandboxhook/sandboxhook.pri)
include(../testutils/testutils.pri)
2 changes: 1 addition & 1 deletion tests/ut_ssuurlresolver/ssuurlresolvertest.cpp
Expand Up @@ -32,7 +32,7 @@ void SsuUrlResolverTest::initTestCase()
qDebug() << "Using in-tree sandbox";
setenv("LD_PRELOAD", getenv("SSU_SANDBOX_PATH"), 1);
} else
setenv("LD_PRELOAD", qPrintable(QString("%1/libsandboxhook.so").arg(TESTS_PATH)), 1);
setenv("LD_PRELOAD", SSU_SANDBOX_PATH, 1);
}

void SsuUrlResolverTest::cleanupTestCase()
Expand Down
1 change: 1 addition & 0 deletions tests/ut_ssuurlresolver/ut_ssuurlresolver_dependencies.pri
@@ -1 +1,2 @@
include(../../libssu/libssu.pri)
include(../../sandboxhook/sandboxhook.pri)

0 comments on commit e5b748c

Please sign in to comment.