Merge lp:~kissiel/checkbox/loc-svc-test-cc into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 4352
Merged at revision: 4355
Proposed branch: lp:~kissiel/checkbox/loc-svc-test-cc
Merge into: lp:checkbox
Diff against target: 183 lines (+140/-2)
5 files modified
checkbox-touch/build-me (+0/-2)
providers/plainbox-provider-ubuntu-touch/_extra_debs (+11/-0)
providers/plainbox-provider-ubuntu-touch/bin/uls_resource (+96/-0)
providers/plainbox-provider-ubuntu-touch/units/touch.pxu (+1/-0)
providers/plainbox-provider-ubuntu-touch/units/uls.pxu (+32/-0)
To merge this branch: bzr merge lp:~kissiel/checkbox/loc-svc-test-cc
Reviewer Review Type Date Requested Status
Pierre Equoy Approve
Sylvain Pineau (community) Needs Information
Review via email: mp+294815@code.launchpad.net

Description of the change

This MR adds Ubuntu Location Service tests to the 'touch' provider.

It uses template units to generate the tests out of the gtest-framework binaries.

5c91d8f providers:touch: add ULS dependencies to the provider
7e6f9a5 providers:touch: add uls_resource generator script
d74be10 providers:touch: add ULS test definitions
5d2169c checkbox-touch: make build-me less verbose

To post a comment you must log in.
Revision history for this message
Chris Wayne (cwayne) wrote :

Looks like some conflicts

lp:~kissiel/checkbox/loc-svc-test-cc updated
4344. By Paul Larson

Remove the deprecation warning for get_session_data_subset

It seems that get_session_data_subset was marked deprecated in favor of
dump_from_session_manager, but dump_from_session_manager actually calls
get_session_data_subset and then just dumps it to a stream. Since I'm
guessing there could be some cases where we might want this as a return
value rather than a stream, I'm proposing that we remove the deprecation
warning.

4345. By Sylvain Pineau

checkbox-ng:checkbox-cli: Add the tar exporter to submission_files

Note: The json report is included in the archive.

4346. By Sylvain Pineau

plainbox:exporter:tar: Fix the class attribute SUPPORTED_OPTION_LIST

supported_option_list -> SUPPORTED_OPTION_LIST

4347. By Sylvain Pineau

plainbox:providers:exporter: Enable all xlsx options by default

4348. By Sylvain Pineau

plainbox:providers:exporter: Fix tar extension to be tar.xz

4349. By Maciej Kisielewski

providers:touch: add ULS dependencies to the provider

Signed-off-by: Maciej Kisielewski <email address hidden>

4350. By Maciej Kisielewski

providers:touch: add uls_resource generator script

Signed-off-by: Maciej Kisielewski <email address hidden>

4351. By Maciej Kisielewski

providers:touch: add ULS test definitions

Signed-off-by: Maciej Kisielewski <email address hidden>

4352. By Maciej Kisielewski

checkbox-touch: make build-me less verbose

By removing printing of temporary locations from which libs were pulled.

Signed-off-by: Maciej Kisielewski <email address hidden>

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

I guess the recent blacklisted items are making TESTS_REQUIRING_ROOT an empty var now? could you confirm it's expected?

review: Needs Information
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

> I guess the recent blacklisted items are making TESTS_REQUIRING_ROOT an empty
> var now? could you confirm it's expected?

Yes.
 I spent quite some time researching how to properly run the tests as root, this is why I left it there. Now it should be easy to add next bunch of tests.

(the ones requiring root actually don't work well indoors, this is why they're blacklisted)

Revision history for this message
Pierre Equoy (pieq) wrote :
Download full text (7.4 KiB)

Tested on an Arale device with OTA 10.1.

75 tests were run and passed:

uls/boost_ptree_settings_test_BoostPtreeSettings.correctly_reads_and_writes_values_to_file
uls/boost_ptree_settings_test_BoostPtreeSettings.does_not_throw_for_file_that_cannot_be_read_from
uls/boost_ptree_settings_test_BoostPtreeSettings.never_throws_on_syncing
uls/boost_ptree_settings_test_BoostPtreeSettings.throws_correct_exception_for_missing_value
uls/boost_ptree_settings_test_BoostPtreeSettings.values_are_correctly_stored
uls/connectivity_manager_test_ConnectivityManager.DISABLED_correctly_handles_wifi_devices_and_aps_on_init
uls/connectivity_manager_test_ConnectivityManager.DISABLED_queries_devices_and_modems_when_initialized
uls/connectivity_manager_test_ConnectivityManagerOnDevice.default_implementation_is_queryable_for_wifi_and_wwan_status_requires_hardware
uls/connectivity_manager_test_ConnectivityManagerOnDevice.default_implementation_is_queryable_for_wifis_and_radio_cells_requires_hardware
uls/connectivity_manager_test_ConnectivityManagerOnDevice.repeatedly_querying_the_connected_cell_works_requires_hardware
uls/connectivity_manager_test_ConnectivityManagerOnDevice.repeatedly_requesting_network_scans_works_requires_hardware
uls/controller_test_Controller.controller_starts_and_stops_updates_on_provider
uls/controller_test_Controller.controller_starts_and_stops_updates_on_provider_only_once_requires_hardware
uls/criteria_test_Criteria.AddedUpCriteriaSatisfiesAllIndividualCriteria
uls/criteria_test_Criteria.SatisfiesReturnsFalseForNonSatisfyingCriteria
uls/default_permission_manager_test_DefaultPermissionManager.for_now_only_local_sessions_are_accepted
uls/demultiplexing_reporter_test_DemultiplexingReporter.dispatches_calls_to_all_reporters
uls/engine_test_Engine.adding_a_null_provider_throws
uls/engine_test_Engine.adding_a_provider_creates_connections_to_engine_configuration_properties
uls/engine_test_Engine.adding_and_removing_providers_inserts_and_erases_from_underlying_collection
uls/engine_test_Engine.provider_selection_policy_is_invoked_when_matching_providers_to_criteria
uls/engine_test_Engine.reads_state_from_settings_on_construction
uls/engine_test_Engine.stores_state_from_settings_on_destruction
uls/gps_provider_test_AndroidGpsXtraDownloader.reading_configuration_from_valid_conf_file_works
uls/gps_provider_test_GpsProvider.DISABLED_accessing_starting_and_stopping_gps_provider_works_requires_hardware
uls/gps_provider_test_GpsProvider.injecting_a_reference_position_calls_into_the_hal
uls/gps_provider_test_GpsProvider.starting_updates_on_a_provider_instance_calls_into_the_hal
uls/gps_provider_test_GpsProvider.updates_from_hal_are_passed_on_by_the_provider
uls/gps_provider_test_GpsXtraDownloader.download_attempt_throws_if_timeout_is_reached
uls/gps_provider_test_GpsXtraDownloader.downloading_xtra_data_from_known_host_works
uls/gps_provider_test_GpsXtraDownloader.throws_for_missing_xtra_hosts
uls/gps_provider_test_GpsXtraDownloader.throws_for_unreachable_host
uls/gps_provider_test_HardwareAbstractionLayerFixture.DISABLED_provider_construction_works_requires_hardw...

