~pedronis/ubuntu-push/automatic-land-to-vivid

« back to all changes in this revision

Viewing changes to tests/autopilot/push_notifications/README

  • Committer: CI bot
  • Author(s): Richard Huddie, CI bot, Roberto Alsina, Guillermo Gonzalez, John R. Lenton, Samuele Pedroni (Canonical Services Ltd.)
  • Date: 2014-07-21 14:17:24 UTC
  • mfrom: (91.1.177 trunk)
  • Revision ID: ps-jenkins@lists.canonical.com-20140721141724-zf0n470ryo5k4dmd
  [Samuele Pedroni]
  * Check in the api whether an app has pushed too many notifications.
  * Return payload of most recent notification in too many pending
    notifications API error.
  * Introduce clear_pending flag to clean everything pending for an app.
  * Refactor and cleanup.
  * Introduce replace_tag support in store and api, with acceptance test.
  * Teach a couple of trick to cmd/acceptanceclient: exit on run timeout,
    wait for event matching given regexp pattern.
  * Limit unicast data payload to 2K.
  * Payload should be json (fixes message needing to be base64-encoded in
    helper reply)
  * Implement limited mboxes
  * Refactor and cleanup of things done in haste by Chipaca.

  [Richard Huddie]
  * autopilot test framework and basic coverage of broadcast notifications.

  [Guillermo Gonzalez]
  * Add scripts to simplify setup/run of the autopilot tests in the
    device/emulator and include basic unicast tests.
  * Add autopilot test for notification using the emblem counter.
  * Adds scenarios to the autopilot tests for legacy and click (without
    version) applications.
  * Broadcast via the helpers route.
  * Basic support for actions (only default action) in the persistent
    notifications.
  * Change PostBroadcast to send the broadcast message to the software
    updates helper.

  [John R. Lenton]
  * Detangle client and postal.
  * Introduce PostalService interface, and change the client tests to use
    that as much as reasonable.
  * Async invocation of helpers.
  * Give click.Click knowledge of helpers.
  * Write ual-based helper launcher.
  * Switch to the ual-based helper launcher unless the environment
    variable UBUNTU_PUSH_USE_TRIVIAL_HELPER is set.
  * Threw together an implementation of helpers for legacy applications.
  * Hacked up an initial software updates helper, to be handed off to the
    appropriate team shortly.

  [Roberto Alsina]
  * Wrap the (dbus) WindowStack API and add endpoint to the Postal service
    to support inhibition of notifications for focused apps.
  * Inhibit notifications for focused apps
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
==================
 
2
README
 
3
==================
 
4
 
 
5
To run ubuntu-push autopilot tests you need to have a push server available. This can be running locally using loopback (127.0.0.1) or remotely on the same network.
 
6
 
 
7
----------------------------------
 
8
To configure and build the server:
 
9
----------------------------------
 
10
 
 
11
1) export GOPATH=${PWD}/push
 
12
2) mkdir -p push/src/launchpad.net
 
13
3) cd push/src/launchpad.net
 
14
4) bzr branch lp:ubuntu-push
 
15
5) Edit ubuntu-push/sampleconfigs/dev.json with the correct server IP address and ports.
 
16
   E.g. for a server IP address 192.168.1.2 use:
 
17
    "addr": "192.168.1.2:9090",
 
18
    "http_addr": "192.168.1.2:8080",
 
19
6) cd ubuntu-push
 
20
7) ensure all dependencies are installed: sudo apt-get build-dep ubuntu-push
 
21
8) install additional cm tools: sudo apt-get install git mercurial
 
22
9) make bootstrap
 
23
10) make run-server-dev
 
24
   Following output should be observed:
 
25
     INFO listening for http on 192.168.1.2:8080
 
26
     INFO listening for devices on 192.168.1.2:9090
 
27
 
 
28
------------------------
 
29
To configure the client:
 
30
------------------------
 
31
 
 
32
Install depenendencies:
 
33
 
 
34
1) sudo apt-get install unity8-autopilot unity-click-scope
 
35
   Note: unity-click-scope is required for unity8-autopilot tests and is currently required for running tests on emulator.
 
36
2) bzr branch lp:ubuntu-push
 
37
3) Edit ip address and ports to match environment: ubuntu-push/tests/autopilot/push_notifications/config/push.conf:
 
38
    [config]
 
39
    addr = 192.168.1.2
 
40
    listener_port = 8080
 
41
    device_port = 9090
 
42
    cert_pem_file = testing.cert
 
43
4) initctl stop unity8
 
44
5) cd ubuntu-push/tests/autopilot
 
45
6) autopilot3 list push_notifications
 
46
7) autopilot3 run push_notifications
 
47
8) To run a specific test case use the test case identifier from the list command:
 
48
     - e.g. autopilot3 run push_notifications.tests.test_broadcast_notifications.TestPushClientBroadcast.test_broadcast_push_notification
 
49
 
 
50
----------------
 
51
Troubleshooting:
 
52
----------------
 
53
 
 
54
1) Ping from client to server to ensure connectivity is correct
 
55
2) Delete ~/.local/share/ubuntu-push-client/levels.db if no notifications are being displayed:
 
56
    rm ~/.local/share-ubuntu-push-client/levels.db
 
57
3) Check client log file at ~/.cache/upstart/ubuntu-push-client.log:
 
58
    tail -f --line=30 ~/.cache/upstart/ubuntu-push-client.log
 
59
4) To send a notification manually:
 
60
     echo '{"channel":"system", "data": {"ubuntu-touch/utopic-proposed/mako": [94, ""]}, "expire_on": "2015-12-19T16:39:57-08:00"}' | POST -c application/json http://192.168.1.2:8080/broadcast
 
61
   Response should be:
 
62
     {"ok":true}
 
63
   Note that:
 
64
     - The channel and device names must match the client.
 
65
     - The build number must be greater than current installed version in order to trigger an update message.
 
66
     - The expiration time must be in the future.
 
67
5) Ensure unity8-autopilot is installed
 
68
6) Ensure unity8 is not running before executing the tests:
 
69
     - initctl stop unity8
 
70
7) Unity8 has a 2 minute timeout period, so stopping and starting it can take up to this long.
 
71
8) If device/emulator is unresponsive then reboot and stop unity8 before re-running the tests (initctl stop unity8).
 
72
9) To get additional autopilot logging use -v option:
 
73
     - autopilot3 run -v push_notifications
 
74