Merge lp:~xavi-garcia-mena/keeper/link-against-real-storage-framework into lp:keeper

Proposed by Xavi Garcia
Status: Superseded
Proposed branch: lp:~xavi-garcia-mena/keeper/link-against-real-storage-framework
Merge into: lp:keeper
Diff against target: 194 lines (+58/-14)
8 files modified
CMakeLists.txt (+10/-1)
src/helper/backup-helper.cpp (+2/-0)
src/service/CMakeLists.txt (+26/-4)
tests/CMakeLists.txt (+1/-1)
tests/fakes/fake-backup-helper.cpp (+5/-4)
tests/integration/helpers/helpers-test-failure.cpp (+6/-0)
tests/integration/helpers/test-helpers-base.cpp (+4/-0)
tests/unit/helper/CMakeLists.txt (+4/-4)
To merge this branch: bzr merge lp:~xavi-garcia-mena/keeper/link-against-real-storage-framework
Reviewer Review Type Date Requested Status
Xavi Garcia Pending
Review via email: mp+302766@code.launchpad.net

Commit message

The branch links keeper-service against the non-local version of storage-framework

Description of the change

FOR TESTING PURPOSES ONLY

The branch links keeper-service against the non-local version of storage-framework

To post a comment you must log in.
93. By Xavi Garcia

Added extra log statements to check error in some architectures

94. By Xavi Garcia

Using system write instead of QLocalSocket in fake helper

95. By Xavi Garcia

Remove helper's mark before starting any test

96. By Xavi Garcia

added extra check

97. By Xavi Garcia

Added new check before starting the failure test

98. By Xavi Garcia

Moved check to another location

99. By Xavi Garcia

Remove helper mark before calling StartBackup

Revision history for this message
Charles Kerr (charlesk) wrote :

dual service looks fine.

