Merge lp:~jonas-drange/ubuntu-system-settings/add-usc-test-dep into lp:ubuntu-system-settings
- add-usc-test-dep
- Merge into trunk
Proposed by
Jonas G. Drange
Status: | Superseded |
---|---|
Proposed branch: | lp:~jonas-drange/ubuntu-system-settings/add-usc-test-dep |
Merge into: | lp:ubuntu-system-settings |
Diff against target: |
498 lines (+102/-151) 9 files modified
debian/control (+4/-3) plugins/wifi/CMakeLists.txt (+0/-1) plugins/wifi/CertDialog.qml (+37/-10) plugins/wifi/CertPicker.qml (+0/-58) plugins/wifi/OtherNetwork.qml (+34/-12) plugins/wifi/certhandler.cpp (+24/-22) plugins/wifi/certhandler.h (+3/-4) tests/autopilot/ubuntu_system_settings/__init__.py (+0/-32) tests/autopilot/ubuntu_system_settings/tests/test_vpn.py (+0/-9) |
To merge this branch: | bzr merge lp:~jonas-drange/ubuntu-system-settings/add-usc-test-dep |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
system-apps-ci-bot | continuous-integration | Needs Fixing | |
Ubuntu Touch System Settings | Pending | ||
Review via email: mp+308771@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-10-19.
Commit message
adds test dep on usc
Description of the change
To post a comment you must log in.
- 1660. By Jonas G. Drange
-
add usc test dep
- 1661. By Jonas G. Drange
-
be specific of version in usc test dep
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
review:
Needs Fixing
(continuous-integration)
- 1662. By Jonas G. Drange
-
merge prereq
- 1663. By Jonas G. Drange
-
bump test dep
Unmerged revisions
- 1663. By Jonas G. Drange
-
bump test dep
- 1662. By Jonas G. Drange
-
merge prereq
- 1661. By Jonas G. Drange
-
be specific of version in usc test dep
- 1660. By Jonas G. Drange
-
add usc test dep
- 1659. By Jonas G. Drange
-
apply filepicker patch
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2016-09-30 13:48:06 +0000 | |||
3 | +++ debian/control 2016-10-19 07:36:02 +0000 | |||
4 | @@ -45,7 +45,8 @@ | |||
5 | 45 | dpkg-dev, | 45 | dpkg-dev, |
6 | 46 | qml-module-qttest, | 46 | qml-module-qttest, |
7 | 47 | qml-module-qtquick2, | 47 | qml-module-qtquick2, |
9 | 48 | qtdeclarative5-ubuntu-ui-toolkit-plugin | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles, | 48 | qml-module-ubuntu-components | qml-module-ubuntu-components-gles, |
10 | 49 | qtdeclarative5-ubuntu-settings-components, | ||
11 | 49 | libubuntuoneauth-2.0-dev, | 50 | libubuntuoneauth-2.0-dev, |
12 | 50 | libqtdbusmock1-dev (>= 0.2+14.04.20140724), | 51 | libqtdbusmock1-dev (>= 0.2+14.04.20140724), |
13 | 51 | libqtdbustest1-dev, | 52 | libqtdbustest1-dev, |
14 | @@ -95,8 +96,8 @@ | |||
15 | 95 | qml-module-ofono (>=0.90~), | 96 | qml-module-ofono (>=0.90~), |
16 | 96 | qml-module-qtsysteminfo, | 97 | qml-module-qtsysteminfo, |
17 | 97 | qtdeclarative5-ubuntu-content1, | 98 | qtdeclarative5-ubuntu-content1, |
20 | 98 | qtdeclarative5-ubuntu-settings-components (>= 0.8), | 99 | qtdeclarative5-ubuntu-settings-components (>= 0.9), |
21 | 99 | qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1584) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1584), | 100 | qml-module-ubuntu-components (>= 1.3.1584) | qml-module-ubuntu-components-gles (>= 1.3.1584), |
22 | 100 | suru-icon-theme (>= 14.04+15.04.20150813~), | 101 | suru-icon-theme (>= 14.04+15.04.20150813~), |
23 | 101 | whoopsie-preferences (>= 0.9), | 102 | whoopsie-preferences (>= 0.9), |
24 | 102 | libsystemsettings1 (= ${binary:Version}), | 103 | libsystemsettings1 (= ${binary:Version}), |
25 | 103 | 104 | ||
26 | === modified file 'plugins/wifi/CMakeLists.txt' | |||
27 | --- plugins/wifi/CMakeLists.txt 2016-08-16 23:50:33 +0000 | |||
28 | +++ plugins/wifi/CMakeLists.txt 2016-10-19 07:36:02 +0000 | |||
29 | @@ -1,7 +1,6 @@ | |||
30 | 1 | set(QML_SOURCES | 1 | set(QML_SOURCES |
31 | 2 | AccessPoint.qml | 2 | AccessPoint.qml |
32 | 3 | BaseMenuItem.qml | 3 | BaseMenuItem.qml |
33 | 4 | CertPicker.qml | ||
34 | 5 | CertDialog.qml | 4 | CertDialog.qml |
35 | 6 | Common.qml | 5 | Common.qml |
36 | 7 | DivMenuItem.qml | 6 | DivMenuItem.qml |
37 | 8 | 7 | ||
38 | === modified file 'plugins/wifi/CertDialog.qml' | |||
39 | --- plugins/wifi/CertDialog.qml 2015-08-10 13:31:45 +0000 | |||
40 | +++ plugins/wifi/CertDialog.qml 2016-10-19 07:36:02 +0000 | |||
41 | @@ -27,6 +27,30 @@ | |||
42 | 27 | } | 27 | } |
43 | 28 | } | 28 | } |
44 | 29 | 29 | ||
45 | 30 | Component { | ||
46 | 31 | id: failedToImportComponent | ||
47 | 32 | Dialog { | ||
48 | 33 | id: failedToImportDialog | ||
49 | 34 | title: { | ||
50 | 35 | if (certType === 0) { // certificate | ||
51 | 36 | return i18n.tr("Could not save certificate.") | ||
52 | 37 | } else if (certType === 1) { // privatekey | ||
53 | 38 | return i18n.tr("Could not save key.") | ||
54 | 39 | } else if (certType === 2) { // pacFile | ||
55 | 40 | return i18n.tr("Could not save pack file.") | ||
56 | 41 | } | ||
57 | 42 | } | ||
58 | 43 | |||
59 | 44 | Button { | ||
60 | 45 | text: i18n.tr("OK") | ||
61 | 46 | onClicked: { | ||
62 | 47 | PopupUtils.close(failedToImportDialog); | ||
63 | 48 | PopupUtils.close(certDialog); | ||
64 | 49 | } | ||
65 | 50 | } | ||
66 | 51 | } | ||
67 | 52 | } | ||
68 | 53 | |||
69 | 30 | FileHandler { | 54 | FileHandler { |
70 | 31 | id: fileHandler | 55 | id: fileHandler |
71 | 32 | } | 56 | } |
72 | @@ -64,7 +88,6 @@ | |||
73 | 64 | Layout.fillWidth: true | 88 | Layout.fillWidth: true |
74 | 65 | text: i18n.tr("Cancel") | 89 | text: i18n.tr("Cancel") |
75 | 66 | onClicked: { | 90 | onClicked: { |
76 | 67 | fileHandler.removeFile(certDialog.fileName); | ||
77 | 68 | PopupUtils.close(certDialog); | 91 | PopupUtils.close(certDialog); |
78 | 69 | } | 92 | } |
79 | 70 | } | 93 | } |
80 | @@ -74,19 +97,23 @@ | |||
81 | 74 | text: i18n.tr("Save") | 97 | text: i18n.tr("Save") |
82 | 75 | Layout.fillWidth: true | 98 | Layout.fillWidth: true |
83 | 76 | enabled: (certDialog.certContent.text !== "") | 99 | enabled: (certDialog.certContent.text !== "") |
86 | 77 | onClicked: { if (certType === 0) { // certificate | 100 | onClicked: { |
87 | 78 | fileHandler.moveCertFile(certDialog.fileName); | 101 | var ret; |
88 | 102 | if (certType === 0) { // certificate | ||
89 | 103 | ret = fileHandler.copyCertFile(certDialog.fileName); | ||
90 | 79 | } else if (certType === 1) { // privatekey | 104 | } else if (certType === 1) { // privatekey |
92 | 80 | fileHandler.moveKeyFile(certDialog.fileName); | 105 | ret = fileHandler.copyKeyFile(certDialog.fileName); |
93 | 81 | } else if (certType === 2) { // pacFile | 106 | } else if (certType === 2) { // pacFile |
95 | 82 | fileHandler.movePacFile(certDialog.fileName); | 107 | ret = fileHandler.copyPacFile(certDialog.fileName); |
96 | 83 | } | 108 | } |
97 | 84 | 109 | ||
103 | 85 | /* Just to be sure source file will be deleted if move was | 110 | // If the cert/key/pac doesn't compute, warn. |
104 | 86 | not successfull */ | 111 | if (!ret) { |
105 | 87 | fileHandler.removeFile(certDialog.fileName); | 112 | PopupUtils.open(failedToImportComponent); |
106 | 88 | certDialog.updateSignal(true); | 113 | } else { |
107 | 89 | PopupUtils.close(certDialog); | 114 | certDialog.updateSignal(true); |
108 | 115 | PopupUtils.close(certDialog); | ||
109 | 116 | } | ||
110 | 90 | } | 117 | } |
111 | 91 | } | 118 | } |
112 | 92 | } | 119 | } |
113 | 93 | 120 | ||
114 | === removed file 'plugins/wifi/CertPicker.qml' | |||
115 | --- plugins/wifi/CertPicker.qml 2016-03-16 16:26:18 +0000 | |||
116 | +++ plugins/wifi/CertPicker.qml 1970-01-01 00:00:00 +0000 | |||
117 | @@ -1,58 +0,0 @@ | |||
118 | 1 | import QtQuick 2.4 | ||
119 | 2 | import QtQuick.Layouts 1.1 | ||
120 | 3 | import Ubuntu.Components 1.3 | ||
121 | 4 | import Ubuntu.Components.Popups 1.3 | ||
122 | 5 | import Ubuntu.Content 1.3 | ||
123 | 6 | |||
124 | 7 | PopupBase { | ||
125 | 8 | id: picker | ||
126 | 9 | |||
127 | 10 | signal fileImportSignal (var file) | ||
128 | 11 | property var activeTransfer | ||
129 | 12 | |||
130 | 13 | Rectangle { | ||
131 | 14 | anchors.fill: parent | ||
132 | 15 | |||
133 | 16 | ContentTransferHint { | ||
134 | 17 | id: transferHint | ||
135 | 18 | anchors.fill: parent | ||
136 | 19 | activeTransfer: picker.activeTransfer | ||
137 | 20 | } | ||
138 | 21 | |||
139 | 22 | ContentStore { | ||
140 | 23 | id: appStore | ||
141 | 24 | scope: ContentScope.App | ||
142 | 25 | } | ||
143 | 26 | |||
144 | 27 | ContentPeerPicker { | ||
145 | 28 | id: peerPicker | ||
146 | 29 | anchors.fill: parent | ||
147 | 30 | visible: true | ||
148 | 31 | contentType: ContentType.Documents | ||
149 | 32 | handler: ContentHandler.Source | ||
150 | 33 | onPeerSelected: { | ||
151 | 34 | peer.selectionType = ContentTransfer.Single; | ||
152 | 35 | picker.activeTransfer = peer.request(appStore); | ||
153 | 36 | } | ||
154 | 37 | onCancelPressed: PopupUtils.close(picker) | ||
155 | 38 | } | ||
156 | 39 | } | ||
157 | 40 | |||
158 | 41 | Connections { | ||
159 | 42 | target: picker.activeTransfer ? picker.activeTransfer : null | ||
160 | 43 | onStateChanged: { | ||
161 | 44 | if (picker.activeTransfer.state === ContentTransfer.Charged) { | ||
162 | 45 | if (picker.activeTransfer.items.length > 0) { | ||
163 | 46 | var fileUrl = picker.activeTransfer.items[0].url; | ||
164 | 47 | picker.fileImportSignal( | ||
165 | 48 | fileUrl.toString().replace("file://", "") | ||
166 | 49 | ); | ||
167 | 50 | PopupUtils.close(picker); | ||
168 | 51 | } | ||
169 | 52 | } else if (picker.activeTransfer.state === ContentTransfer.Aborted){ | ||
170 | 53 | picker.fileImportSignal(false); | ||
171 | 54 | PopupUtils.close(picker); | ||
172 | 55 | } | ||
173 | 56 | } | ||
174 | 57 | } | ||
175 | 58 | } | ||
176 | 59 | 0 | ||
177 | === modified file 'plugins/wifi/OtherNetwork.qml' | |||
178 | --- plugins/wifi/OtherNetwork.qml 2016-08-17 11:26:03 +0000 | |||
179 | +++ plugins/wifi/OtherNetwork.qml 2016-10-19 07:36:02 +0000 | |||
180 | @@ -20,18 +20,25 @@ | |||
181 | 20 | import Ubuntu.Components 1.3 | 20 | import Ubuntu.Components 1.3 |
182 | 21 | import Ubuntu.Components.ListItems 1.3 as ListItems | 21 | import Ubuntu.Components.ListItems 1.3 as ListItems |
183 | 22 | import Ubuntu.Components.Popups 1.3 | 22 | import Ubuntu.Components.Popups 1.3 |
184 | 23 | import Ubuntu.Settings.Components 0.1 | ||
185 | 23 | import Ubuntu.SystemSettings.Wifi 1.0 | 24 | import Ubuntu.SystemSettings.Wifi 1.0 |
186 | 24 | 25 | ||
187 | 25 | Component { | 26 | Component { |
188 | 26 | 27 | ||
189 | 27 | Dialog { | 28 | Dialog { |
190 | 28 | 29 | ||
191 | 30 | Component { | ||
192 | 31 | id: filePickerComponent | ||
193 | 32 | FilePicker {} | ||
194 | 33 | } | ||
195 | 34 | |||
196 | 29 | id: otherNetworkDialog | 35 | id: otherNetworkDialog |
197 | 30 | objectName: "otherNetworkDialog" | 36 | objectName: "otherNetworkDialog" |
198 | 31 | anchorToKeyboard: true | 37 | anchorToKeyboard: true |
199 | 32 | 38 | ||
200 | 33 | property string ssid | 39 | property string ssid |
201 | 34 | property string bssid | 40 | property string bssid |
202 | 41 | property string keyMgmt | ||
203 | 35 | 42 | ||
204 | 36 | function settingsValid () { | 43 | function settingsValid () { |
205 | 37 | if (networkname.length === 0) { | 44 | if (networkname.length === 0) { |
206 | @@ -59,11 +66,10 @@ | |||
207 | 59 | var pickerDialog; | 66 | var pickerDialog; |
208 | 60 | var certDialog; | 67 | var certDialog; |
209 | 61 | 68 | ||
215 | 62 | pickerDialog = PopupUtils.open( | 69 | pickerDialog = PopupUtils.open(filePickerComponent); |
216 | 63 | Qt.resolvedUrl("./CertPicker.qml") | 70 | pickerDialog.accept.connect(function (file) { |
217 | 64 | ); | 71 | PopupUtils.close(pickerDialog); |
218 | 65 | pickerDialog.fileImportSignal.connect(function (file) { | 72 | if (file) { |
214 | 66 | if (!file === false) { | ||
219 | 67 | certDialogLoader.source = Qt.resolvedUrl( | 73 | certDialogLoader.source = Qt.resolvedUrl( |
220 | 68 | "./CertDialog.qml" | 74 | "./CertDialog.qml" |
221 | 69 | ); | 75 | ); |
222 | @@ -84,12 +90,13 @@ | |||
223 | 84 | }); | 90 | }); |
224 | 85 | } | 91 | } |
225 | 86 | }); | 92 | }); |
226 | 93 | pickerDialog.reject.connect(function () { | ||
227 | 94 | PopupUtils.close(pickerDialog); | ||
228 | 95 | }); | ||
229 | 87 | } | 96 | } |
230 | 88 | 97 | ||
231 | 89 | title: ssid ? | 98 | title: ssid ? |
235 | 90 | /* TODO(jgdx): Hack to avoid breaking string freeze. This will be | 99 | i18n.tr("Connect to %1").arg(ssid) : |
233 | 91 | changed to i18n.tr("Connect to %1").arg(ssid) per spec. */ | ||
234 | 92 | i18n.tr("Connect to Wi‑Fi") + " " + ssid : | ||
236 | 93 | i18n.tr("Connect to Hidden Network") | 100 | i18n.tr("Connect to Hidden Network") |
237 | 94 | text: feedback.enabled ? feedback.text : ""; | 101 | text: feedback.enabled ? feedback.text : ""; |
238 | 95 | 102 | ||
239 | @@ -322,7 +329,22 @@ | |||
240 | 322 | i18n.tr("Dynamic WEP (802.1x)"), // index: 4 | 329 | i18n.tr("Dynamic WEP (802.1x)"), // index: 4 |
241 | 323 | i18n.tr("LEAP"), // index: 5 | 330 | i18n.tr("LEAP"), // index: 5 |
242 | 324 | ] | 331 | ] |
244 | 325 | selectedIndex: 1 | 332 | selectedIndex: { |
245 | 333 | switch(keyMgmt) { | ||
246 | 334 | case 'none': // WEP | ||
247 | 335 | return 0; | ||
248 | 336 | case 'wpa-eap': // WPA-Enterprise | ||
249 | 337 | return 2; | ||
250 | 338 | case 'wep': // WEP | ||
251 | 339 | return 3; | ||
252 | 340 | case 'ieee8021x': // Dynamic WEP | ||
253 | 341 | return 4; | ||
254 | 342 | case 'wpa-none': // Ad-Hoc WPA-PSK | ||
255 | 343 | case 'wpa-psk': // infrastructure WPA-PSK | ||
256 | 344 | default: // Default is WPA | ||
257 | 345 | return 1; | ||
258 | 346 | } | ||
259 | 347 | } | ||
260 | 326 | } | 348 | } |
261 | 327 | 349 | ||
262 | 328 | Label { | 350 | Label { |
263 | @@ -357,7 +379,6 @@ | |||
264 | 357 | visible: securityList.selectedIndex === 2 || | 379 | visible: securityList.selectedIndex === 2 || |
265 | 358 | securityList.selectedIndex === 4 | 380 | securityList.selectedIndex === 4 |
266 | 359 | } | 381 | } |
267 | 360 | |||
268 | 361 | Label { | 382 | Label { |
269 | 362 | id: p2authListLabel | 383 | id: p2authListLabel |
270 | 363 | text : i18n.tr("Inner authentication") | 384 | text : i18n.tr("Inner authentication") |
271 | @@ -791,7 +812,7 @@ | |||
272 | 791 | font.bold: false | 812 | font.bold: false |
273 | 792 | color: Theme.palette.normal.baseText | 813 | color: Theme.palette.normal.baseText |
274 | 793 | elide: Text.ElideRight | 814 | elide: Text.ElideRight |
276 | 794 | visible: securityList.selectedIndex !== 0 | 815 | visible: password.visible |
277 | 795 | } | 816 | } |
278 | 796 | 817 | ||
279 | 797 | TextField { | 818 | TextField { |
280 | @@ -799,6 +820,7 @@ | |||
281 | 799 | objectName: "password" | 820 | objectName: "password" |
282 | 800 | width: parent.width | 821 | width: parent.width |
283 | 801 | visible: securityList.selectedIndex !== 0 | 822 | visible: securityList.selectedIndex !== 0 |
284 | 823 | |||
285 | 802 | echoMode: passwordVisibleSwitch.checked ? | 824 | echoMode: passwordVisibleSwitch.checked ? |
286 | 803 | TextInput.Normal : TextInput.Password | 825 | TextInput.Normal : TextInput.Password |
287 | 804 | inputMethodHints: Qt.ImhNoPredictiveText | 826 | inputMethodHints: Qt.ImhNoPredictiveText |
288 | @@ -809,7 +831,7 @@ | |||
289 | 809 | id: passwordVisiblityRow | 831 | id: passwordVisiblityRow |
290 | 810 | layoutDirection: Qt.LeftToRight | 832 | layoutDirection: Qt.LeftToRight |
291 | 811 | spacing: units.gu(2) | 833 | spacing: units.gu(2) |
293 | 812 | visible: securityList.selectedIndex !== 0 | 834 | visible: password.visible |
294 | 813 | 835 | ||
295 | 814 | CheckBox { | 836 | CheckBox { |
296 | 815 | id: passwordVisibleSwitch | 837 | id: passwordVisibleSwitch |
297 | 816 | 838 | ||
298 | === modified file 'plugins/wifi/certhandler.cpp' | |||
299 | --- plugins/wifi/certhandler.cpp 2015-06-15 19:28:23 +0000 | |||
300 | +++ plugins/wifi/certhandler.cpp 2016-10-19 07:36:02 +0000 | |||
301 | @@ -32,19 +32,19 @@ | |||
302 | 32 | } | 32 | } |
303 | 33 | } | 33 | } |
304 | 34 | 34 | ||
306 | 35 | QString FileHandler::moveCertFile(QString filename){ | 35 | QString FileHandler::copyCertFile(QString filename){ |
307 | 36 | QDir certPath(CERTS_PATH); | 36 | QDir certPath(CERTS_PATH); |
308 | 37 | if (!certPath.exists(CERTS_PATH)){ | 37 | if (!certPath.exists(CERTS_PATH)){ |
309 | 38 | certPath.mkpath(CERTS_PATH); | 38 | certPath.mkpath(CERTS_PATH); |
310 | 39 | } | 39 | } |
311 | 40 | QFile file(filename); | ||
312 | 41 | QByteArray certificate = getCertContent(filename); | 40 | QByteArray certificate = getCertContent(filename); |
313 | 42 | QList<QSslCertificate> SslCertificateList = QSslCertificate::fromData(certificate, QSsl::Pem); | 41 | QList<QSslCertificate> SslCertificateList = QSslCertificate::fromData(certificate, QSsl::Pem); |
314 | 43 | if ( !SslCertificateList.isEmpty() ){ | 42 | if ( !SslCertificateList.isEmpty() ){ |
315 | 44 | QStringList subject = SslCertificateList[0].subjectInfo(QSslCertificate::CommonName); | 43 | QStringList subject = SslCertificateList[0].subjectInfo(QSslCertificate::CommonName); |
316 | 45 | QString modFileName = CERTS_PATH+subject[0]+".pem"; | 44 | QString modFileName = CERTS_PATH+subject[0]+".pem"; |
319 | 46 | if(file.rename(modFileName.replace(" ", "_"))){ | 45 | modFileName = modFileName.replace(" ", "_"); |
320 | 47 | return file.fileName(); | 46 | if(QFile::copy(filename, modFileName)){ |
321 | 47 | return modFileName; | ||
322 | 48 | } else { | 48 | } else { |
323 | 49 | return ""; | 49 | return ""; |
324 | 50 | } | 50 | } |
325 | @@ -52,7 +52,7 @@ | |||
326 | 52 | return ""; | 52 | return ""; |
327 | 53 | } | 53 | } |
328 | 54 | 54 | ||
330 | 55 | QString FileHandler::moveKeyFile(QString filename){ | 55 | QString FileHandler::copyKeyFile(QString filename){ |
331 | 56 | QDir keyPath(KEYS_PATH); | 56 | QDir keyPath(KEYS_PATH); |
332 | 57 | if (!keyPath.exists(KEYS_PATH)){ | 57 | if (!keyPath.exists(KEYS_PATH)){ |
333 | 58 | keyPath.mkpath(KEYS_PATH); | 58 | keyPath.mkpath(KEYS_PATH); |
334 | @@ -64,8 +64,8 @@ | |||
335 | 64 | if ( !checkKey.isNull() ){ | 64 | if ( !checkKey.isNull() ){ |
336 | 65 | QFileInfo fileInfo(file); | 65 | QFileInfo fileInfo(file); |
337 | 66 | QString modFileName = KEYS_PATH + fileInfo.fileName().replace(" ", "_"); | 66 | QString modFileName = KEYS_PATH + fileInfo.fileName().replace(" ", "_"); |
340 | 67 | if(file.rename(modFileName)){ | 67 | if(QFile::copy(filename, modFileName)){ |
341 | 68 | return file.fileName(); | 68 | return modFileName; |
342 | 69 | } else { | 69 | } else { |
343 | 70 | return "" ; | 70 | return "" ; |
344 | 71 | } | 71 | } |
345 | @@ -73,7 +73,7 @@ | |||
346 | 73 | return ""; | 73 | return ""; |
347 | 74 | } | 74 | } |
348 | 75 | 75 | ||
350 | 76 | QString FileHandler::movePacFile(QString filename){ | 76 | QString FileHandler::copyPacFile(QString filename){ |
351 | 77 | QDir keyPath(PACS_PATH); | 77 | QDir keyPath(PACS_PATH); |
352 | 78 | if (!keyPath.exists(PACS_PATH)){ | 78 | if (!keyPath.exists(PACS_PATH)){ |
353 | 79 | keyPath.mkpath(PACS_PATH); | 79 | keyPath.mkpath(PACS_PATH); |
354 | @@ -81,17 +81,12 @@ | |||
355 | 81 | QFile file(filename); | 81 | QFile file(filename); |
356 | 82 | QFileInfo fileInfo(file); | 82 | QFileInfo fileInfo(file); |
357 | 83 | QString modFileName = PACS_PATH + fileInfo.baseName().replace(" ", "_") + ".pac"; | 83 | QString modFileName = PACS_PATH + fileInfo.baseName().replace(" ", "_") + ".pac"; |
360 | 84 | if(file.rename(modFileName)){ | 84 | if(QFile::copy(filename, modFileName)){ |
361 | 85 | return file.fileName(); | 85 | return modFileName; |
362 | 86 | } | 86 | } |
363 | 87 | return "" ; | 87 | return "" ; |
364 | 88 | } | 88 | } |
365 | 89 | 89 | ||
366 | 90 | bool FileHandler::removeFile(QString filename){ | ||
367 | 91 | QFile file(filename); | ||
368 | 92 | return file.remove(); | ||
369 | 93 | } | ||
370 | 94 | |||
371 | 95 | struct CertificateListModel::Private { | 90 | struct CertificateListModel::Private { |
372 | 96 | QStringList data; | 91 | QStringList data; |
373 | 97 | }; | 92 | }; |
374 | @@ -144,8 +139,9 @@ | |||
375 | 144 | } | 139 | } |
376 | 145 | 140 | ||
377 | 146 | QVariant CertificateListModel::data(const QModelIndex &index, int role) const { | 141 | QVariant CertificateListModel::data(const QModelIndex &index, int role) const { |
378 | 142 | QVariant rv; | ||
379 | 147 | if(!index.isValid() || index.row() >= ( p->data.size()) ) { | 143 | if(!index.isValid() || index.row() >= ( p->data.size()) ) { |
381 | 148 | return QVariant(); | 144 | return rv; |
382 | 149 | } else if (index.row() == 0){ | 145 | } else if (index.row() == 0){ |
383 | 150 | const QString &row0 = p->data[index.row()]; | 146 | const QString &row0 = p->data[index.row()]; |
384 | 151 | 147 | ||
385 | @@ -168,13 +164,19 @@ | |||
386 | 168 | const QString &row = CERTS_PATH+p->data[index.row()]; | 164 | const QString &row = CERTS_PATH+p->data[index.row()]; |
387 | 169 | QList<QSslCertificate> certificate = QSslCertificate::fromPath(row, QSsl::Pem, QRegExp::Wildcard); | 165 | QList<QSslCertificate> certificate = QSslCertificate::fromPath(row, QSsl::Pem, QRegExp::Wildcard); |
388 | 170 | 166 | ||
389 | 167 | if (certificate.size() == 0) { | ||
390 | 168 | return rv; | ||
391 | 169 | } | ||
392 | 170 | |||
393 | 171 | switch(role) { | 171 | switch(role) { |
400 | 172 | 172 | case CNRole: | |
401 | 173 | case CNRole : return certificate[0].subjectInfo(QSslCertificate::CommonName)[0]; | 173 | return certificate[0].subjectInfo(QSslCertificate::CommonName).value(0, ""); |
402 | 174 | case ORole : return certificate[0].subjectInfo(QSslCertificate::Organization)[0]; | 174 | case ORole: |
403 | 175 | case expDateRole : return certificate[0].expiryDate().toString("dd.MM.yyyy"); | 175 | return certificate[0].subjectInfo(QSslCertificate::Organization).value(0, ""); |
404 | 176 | 176 | case expDateRole: | |
405 | 177 | default : return QVariant(); | 177 | return certificate[0].expiryDate().toString("dd.MM.yyyy"); |
406 | 178 | default: | ||
407 | 179 | return rv; | ||
408 | 178 | } | 180 | } |
409 | 179 | } | 181 | } |
410 | 180 | 182 | ||
411 | 181 | 183 | ||
412 | === modified file 'plugins/wifi/certhandler.h' | |||
413 | --- plugins/wifi/certhandler.h 2015-06-03 19:35:09 +0000 | |||
414 | +++ plugins/wifi/certhandler.h 2016-10-19 07:36:02 +0000 | |||
415 | @@ -11,10 +11,9 @@ | |||
416 | 11 | Q_OBJECT | 11 | Q_OBJECT |
417 | 12 | public: | 12 | public: |
418 | 13 | Q_INVOKABLE QByteArray getCertContent(QString filename); | 13 | Q_INVOKABLE QByteArray getCertContent(QString filename); |
423 | 14 | Q_INVOKABLE QString moveCertFile(QString filename); | 14 | Q_INVOKABLE QString copyCertFile(QString filename); |
424 | 15 | Q_INVOKABLE QString moveKeyFile(QString filename); | 15 | Q_INVOKABLE QString copyKeyFile(QString filename); |
425 | 16 | Q_INVOKABLE QString movePacFile(QString filename); | 16 | Q_INVOKABLE QString copyPacFile(QString filename); |
422 | 17 | Q_INVOKABLE bool removeFile(QString filename); | ||
426 | 18 | }; | 17 | }; |
427 | 19 | 18 | ||
428 | 20 | 19 | ||
429 | 21 | 20 | ||
430 | === modified file 'tests/autopilot/ubuntu_system_settings/__init__.py' | |||
431 | --- tests/autopilot/ubuntu_system_settings/__init__.py 2016-08-19 12:49:41 +0000 | |||
432 | +++ tests/autopilot/ubuntu_system_settings/__init__.py 2016-10-19 07:36:02 +0000 | |||
433 | @@ -1754,38 +1754,6 @@ | |||
434 | 1754 | self._openvpn_port_field.write(port) | 1754 | self._openvpn_port_field.write(port) |
435 | 1755 | 1755 | ||
436 | 1756 | @autopilot.logging.log_action(logger.debug) | 1756 | @autopilot.logging.log_action(logger.debug) |
437 | 1757 | def set_openvpn_ca(self, paths): | ||
438 | 1758 | self.set_openvpn_file(self._openvpn_ca_field, paths) | ||
439 | 1759 | |||
440 | 1760 | @autopilot.logging.log_action(logger.debug) | ||
441 | 1761 | def set_openvpn_file(self, field, paths): | ||
442 | 1762 | utils.dismiss_osk() | ||
443 | 1763 | self.get_root_instance().main_view.scroll_to_and_click(field) | ||
444 | 1764 | |||
445 | 1765 | # Wait for expanded animation. | ||
446 | 1766 | sleep(0.5) | ||
447 | 1767 | |||
448 | 1768 | # file = field.wait_select_single(objectName='vpnFileSelectorItem0') | ||
449 | 1769 | choose = field.wait_select_single(objectName='vpnFileSelectorItem1') | ||
450 | 1770 | self.pointing_device.click_object(choose) | ||
451 | 1771 | self.get_root_instance().main_view.scroll_to_and_click(choose) | ||
452 | 1772 | file_dialog = self.get_root_instance().wait_select_single( | ||
453 | 1773 | objectName='vpnDialogFile' | ||
454 | 1774 | ) | ||
455 | 1775 | |||
456 | 1776 | # Go to root / | ||
457 | 1777 | root = file_dialog.wait_select_single(objectName='vpnFilePathItem_/') | ||
458 | 1778 | self.pointing_device.click_object(root) | ||
459 | 1779 | |||
460 | 1780 | for path in paths: | ||
461 | 1781 | list_view = file_dialog.wait_select_single( | ||
462 | 1782 | 'QQuickListView', objectName='vpnFileList' | ||
463 | 1783 | ) | ||
464 | 1784 | list_view.click_element('vpnFileItem_%s' % path) | ||
465 | 1785 | accept = file_dialog.wait_select_single(objectName='vpnFileAccept') | ||
466 | 1786 | self.pointing_device.click_object(accept) | ||
467 | 1787 | |||
468 | 1788 | @autopilot.logging.log_action(logger.debug) | ||
469 | 1789 | def openvpn_okay(self): | 1757 | def openvpn_okay(self): |
470 | 1790 | utils.dismiss_osk() | 1758 | utils.dismiss_osk() |
471 | 1791 | self.get_root_instance().main_view.scroll_to_and_click( | 1759 | self.get_root_instance().main_view.scroll_to_and_click( |
472 | 1792 | 1760 | ||
473 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_vpn.py' | |||
474 | --- tests/autopilot/ubuntu_system_settings/tests/test_vpn.py 2016-03-09 14:03:57 +0000 | |||
475 | +++ tests/autopilot/ubuntu_system_settings/tests/test_vpn.py 2016-10-19 07:36:02 +0000 | |||
476 | @@ -35,10 +35,6 @@ | |||
477 | 35 | page.set_openvpn_server('vpn.ubuntu.com') | 35 | page.set_openvpn_server('vpn.ubuntu.com') |
478 | 36 | page.set_openvpn_custom_port('1000') | 36 | page.set_openvpn_custom_port('1000') |
479 | 37 | 37 | ||
480 | 38 | page.set_openvpn_ca( | ||
481 | 39 | # Any file will do. | ||
482 | 40 | ['etc', 'apt', 'sources.list'] | ||
483 | 41 | ) | ||
484 | 42 | page.openvpn_okay() | 38 | page.openvpn_okay() |
485 | 43 | 39 | ||
486 | 44 | self.assertThat( | 40 | self.assertThat( |
487 | @@ -47,11 +43,6 @@ | |||
488 | 47 | ) | 43 | ) |
489 | 48 | 44 | ||
490 | 49 | self.assertThat( | 45 | self.assertThat( |
491 | 50 | lambda: conn_obj.Get(VPN_CONN_OPENVPN_IFACE, 'ca'), | ||
492 | 51 | Eventually(Equals('/etc/apt/sources.list')) | ||
493 | 52 | ) | ||
494 | 53 | |||
495 | 54 | self.assertThat( | ||
496 | 55 | lambda: conn_obj.Get(VPN_CONN_OPENVPN_IFACE, 'portSet'), | 46 | lambda: conn_obj.Get(VPN_CONN_OPENVPN_IFACE, 'portSet'), |
497 | 56 | Eventually(Equals(True)) | 47 | Eventually(Equals(True)) |
498 | 57 | ) | 48 | ) |
FAILED: Continuous integration, rev:1729 /jenkins. canonical. com/system- apps/job/ lp-ubuntu- system- settings- ci/215/ /jenkins. canonical. com/system- apps/job/ build/1866/ console /jenkins. canonical. com/system- apps/job/ build-0- fetch/1867 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1707 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1707/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= yakkety/ 1707/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- apps/job/ lp-ubuntu- system- settings- ci/215/ rebuild
https:/