Read more...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-touch/build-me'
2--- checkbox-touch/build-me 2016-05-11 22:13:06 +0000
3+++ checkbox-touch/build-me 2016-05-17 07:59:56 +0000
4@@ -285,7 +285,6 @@
5 get_package_from_url_and_extract(uris[deb], tmp)
6 bin_path = os.path.join(tmp, 'usr', 'bin')
7 if os.path.exists(bin_path):
8- print('copying binaries from {}'.format(tmp))
9 executables = find_executables(bin_path)
10 provider_bin = os.path.join(
11 'providers', provider_dir, 'bin')
12@@ -303,7 +302,6 @@
13 shutil.copymode(f, target)
14 lib_path = os.path.join(tmp, 'usr', 'lib')
15 if os.path.exists(lib_path):
16- print('copying libraries from {}'.format(tmp))
17 rsync_tree(lib_path, 'lib', preserve_symlinks=1)
18
19
20
21=== added file 'providers/plainbox-provider-ubuntu-touch/_extra_debs'
22--- providers/plainbox-provider-ubuntu-touch/_extra_debs 1970-01-01 00:00:00 +0000
23+++ providers/plainbox-provider-ubuntu-touch/_extra_debs 2016-05-17 07:59:56 +0000
24@@ -0,0 +1,11 @@
25+libboost-filesystem1.58.0
26+libboost-iostreams1.58.0
27+libboost-program-options1.58.0
28+libboost-system1.58.0
29+libdbus-cpp5
30+libnet-cpp2
31+libprocess-cpp3
32+libstdc++6
33+libtrust-store2
34+libubuntu-location-service3
35+ubuntu-location-service-tests
36
37=== added directory 'providers/plainbox-provider-ubuntu-touch/bin'
38=== added file 'providers/plainbox-provider-ubuntu-touch/bin/uls_resource'
39--- providers/plainbox-provider-ubuntu-touch/bin/uls_resource 1970-01-01 00:00:00 +0000
40+++ providers/plainbox-provider-ubuntu-touch/bin/uls_resource 2016-05-17 07:59:56 +0000
41@@ -0,0 +1,96 @@
42+#!/usr/bin/env python3
43+#
44+# This file is part of Checkbox.
45+#
46+# Copyright 2016 Canonical Ltd.
47+#
48+# Checkbox is free software: you can redistribute it and/or modify
49+# it under the terms of the GNU General Public License version 3,
50+# as published by the Free Software Foundation.
51+#
52+# Checkbox is distributed in the hope that it will be useful,
53+# but WITHOUT ANY WARRANTY; without even the implied warranty of
54+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55+# GNU General Public License for more details.
56+#
57+# You should have received a copy of the GNU General Public License
58+# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
59+"""
60+This program generates Ubuntu Location Service tests formatted as plainbox
61+jobs. It requires executables ubuntu-location-service-tests package to be
62+available in the path.
63+
64+Number of plainbox jobs generated with this script should match running:
65+$ for e in `find . -executable`; do $e --gtest_list_tests 2>/dev/null; done
66+|grep '^\ ' |wc -l
67+in the ubuntu-location-service-tests bin directory.
68+
69+Note that for different architectures the binaries names and number of tests
70+may vary.
71+"""
72+
73+import os
74+import subprocess
75+import sys
76+
77+BINARIES_BLACKLISTED = [
78+ 'daemon_and_cli_tests', 'acceptance_tests', # all tests from those binaries
79+ # require /usr/share/dbus-cpp/session.conf to be present; this file is
80+ # normally _installed_ with libdbus-cpp-dev.
81+ #'engine_test', # tests from this binary yield 'stack smashing detected'
82+ # which is reproducable on desktops
83+]
84+
85+TESTS_BLACKLISTED = [
86+ 'HardwareAbstractionLayerFixture.time_to_first_fix_cold_start_without_supl_benchmark_requires_hardware',
87+ 'HardwareAbstractionLayerFixture.time_to_first_fix_cold_start_with_supl_benchmark_requires_hardware',
88+ # those two tests when run indoors can run indefinitely
89+ 'RemoteProviderdTest.AClientReceivesUpdatesFromAnOutOfProcessProvider',
90+ # this test also requires /usr/share/dbus-cpp/session.conf
91+ 'EspooProviderTest.receives_position_updates_requires_daemons',
92+ # this test requires X11
93+ 'AppArmorProfileResolver.libapparmor_profile_resolver_returns_correct_profile_for_unconfined_process',
94+ # this test is run as part of checkbox, so apparmor reports app being
95+ # checkbox, and not the one that test expects
96+]
97+
98+TESTS_REQUIRING_ROOT = [
99+]
100+
101+def main():
102+ uls_binaries = [
103+ "acceptance_tests", "boost_ptree_settings_test",
104+ "connectivity_manager_test", "controller_test", "criteria_test",
105+ "daemon_and_cli_tests", "default_permission_manager_test",
106+ "demultiplexing_reporter_test", "engine_test", "espoo_provider_test",
107+ "gps_provider_test", "harvester_test", "ichnaea_reporter_test",
108+ "position_test", "provider_factory_test",
109+ "provider_selection_policy_test", "provider_test",
110+ "remote_provider_test", "remote_providerd_test",
111+ "time_based_update_policy_test", "trust_store_permission_manager_test",
112+ "wgs84_test"]
113+ for uls_bin in uls_binaries:
114+ if uls_bin in BINARIES_BLACKLISTED:
115+ continue
116+ output = subprocess.check_output([uls_bin, '--gtest_list_tests'])
117+ suite = ''
118+ for line in output.decode(sys.stdout.encoding).split('\n'):
119+ if not line.startswith(' '):
120+ suite = line
121+ else:
122+ test_name = line.lstrip()
123+ full_name = suite + test_name
124+ root = 'yes' if full_name in TESTS_REQUIRING_ROOT else 'no'
125+ if full_name in TESTS_BLACKLISTED:
126+ continue
127+ print('full_name: {}'.format(full_name))
128+ print('test_case: {}'.format(test_name))
129+ print('binary: {}'.format(uls_bin))
130+ print('root: {}'.format(root))
131+ if root == 'yes':
132+ print('ld_lib_path: {}'.format(os.environ.get('LD_LIBRARY_PATH') or ''))
133+ print()
134+
135+
136+if __name__ == '__main__':
137+ main()
138
139=== modified file 'providers/plainbox-provider-ubuntu-touch/units/touch.pxu'
140--- providers/plainbox-provider-ubuntu-touch/units/touch.pxu 2016-01-05 02:45:26 +0000
141+++ providers/plainbox-provider-ubuntu-touch/units/touch.pxu 2016-05-17 07:59:56 +0000
142@@ -5059,3 +5059,4 @@
143 _description:
144 This test plan selects all the tests required to certify a device with Ubuntu Touch
145 include: .*
146+bootstrap_include: uls/uls_resource
147
148=== added file 'providers/plainbox-provider-ubuntu-touch/units/uls.pxu'
149--- providers/plainbox-provider-ubuntu-touch/units/uls.pxu 1970-01-01 00:00:00 +0000
150+++ providers/plainbox-provider-ubuntu-touch/units/uls.pxu 2016-05-17 07:59:56 +0000
151@@ -0,0 +1,32 @@
152+unit: category
153+id: uls
154+_name: Ubuntu Location Service tests
155+
156+id: uls/uls_resource
157+category_id: uls
158+plugin: resource
159+command: uls_resource
160+_summary: Generate Ubuntu Location Services tests
161+_description: Generates Ubuntu Location Services tests
162+
163+unit: template
164+template-resource: uls/uls_resource
165+id: uls/{binary}_{full_name}
166+template-imports: from 2014.com.ubuntu import uls/uls_resource as uls_res
167+template-filter: uls_res.root == 'yes'
168+category_id: uls
169+plugin: shell
170+command: LD_LIBRARY_PATH={ld_lib_path}:$LD_LIBRARY_PATH {binary} --gtest_filter={full_name}
171+user: root
172+_description: {test_case} from Ubuntu Location Service tests
173+
174+unit: template
175+template-resource: uls/uls_resource
176+id: uls/{binary}_{full_name}
177+template-imports: from 2014.com.ubuntu import uls/uls_resource as uls_res
178+template-filter: uls_res.root == 'no'
179+category_id: uls
180+plugin: shell
181+command: {binary} --gtest_filter={full_name}
182+_description: {test_case} from Ubuntu Location Service tests
183+

Subscribers

People subscribed via source and target branches