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.
7
----------------------------------
8
To configure and build the server:
9
----------------------------------
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",
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
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
28
------------------------
29
To configure the client:
30
------------------------
32
Install depenendencies:
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:
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
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
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:
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