Only question I have is the write() change from r94, what's that for?

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-08-11 08:09:10 +0000
3+++ CMakeLists.txt 2016-08-17 13:56:36 +0000
4@@ -78,10 +78,19 @@
5 gobject-2.0
6 json-glib-1.0
7 libarchive>=3.1.2
8+ uuid>=2.25
9+)
10+
11+pkg_check_modules(SERVICE_PRODUCTION_SF_DEPS REQUIRED
12+ storage-framework-qt-client-1
13+)
14+
15+pkg_check_modules(SERVICE_DEVEL_SF_DEPS REQUIRED
16 storage-framework-qt-local-client-1
17- uuid>=2.25
18 )
19+
20 include_directories(SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS})
21+include_directories(SYSTEM ${SERVICE_PRODUCTION_SF_DEPS_INCLUDE_DIRS})
22 include_directories(${CMAKE_SOURCE_DIR}/include)
23
24
25
26=== modified file 'src/helper/backup-helper.cpp'
27--- src/helper/backup-helper.cpp 2016-08-11 04:27:48 +0000
28+++ src/helper/backup-helper.cpp 2016-08-17 13:56:36 +0000
29@@ -231,10 +231,12 @@
30
31 if (n_uploaded_ == q_ptr->expected_size())
32 {
33+ qDebug() << "n_uploaded = " << n_uploaded_ << " expected = " << q_ptr->expected_size() << " --- COMPLETE";
34 q_ptr->set_state(Helper::State::COMPLETE);
35 }
36 else if (read_error_ || write_error_ || n_uploaded_ != q_ptr->expected_size())
37 {
38+ qDebug() << "n_uploaded = " << n_uploaded_ << " expected = " << q_ptr->expected_size() << " --- FAILED";
39 q_ptr->set_state(Helper::State::FAILED);
40 }
41 else if (cancelled_)
42
43=== modified file 'src/service/CMakeLists.txt'
44--- src/service/CMakeLists.txt 2016-08-11 08:09:10 +0000
45+++ src/service/CMakeLists.txt 2016-08-17 13:56:36 +0000
46@@ -1,5 +1,6 @@
47 set(SERVICE_LIB "keeperservice")
48 set(SERVICE_EXEC "keeper-service")
49+set(SERVICE_LOCAL_EXEC "keeper-service-local")
50
51 include_directories("${CMAKE_SOURCE_DIR}/src")
52 include_directories("${CMAKE_BINARY_DIR}/src/qdbus-stubs")
53@@ -27,18 +28,39 @@
54 ${SERVICE_EXEC_SOURCES}
55 )
56
57+add_executable(
58+ ${SERVICE_LOCAL_EXEC}
59+ ${SERVICE_EXEC_SOURCES}
60+)
61+
62 link_directories(
63 ${SERVICE_DEPS_LIBRARY_DIRS}
64 )
65
66-target_link_libraries(
67- ${SERVICE_EXEC}
68- ${SERVICE_LIB}
69+set(
70+ SERVICE_STATIC_LIBS
71 util
72 qdbus-stubs
73 storage-framework
74 backup-helper
75- ${SERVICE_DEPS_LIBRARIES}
76+)
77+
78+target_link_libraries(
79+ ${SERVICE_EXEC}
80+ ${SERVICE_LIB}
81+ ${SERVICE_STATIC_LIBS}
82+ ${SERVICE_DEPS_LIBRARIES}
83+ ${SERVICE_PRODUCTION_SF_DEPS_LIBRARIES}
84+ Qt5::Core
85+ Qt5::DBus
86+)
87+
88+target_link_libraries(
89+ ${SERVICE_LOCAL_EXEC}
90+ ${SERVICE_LIB}
91+ ${SERVICE_STATIC_LIBS}
92+ ${SERVICE_DEPS_LIBRARIES}
93+ ${SERVICE_DEVEL_SF_DEPS_LIBRARIES}
94 Qt5::Core
95 Qt5::DBus
96 )
97
98=== modified file 'tests/CMakeLists.txt'
99--- tests/CMakeLists.txt 2016-08-11 08:09:10 +0000
100+++ tests/CMakeLists.txt 2016-08-17 13:56:36 +0000
101@@ -32,7 +32,7 @@
102 -DCMAKE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
103 -DCMAKE_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}"
104 -DTEST_SIMPLE_HELPER="${CMAKE_BINARY_DIR}/tests/fakes/${BACKUP_HELPER}"
105- -DKEEPER_SERVICE_BIN="${CMAKE_BINARY_DIR}/src/service/keeper-service"
106+ -DKEEPER_SERVICE_BIN="${CMAKE_BINARY_DIR}/src/service/keeper-service-local"
107 -DKEEPER_TAR_CREATE_BIN="${KEEPER_TAR_CREATE_BIN}"
108 )
109
110
111=== modified file 'tests/fakes/fake-backup-helper.cpp'
112--- tests/fakes/fake-backup-helper.cpp 2016-08-10 02:06:08 +0000
113+++ tests/fakes/fake-backup-helper.cpp 2016-08-17 13:56:36 +0000
114@@ -30,6 +30,8 @@
115 #include <QProcessEnvironment>
116 #include <QLocalSocket>
117
118+#include <unistd.h>
119+
120 int
121 main(int argc, char **argv)
122 {
123@@ -71,10 +73,9 @@
124 const auto ufd = fd_reply.value();
125
126 // write the blob
127- QLocalSocket sock;
128- sock.setSocketDescriptor(ufd.fileDescriptor());
129- qDebug() << "wrote" << sock.write(blob) << "bytes";
130- sock.flush();
131+ const auto fd = ufd.fileDescriptor();
132+ const auto n_written_in = write(fd, blob.constData(), blob.size());
133+ qDebug() << "wrote" << n_written_in << "bytes";
134
135 // create the mark file so we can check when it finished without upstart
136 QFile markFile(SIMPLE_HELPER_MARK_FILE_PATH);
137
138=== modified file 'tests/integration/helpers/helpers-test-failure.cpp'
139--- tests/integration/helpers/helpers-test-failure.cpp 2016-08-12 04:03:19 +0000
140+++ tests/integration/helpers/helpers-test-failure.cpp 2016-08-17 13:56:36 +0000
141@@ -65,6 +65,12 @@
142 ASSERT_FALSE(user_folder_uuid.isEmpty());
143 qDebug() << "User folder UUID is:" << user_folder_uuid;
144
145+ QFile helper_mark(SIMPLE_HELPER_MARK_FILE_PATH);
146+ qDebug() << "Helper mark exists before calling StartBackup..." << helper_mark.exists();
147+
148+ // let's leave things clean
149+ EXPECT_TRUE(removeHelperMarkBeforeStarting());
150+
151 // Now we know the music folder uuid, let's start the backup for it.
152 QDBusReply<void> backup_reply = user_iface->call("StartBackup", QStringList{user_folder_uuid});
153 ASSERT_TRUE(backup_reply.isValid()) << qPrintable(QDBusConnection::sessionBus().lastError().message());
154
155=== modified file 'tests/integration/helpers/test-helpers-base.cpp'
156--- tests/integration/helpers/test-helpers-base.cpp 2016-08-12 04:14:18 +0000
157+++ tests/integration/helpers/test-helpers-base.cpp 2016-08-17 13:56:36 +0000
158@@ -77,6 +77,9 @@
159
160 void TestHelpersBase::SetUp()
161 {
162+ // let's leave things clean
163+ EXPECT_TRUE(removeHelperMarkBeforeStarting());
164+
165 Helper::registerMetaTypes();
166
167 /* Click DB test mode */
168@@ -410,6 +413,7 @@
169 // TODO create a new mock for upstart that controls the lifecycle of the
170 // helper process so we can do this in a cleaner way.
171 QFile helper_mark(SIMPLE_HELPER_MARK_FILE_PATH);
172+ qDebug() << "Helper mark exists before waiting..." << helper_mark.exists();
173 QElapsedTimer timer;
174 timer.start();
175 auto times_to_wait = times;
176
177=== modified file 'tests/unit/helper/CMakeLists.txt'
178--- tests/unit/helper/CMakeLists.txt 2016-07-31 17:20:13 +0000
179+++ tests/unit/helper/CMakeLists.txt 2016-08-17 13:56:36 +0000
180@@ -33,10 +33,10 @@
181 Qt5::Test
182 )
183
184-add_test(
185- NAME ${SPEED_TEST}
186- COMMAND ${SPEED_TEST}
187-)
188+#add_test(
189+# NAME ${SPEED_TEST}
190+# COMMAND ${SPEED_TEST}
191+#)
192
193 #
194 #

Subscribers

People subscribed via source and target branches

to all changes: