3
# This file is part of Checkbox.
5
# Copyright 2016 Canonical Ltd.
7
# Checkbox is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License version 3,
9
# as published by the Free Software Foundation.
11
# Checkbox is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
19
This program generates Ubuntu Location Service tests formatted as plainbox
20
jobs. It requires executables ubuntu-location-service-tests package to be
21
available in the path.
23
Number of plainbox jobs generated with this script should match running:
24
$ for e in `find . -executable`; do $e --gtest_list_tests 2>/dev/null; done
26
in the ubuntu-location-service-tests bin directory.
28
Note that for different architectures the binaries names and number of tests
36
BINARIES_BLACKLISTED = [
37
'daemon_and_cli_tests', 'acceptance_tests', # all tests from those binaries
38
# require /usr/share/dbus-cpp/session.conf to be present; this file is
39
# normally _installed_ with libdbus-cpp-dev.
40
#'engine_test', # tests from this binary yield 'stack smashing detected'
41
# which is reproducable on desktops
45
'HardwareAbstractionLayerFixture.time_to_first_fix_cold_start_without_supl_benchmark_requires_hardware',
46
'HardwareAbstractionLayerFixture.time_to_first_fix_cold_start_with_supl_benchmark_requires_hardware',
47
# those two tests when run indoors can run indefinitely
48
'RemoteProviderdTest.AClientReceivesUpdatesFromAnOutOfProcessProvider',
49
# this test also requires /usr/share/dbus-cpp/session.conf
50
'EspooProviderTest.receives_position_updates_requires_daemons',
51
# this test requires X11
52
'AppArmorProfileResolver.libapparmor_profile_resolver_returns_correct_profile_for_unconfined_process',
53
# this test is run as part of checkbox, so apparmor reports app being
54
# checkbox, and not the one that test expects
57
TESTS_REQUIRING_ROOT = [
62
"acceptance_tests", "boost_ptree_settings_test",
63
"connectivity_manager_test", "controller_test", "criteria_test",
64
"daemon_and_cli_tests", "default_permission_manager_test",
65
"demultiplexing_reporter_test", "engine_test", "espoo_provider_test",
66
"gps_provider_test", "harvester_test", "ichnaea_reporter_test",
67
"position_test", "provider_factory_test",
68
"provider_selection_policy_test", "provider_test",
69
"remote_provider_test", "remote_providerd_test",
70
"time_based_update_policy_test", "trust_store_permission_manager_test",
72
for uls_bin in uls_binaries:
73
if uls_bin in BINARIES_BLACKLISTED:
75
output = subprocess.check_output([uls_bin, '--gtest_list_tests'])
77
for line in output.decode(sys.stdout.encoding).split('\n'):
78
if not line.startswith(' '):
81
test_name = line.lstrip()
82
full_name = suite + test_name
83
root = 'yes' if full_name in TESTS_REQUIRING_ROOT else 'no'
84
if full_name in TESTS_BLACKLISTED:
86
print('full_name: {}'.format(full_name))
87
print('test_case: {}'.format(test_name))
88
print('binary: {}'.format(uls_bin))
89
print('root: {}'.format(root))
91
print('ld_lib_path: {}'.format(os.environ.get('LD_LIBRARY_PATH') or ''))
95
if __name__ == '__main__':