Merge lp:~cypressyew/checkbox/bt-test-cleanup into lp:checkbox

Proposed by Po-Hsu Lin
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 3998
Merged at revision: 4005
Proposed branch: lp:~cypressyew/checkbox/bt-test-cleanup
Merge into: lp:checkbox
Diff against target: 245 lines (+0/-209)
2 files modified
providers/plainbox-provider-checkbox/bin/obex_send (+0/-84)
providers/plainbox-provider-checkbox/jobs/suspend.txt.in (+0/-125)
To merge this branch: bzr merge lp:~cypressyew/checkbox/bt-test-cleanup
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+270490@code.launchpad.net

Description of the change

Remove the obex_send script as it's been replaced by bluetooth_test script.
Those obex_send script related test cases are removed as well (as they're not being used anywhere now).

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1

Do we need to change any dependencies?

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

For those 2 packages here 'bluez' and 'obexd-client', they are still being used by the current obex tests.
So I think we don't need to change dependencies.
Thanks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'providers/plainbox-provider-checkbox/bin/obex_send'
2--- providers/plainbox-provider-checkbox/bin/obex_send 2014-03-20 14:01:58 +0000
3+++ providers/plainbox-provider-checkbox/bin/obex_send 1970-01-01 00:00:00 +0000
4@@ -1,84 +0,0 @@
5-#!/usr/bin/env python3
6-
7-import os
8-import sys
9-import time
10-import dbus
11-import dbus.service
12-import dbus.mainloop.glib
13-
14-from gi.repository import GObject
15-
16-class Agent(dbus.service.Object):
17- def __init__(self, conn=None, obj_path=None):
18- dbus.service.Object.__init__(self, conn, obj_path)
19-
20- @dbus.service.method("org.openobex.Agent",
21- in_signature="o", out_signature="s")
22- def Request(self, path):
23- print("Transfer Request")
24- self.transfer = dbus.Interface(bus.get_object("org.openobex.client",
25- path),
26- "org.openobex.Transfer")
27- properties = self.transfer.GetProperties()
28- for key in list(properties.keys()):
29- print(" %s = %s" % (key, properties[key]))
30- self.start = True
31- return ""
32-
33- @dbus.service.method("org.openobex.Agent",
34- in_signature="ot", out_signature="")
35- def Progress(self, path, transferred):
36- if (self.start):
37- print("Transfer Started")
38- properties = self.transfer.GetProperties()
39- self.transfer_size = properties['Size']
40- self.start_time = time.time()
41- self.start = False
42- else:
43- speed = transferred / abs((time.time() - self.start_time) * 1000)
44- progress = ("(" + str(transferred) + "/" + str(self.transfer_size)
45- + " bytes) @ " + str(int(speed)) + " kB/s")
46- out = "\rTransfer progress " + progress
47- sys.stdout.write(out)
48- sys.stdout.flush()
49- return
50-
51- @dbus.service.method("org.openobex.Agent",
52- in_signature="o", out_signature="")
53- def Complete(self, path):
54- print("\nTransfer finished")
55- return
56-
57- @dbus.service.method("org.openobex.Agent",
58- in_signature="os", out_signature="")
59- def Error(self, path, error):
60- print("\nTransfer finished with an error: %s" % (error))
61- return
62-
63- @dbus.service.method("org.openobex.Agent",
64- in_signature="", out_signature="")
65- def Release(self):
66- mainloop.quit()
67- return
68-
69-if __name__ == '__main__':
70- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
71-
72- bus = dbus.SessionBus()
73- client = dbus.Interface(bus.get_object("org.openobex.client", "/"),
74- "org.openobex.Client")
75-
76- if (len(sys.argv) < 3):
77- print("Usage: %s <device> <file> [file*]" % (sys.argv[0]))
78- sys.exit(1)
79-
80- path = "/test/agent"
81- agent = Agent(bus, path)
82-
83- mainloop = GObject.MainLoop()
84- files = [os.path.realpath(f) for f in sys.argv[2:]]
85-
86- client.SendFiles({"Destination": sys.argv[1]}, files, path)
87-
88- mainloop.run()
89
90=== modified file 'providers/plainbox-provider-checkbox/jobs/suspend.txt.in'
91--- providers/plainbox-provider-checkbox/jobs/suspend.txt.in 2015-09-08 22:04:46 +0000
92+++ providers/plainbox-provider-checkbox/jobs/suspend.txt.in 2015-09-09 07:51:29 +0000
93@@ -132,35 +132,6 @@
94 _description:
95 This test executes iperf connection performance/stability against the broadband device found on the system before suspend.
96
97-
98-plugin: shell
99-category_id: 2013.com.canonical.plainbox::suspend
100-id: suspend/bluetooth_obex_before_suspend
101-estimated_duration: 10.0
102-requires:
103- package.name == 'bluez'
104- package.name == 'obexd-client'
105- device.category == 'BLUETOOTH'
106-command:
107- if [ -z "$BTDEVADDR" ]
108- then
109- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
110- exit 1
111- fi
112- if rfkill list bluetooth | grep -q 'Hard blocked: yes'
113- then
114- echo "rfkill shows BT is hard blocked"
115- fi
116- if rfkill list bluetooth | grep -q 'Soft blocked: yes'
117- then
118- echo "rfkill shows BT is soft blocked, removing before testing."
119- rfkill unblock bluetooth
120- sleep 3
121- fi
122- obex_send $BTDEVADDR $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg
123-_description:
124- This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable.
125-
126 plugin: shell
127 category_id: 2013.com.canonical.plainbox::suspend
128 id: suspend/bluetooth_obex_send_before_suspend
129@@ -247,25 +218,6 @@
130
131 plugin: user-interact-verify
132 category_id: 2013.com.canonical.plainbox::suspend
133-id: suspend/bluetooth_obex_before_suspend_manual
134-estimated_duration: 120.0
135-requires:
136- package.name == 'bluez'
137- package.name == 'obexd-client'
138- device.category == 'BLUETOOTH'
139-command: rfkill unblock bluetooth; obex_send `bluetooth_scan` $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg
140-_description:
141- PURPOSE:
142- This test will send the image 'JPEG_Color_Image_Ubuntu.jpg' to a specified device
143- STEPS:
144- 1. Make sure Bluetooth is enabled by checking the Bluetooth indicator applet
145- 2. Click "Test" and you will be prompted to enter the Bluetooth device name of a device that can accept file transfers (It may take a few moments after entering the name for the file to begin sending)
146- 3. Accept any prompts that appear on both devices
147- VERIFICATION:
148- Was the data correctly transferred?
149-
150-plugin: user-interact-verify
151-category_id: 2013.com.canonical.plainbox::suspend
152 id: suspend/suspend_advanced
153 requires:
154 sleep.mem == 'supported'
155@@ -1295,64 +1247,6 @@
156
157 plugin: shell
158 category_id: 2013.com.canonical.plainbox::suspend
159-id: suspend/bluetooth_obex_after_suspend
160-depends: suspend/suspend_advanced suspend/bluetooth_obex_before_suspend
161-estimated_duration: 10.0
162-requires:
163- package.name == 'bluez'
164- package.name == 'obexd-client'
165- device.category == 'BLUETOOTH'
166-command:
167- if [ -z "$BTDEVADDR" ]
168- then
169- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
170- exit 1
171- fi
172- if rfkill list bluetooth | grep -q 'Hard blocked: yes'
173- then
174- echo "rfkill shows BT is hard blocked"
175- fi
176- if rfkill list bluetooth | grep -q 'Soft blocked: yes'
177- then
178- echo "rfkill shows BT is soft blocked, removing before testing."
179- rfkill unblock bluetooth
180- sleep 3
181- fi
182- obex_send $BTDEVADDR $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg
183-_description:
184- This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable.
185-
186-plugin: shell
187-category_id: 2013.com.canonical.plainbox::suspend
188-id: suspend/bluetooth_obex_after_suspend_auto
189-depends: suspend/suspend_advanced_auto suspend/bluetooth_obex_before_suspend
190-estimated_duration: 10.0
191-requires:
192- package.name == 'bluez'
193- package.name == 'obexd-client'
194- device.category == 'BLUETOOTH'
195-command:
196- if [ -z "$BTDEVADDR" ]
197- then
198- echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini"
199- exit 1
200- fi
201- if rfkill list bluetooth | grep -q 'Hard blocked: yes'
202- then
203- echo "rfkill shows BT is hard blocked"
204- fi
205- if rfkill list bluetooth | grep -q 'Soft blocked: yes'
206- then
207- echo "rfkill shows BT is soft blocked, removing before testing."
208- rfkill unblock bluetooth
209- sleep 3
210- fi
211- obex_send $BTDEVADDR $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg
212-_description:
213- This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable.
214-
215-plugin: shell
216-category_id: 2013.com.canonical.plainbox::suspend
217 id: suspend/bluetooth_obex_send_after_suspend
218 depends: suspend/suspend_advanced
219 estimated_duration: 10.0
220@@ -1527,25 +1421,6 @@
221
222 plugin: user-interact-verify
223 category_id: 2013.com.canonical.plainbox::suspend
224-id: suspend/bluetooth_obex_after_suspend_manual
225-depends: suspend/suspend_advanced suspend/bluetooth_obex_before_suspend_manual
226-estimated_duration: 120.0
227-requires:
228- package.name == 'bluez'
229- package.name == 'obexd-client'
230- device.category == 'BLUETOOTH'
231-command: rfkill unblock bluetooth; obex_send `bluetooth_scan` $PLAINBOX_PROVIDER_DATA/images/JPEG_Color_Image_Ubuntu.jpg
232-_description:
233- PURPOSE:
234- This test will send the image 'JPEG_Color_Image_Ubuntu.jpg' to a specified device
235- STEPS:
236- 1. Click "Test" and you will be prompted to enter the Bluetooth device name of a device that can accept file transfers (It may take a few moments after entering the name for the file to begin sending)
237- 2. Accept any prompts that appear on both devices
238- VERIFICATION:
239- Was the data correctly transferred?
240-
241-plugin: user-interact-verify
242-category_id: 2013.com.canonical.plainbox::suspend
243 id: suspend/cycle_resolutions_after_suspend
244 estimated_duration: 120.0
245 requires: package.name == 'xorg'

Subscribers

People subscribed via source and target branches