Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ssu] Extract libsandboxhook.so from tests package. Contributes to JB…
…#38303

So that independed tools can use it without the need to install -tests
package (brings a lot of dependencies).
  • Loading branch information
martyone committed Aug 4, 2017
1 parent fddd582 commit 120b3b5
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 11 deletions.
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 120b3b5

Please sign in to comment.