Merge lp:~savilerow-team/savilerow/fix_lp1279119 into lp:~savilerow-team/savilerow/trunk-1.0

Proposed by Chris Wayne
Status: Superseded
Proposed branch: lp:~savilerow-team/savilerow/fix_lp1279119
Merge into: lp:~savilerow-team/savilerow/trunk-1.0
Diff against target: 220 lines (+33/-6)
2 files modified
src/system/custom/etc/dconf_source/db/custom.d/locks/custom.lock (+0/-1)
tests/api/test_dconf.py (+33/-5)
To merge this branch: bzr merge lp:~savilerow-team/savilerow/fix_lp1279119
Reviewer Review Type Date Requested Status
Alex Chiang (community) Needs Fixing
Review via email: mp+205898@code.launchpad.net

This proposal has been superseded by a proposal from 2014-02-12.

Description of the change

Remove background from list of locked dconf keys, and add test for dconf locks

To post a comment you must log in.
Revision history for this message
Alex Chiang (achiang) wrote :

Please drop r71, as that MP is still outstanding. This will probably mean rebasing r72 and r73 on trunk.

176 - self.asserttrue(False)
177 + self.assertTrue(False)

I do see you fixed the assertTrue, but it also looks like you might have included a tab instead of spaces. Please double-check.

185 - dval = subprocess.check_output(['dconf', 'read', key])
186 + dval = check_output(['dconf', 'read', key])

Also double-check tab v spaces here.

197 + In some rare cases, downstreams may wish to make a customization
198 + unchangable. This is done by setting a dconf lock.

Suggested alternate wording (for clarity). Note also, one space between period. :)

In some rare cases, downstreams may wish to ship a customization and prevent end users from ever changing it. This is done by setting a dconf lock.

199 +
200 + This test verifies that the lock file exists, and that the contained
201 + keys cannot be changed.

"This test verifies that the dconf lock file exists..."

Lines 203--212: all good, but please insert space between comment char and first letter of comment. Also, please capitalize the comment as if it were a sentence.

Overall: good MP, but a question - should we continue to lock the sounds too? Is there something more benign we could lock, so that people experimenting with savvy don't get surprised? Absolute best would be to lock a dconf key that we're not even using, so the lock itself becomes a nop...

Thoughts?

review: Needs Fixing
Revision history for this message
Alex Chiang (achiang) wrote :

176 - self.asserttrue(False)
177 + self.assertTrue(False)
...
185 - dval = subprocess.check_output(['dconf', 'read', key])
186 + dval = check_output(['dconf', 'read', key])

I checked the lines myself in an editor, and they were fine. Must have been my mail client making the spaces look funny.

So ignore those comments, but please address the others.

Thanks.

Revision history for this message
Chris Wayne (cwayne) wrote :

Tested the lock fix by flashing to a clean N4 running devel, then making sure the custom background is shown, and then changing it.

74. By Chris Wayne

Adressing MP comments

Unmerged revisions

74. By Chris Wayne

Adressing MP comments

73. By Chris Wayne

Updating dconf test, as we were missing lockfile functionality

72. By Chris Wayne

custom.lock: Remove wallpaper from lock, as its not needed and a poor user experience

71. By Chris Wayne

We should only ship 4 pictures, 80 is absurd

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/system/custom/etc/dconf_source/db/custom.d/locks/custom.lock'
2--- src/system/custom/etc/dconf_source/db/custom.d/locks/custom.lock 2013-09-05 19:24:47 +0000
3+++ src/system/custom/etc/dconf_source/db/custom.d/locks/custom.lock 2014-02-12 13:51:55 +0000
4@@ -1,3 +1,2 @@
5-/org/gnome/desktop/background/picture-uri
6 /com/ubuntu/touch/sound/incoming-call-sound
7 /com/ubuntu/touch/sound/incoming-message-sound
8
9=== removed file 'src/system/custom/home/Pictures/05.jpg'
10Binary files src/system/custom/home/Pictures/05.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/05.jpg 1970-01-01 00:00:00 +0000 differ
11=== removed file 'src/system/custom/home/Pictures/06.jpg'
12Binary files src/system/custom/home/Pictures/06.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/06.jpg 1970-01-01 00:00:00 +0000 differ
13=== removed file 'src/system/custom/home/Pictures/07.jpg'
14Binary files src/system/custom/home/Pictures/07.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/07.jpg 1970-01-01 00:00:00 +0000 differ
15=== removed file 'src/system/custom/home/Pictures/08.jpg'
16Binary files src/system/custom/home/Pictures/08.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/08.jpg 1970-01-01 00:00:00 +0000 differ
17=== removed file 'src/system/custom/home/Pictures/09.jpg'
18Binary files src/system/custom/home/Pictures/09.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/09.jpg 1970-01-01 00:00:00 +0000 differ
19=== removed file 'src/system/custom/home/Pictures/10.jpg'
20Binary files src/system/custom/home/Pictures/10.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/10.jpg 1970-01-01 00:00:00 +0000 differ
21=== removed file 'src/system/custom/home/Pictures/11.jpg'
22Binary files src/system/custom/home/Pictures/11.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/11.jpg 1970-01-01 00:00:00 +0000 differ
23=== removed file 'src/system/custom/home/Pictures/12.jpg'
24Binary files src/system/custom/home/Pictures/12.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/12.jpg 1970-01-01 00:00:00 +0000 differ
25=== removed file 'src/system/custom/home/Pictures/13.jpg'
26Binary files src/system/custom/home/Pictures/13.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/13.jpg 1970-01-01 00:00:00 +0000 differ
27=== removed file 'src/system/custom/home/Pictures/14.jpg'
28Binary files src/system/custom/home/Pictures/14.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/14.jpg 1970-01-01 00:00:00 +0000 differ
29=== removed file 'src/system/custom/home/Pictures/15.jpg'
30Binary files src/system/custom/home/Pictures/15.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/15.jpg 1970-01-01 00:00:00 +0000 differ
31=== removed file 'src/system/custom/home/Pictures/16.jpg'
32Binary files src/system/custom/home/Pictures/16.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/16.jpg 1970-01-01 00:00:00 +0000 differ
33=== removed file 'src/system/custom/home/Pictures/17.jpg'
34Binary files src/system/custom/home/Pictures/17.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/17.jpg 1970-01-01 00:00:00 +0000 differ
35=== removed file 'src/system/custom/home/Pictures/18.jpg'
36Binary files src/system/custom/home/Pictures/18.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/18.jpg 1970-01-01 00:00:00 +0000 differ
37=== removed file 'src/system/custom/home/Pictures/19.jpg'
38Binary files src/system/custom/home/Pictures/19.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/19.jpg 1970-01-01 00:00:00 +0000 differ
39=== removed file 'src/system/custom/home/Pictures/20.jpg'
40Binary files src/system/custom/home/Pictures/20.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/20.jpg 1970-01-01 00:00:00 +0000 differ
41=== removed file 'src/system/custom/home/Pictures/21.jpg'
42Binary files src/system/custom/home/Pictures/21.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/21.jpg 1970-01-01 00:00:00 +0000 differ
43=== removed file 'src/system/custom/home/Pictures/22.jpg'
44Binary files src/system/custom/home/Pictures/22.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/22.jpg 1970-01-01 00:00:00 +0000 differ
45=== removed file 'src/system/custom/home/Pictures/23.jpg'
46Binary files src/system/custom/home/Pictures/23.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/23.jpg 1970-01-01 00:00:00 +0000 differ
47=== removed file 'src/system/custom/home/Pictures/24.jpg'
48Binary files src/system/custom/home/Pictures/24.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/24.jpg 1970-01-01 00:00:00 +0000 differ
49=== removed file 'src/system/custom/home/Pictures/25.jpg'
50Binary files src/system/custom/home/Pictures/25.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/25.jpg 1970-01-01 00:00:00 +0000 differ
51=== removed file 'src/system/custom/home/Pictures/26.jpg'
52Binary files src/system/custom/home/Pictures/26.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/26.jpg 1970-01-01 00:00:00 +0000 differ
53=== removed file 'src/system/custom/home/Pictures/27.jpg'
54Binary files src/system/custom/home/Pictures/27.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/27.jpg 1970-01-01 00:00:00 +0000 differ
55=== removed file 'src/system/custom/home/Pictures/28.jpg'
56Binary files src/system/custom/home/Pictures/28.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/28.jpg 1970-01-01 00:00:00 +0000 differ
57=== removed file 'src/system/custom/home/Pictures/29.jpg'
58Binary files src/system/custom/home/Pictures/29.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/29.jpg 1970-01-01 00:00:00 +0000 differ
59=== removed file 'src/system/custom/home/Pictures/30.jpg'
60Binary files src/system/custom/home/Pictures/30.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/30.jpg 1970-01-01 00:00:00 +0000 differ
61=== removed file 'src/system/custom/home/Pictures/31.jpg'
62Binary files src/system/custom/home/Pictures/31.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/31.jpg 1970-01-01 00:00:00 +0000 differ
63=== removed file 'src/system/custom/home/Pictures/32.jpg'
64Binary files src/system/custom/home/Pictures/32.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/32.jpg 1970-01-01 00:00:00 +0000 differ
65=== removed file 'src/system/custom/home/Pictures/33.jpg'
66Binary files src/system/custom/home/Pictures/33.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/33.jpg 1970-01-01 00:00:00 +0000 differ
67=== removed file 'src/system/custom/home/Pictures/34.jpg'
68Binary files src/system/custom/home/Pictures/34.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/34.jpg 1970-01-01 00:00:00 +0000 differ
69=== removed file 'src/system/custom/home/Pictures/35.jpg'
70Binary files src/system/custom/home/Pictures/35.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/35.jpg 1970-01-01 00:00:00 +0000 differ
71=== removed file 'src/system/custom/home/Pictures/36.jpg'
72Binary files src/system/custom/home/Pictures/36.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/36.jpg 1970-01-01 00:00:00 +0000 differ
73=== removed file 'src/system/custom/home/Pictures/37.jpg'
74Binary files src/system/custom/home/Pictures/37.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/37.jpg 1970-01-01 00:00:00 +0000 differ
75=== removed file 'src/system/custom/home/Pictures/38.jpg'
76Binary files src/system/custom/home/Pictures/38.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/38.jpg 1970-01-01 00:00:00 +0000 differ
77=== removed file 'src/system/custom/home/Pictures/39.jpg'
78Binary files src/system/custom/home/Pictures/39.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/39.jpg 1970-01-01 00:00:00 +0000 differ
79=== removed file 'src/system/custom/home/Pictures/40.jpg'
80Binary files src/system/custom/home/Pictures/40.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/40.jpg 1970-01-01 00:00:00 +0000 differ
81=== removed file 'src/system/custom/home/Pictures/41.jpg'
82Binary files src/system/custom/home/Pictures/41.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/41.jpg 1970-01-01 00:00:00 +0000 differ
83=== removed file 'src/system/custom/home/Pictures/42.jpg'
84Binary files src/system/custom/home/Pictures/42.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/42.jpg 1970-01-01 00:00:00 +0000 differ
85=== removed file 'src/system/custom/home/Pictures/43.jpg'
86Binary files src/system/custom/home/Pictures/43.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/43.jpg 1970-01-01 00:00:00 +0000 differ
87=== removed file 'src/system/custom/home/Pictures/44.jpg'
88Binary files src/system/custom/home/Pictures/44.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/44.jpg 1970-01-01 00:00:00 +0000 differ
89=== removed file 'src/system/custom/home/Pictures/45.jpg'
90Binary files src/system/custom/home/Pictures/45.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/45.jpg 1970-01-01 00:00:00 +0000 differ
91=== removed file 'src/system/custom/home/Pictures/46.jpg'
92Binary files src/system/custom/home/Pictures/46.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/46.jpg 1970-01-01 00:00:00 +0000 differ
93=== removed file 'src/system/custom/home/Pictures/47.jpg'
94Binary files src/system/custom/home/Pictures/47.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/47.jpg 1970-01-01 00:00:00 +0000 differ
95=== removed file 'src/system/custom/home/Pictures/50.jpg'
96Binary files src/system/custom/home/Pictures/50.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/50.jpg 1970-01-01 00:00:00 +0000 differ
97=== removed file 'src/system/custom/home/Pictures/51.jpg'
98Binary files src/system/custom/home/Pictures/51.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/51.jpg 1970-01-01 00:00:00 +0000 differ
99=== removed file 'src/system/custom/home/Pictures/52.jpg'
100Binary files src/system/custom/home/Pictures/52.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/52.jpg 1970-01-01 00:00:00 +0000 differ
101=== removed file 'src/system/custom/home/Pictures/54.jpg'
102Binary files src/system/custom/home/Pictures/54.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/54.jpg 1970-01-01 00:00:00 +0000 differ
103=== removed file 'src/system/custom/home/Pictures/55.jpg'
104Binary files src/system/custom/home/Pictures/55.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/55.jpg 1970-01-01 00:00:00 +0000 differ
105=== removed file 'src/system/custom/home/Pictures/56.jpg'
106Binary files src/system/custom/home/Pictures/56.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/56.jpg 1970-01-01 00:00:00 +0000 differ
107=== removed file 'src/system/custom/home/Pictures/57.jpg'
108Binary files src/system/custom/home/Pictures/57.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/57.jpg 1970-01-01 00:00:00 +0000 differ
109=== removed file 'src/system/custom/home/Pictures/58.jpg'
110Binary files src/system/custom/home/Pictures/58.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/58.jpg 1970-01-01 00:00:00 +0000 differ
111=== removed file 'src/system/custom/home/Pictures/59.jpg'
112Binary files src/system/custom/home/Pictures/59.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/59.jpg 1970-01-01 00:00:00 +0000 differ
113=== removed file 'src/system/custom/home/Pictures/60.jpg'
114Binary files src/system/custom/home/Pictures/60.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/60.jpg 1970-01-01 00:00:00 +0000 differ
115=== removed file 'src/system/custom/home/Pictures/61.jpg'
116Binary files src/system/custom/home/Pictures/61.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/61.jpg 1970-01-01 00:00:00 +0000 differ
117=== removed file 'src/system/custom/home/Pictures/62.jpg'
118Binary files src/system/custom/home/Pictures/62.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/62.jpg 1970-01-01 00:00:00 +0000 differ
119=== removed file 'src/system/custom/home/Pictures/63.jpg'
120Binary files src/system/custom/home/Pictures/63.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/63.jpg 1970-01-01 00:00:00 +0000 differ
121=== removed file 'src/system/custom/home/Pictures/64.jpg'
122Binary files src/system/custom/home/Pictures/64.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/64.jpg 1970-01-01 00:00:00 +0000 differ
123=== removed file 'src/system/custom/home/Pictures/65.jpg'
124Binary files src/system/custom/home/Pictures/65.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/65.jpg 1970-01-01 00:00:00 +0000 differ
125=== removed file 'src/system/custom/home/Pictures/66.jpg'
126Binary files src/system/custom/home/Pictures/66.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/66.jpg 1970-01-01 00:00:00 +0000 differ
127=== removed file 'src/system/custom/home/Pictures/67.jpg'
128Binary files src/system/custom/home/Pictures/67.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/67.jpg 1970-01-01 00:00:00 +0000 differ
129=== removed file 'src/system/custom/home/Pictures/68.jpg'
130Binary files src/system/custom/home/Pictures/68.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/68.jpg 1970-01-01 00:00:00 +0000 differ
131=== removed file 'src/system/custom/home/Pictures/69.jpg'
132Binary files src/system/custom/home/Pictures/69.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/69.jpg 1970-01-01 00:00:00 +0000 differ
133=== removed file 'src/system/custom/home/Pictures/70.jpg'
134Binary files src/system/custom/home/Pictures/70.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/70.jpg 1970-01-01 00:00:00 +0000 differ
135=== removed file 'src/system/custom/home/Pictures/71.jpg'
136Binary files src/system/custom/home/Pictures/71.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/71.jpg 1970-01-01 00:00:00 +0000 differ
137=== removed file 'src/system/custom/home/Pictures/72.jpg'
138Binary files src/system/custom/home/Pictures/72.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/72.jpg 1970-01-01 00:00:00 +0000 differ
139=== removed file 'src/system/custom/home/Pictures/73.jpg'
140Binary files src/system/custom/home/Pictures/73.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/73.jpg 1970-01-01 00:00:00 +0000 differ
141=== removed file 'src/system/custom/home/Pictures/74.jpg'
142Binary files src/system/custom/home/Pictures/74.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/74.jpg 1970-01-01 00:00:00 +0000 differ
143=== removed file 'src/system/custom/home/Pictures/75.jpg'
144Binary files src/system/custom/home/Pictures/75.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/75.jpg 1970-01-01 00:00:00 +0000 differ
145=== removed file 'src/system/custom/home/Pictures/76.jpg'
146Binary files src/system/custom/home/Pictures/76.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/76.jpg 1970-01-01 00:00:00 +0000 differ
147=== removed file 'src/system/custom/home/Pictures/77.jpg'
148Binary files src/system/custom/home/Pictures/77.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/77.jpg 1970-01-01 00:00:00 +0000 differ
149=== removed file 'src/system/custom/home/Pictures/78.jpg'
150Binary files src/system/custom/home/Pictures/78.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/78.jpg 1970-01-01 00:00:00 +0000 differ
151=== removed file 'src/system/custom/home/Pictures/79.jpg'
152Binary files src/system/custom/home/Pictures/79.jpg 2013-08-20 15:58:47 +0000 and src/system/custom/home/Pictures/79.jpg 1970-01-01 00:00:00 +0000 differ
153=== modified file 'tests/api/test_dconf.py'
154--- tests/api/test_dconf.py 2014-02-05 16:26:04 +0000
155+++ tests/api/test_dconf.py 2014-02-12 13:51:55 +0000
156@@ -1,11 +1,14 @@
157 from autopilot.testcase import AutopilotTestCase
158+from subprocess import check_output
159 import os
160-import subprocess
161 import re
162
163 #: Path to pre-seeded custom dconf database
164 custom_dconf_key = '/custom/etc/dconf/db/custom.d/custom.key'
165
166+#: Path to the list of locked dconf keys
167+custom_lock = '/custom/etc/dconf/db/custom.d/locks/custom.lock'
168+
169 class DconfVerificationTests(AutopilotTestCase):
170
171 os.environ['DCONF_DIR'] = '/custom/etc/dconf'
172@@ -24,7 +27,7 @@
173 ck = open(custom_dconf_key, 'r')
174 except IOError:
175 print "File not found, has this image not been customized?"
176- self.asserttrue(False)
177+ self.assertTrue(False)
178
179 dconf_keys = {}
180
181@@ -48,11 +51,36 @@
182 for key, value in dconf_keys.iteritems():
183 # Properly installed dconf keys should be visible via
184 # `dconf read`
185- dval = subprocess.check_output(['dconf', 'read', key])
186+ dval = check_output(['dconf', 'read', key])
187 try:
188 self.assertEqual(dval, value)
189 except AssertionError:
190- print ""
191- print "ERROR"
192 print "%s does not match. FAILING" % key
193 self.asserttrue(False)
194+
195+ def test_dconf_lockfile(self):
196+ """
197+ In some rare cases, downstreams may wish to ship a customization
198+ and prevent end users from ever changing it. This is done by setting
199+ a dconf lock.
200+
201+ This test verifies that the dconf lock file exists, and that
202+ the contained keys cannot be changed.
203+ """
204+ # Ensure the lockfile exists first
205+ self.assertTrue(os.path.exists(custom_lock))
206+ # The error that should appear when trying to write a locked key
207+ fail_string = "error: The operation attempted to modify "\
208+ "one or more non-writable keys"
209+ # It doesn't matter what the key is set as, it should fail because
210+ # of the lock, so setting the key as a blank string
211+ locked_keyval = "' '"
212+ with open(custom_lock, 'r') as lockfile:
213+ #iterate through list of locked keys and try to change them
214+ for line in lockfile.readlines():
215+ lock_out = check_output(['dconf', 'write', line, locked_keyval])
216+ self.assertIn(fail_string, lock_out)
217+
218+
219+
220+

Subscribers

People subscribed via source and target branches

to all changes: