andresp@webrtc.org | 468516c | 2014-09-02 10:52:54 +0000 | [diff] [blame] | 1 | === RTCBot === |
| 2 | RTCBot is a framework to write tests that need to spawn multiple webrtc |
| 3 | endpoints. |
| 4 | |
| 5 | == Description == |
| 6 | RTCBot is a framework that allows to write tests where logic runs on a single |
| 7 | host that controls multiple endpoints ("bots"). It allows creating complex |
| 8 | scenarios that would otherwise require non-trival signalling between multiple |
| 9 | parties. |
| 10 | |
| 11 | The host runs in node.js, but the test code is run in an isolated context with |
| 12 | no access to node.js specifics other than the exposed api via a test variable. |
| 13 | |
| 14 | Part of the exposed api (test.spawnBot) allows a test to spawn a bot and |
houssainy@google.com | c77e4d6 | 2014-09-08 10:36:11 +0000 | [diff] [blame] | 15 | access its exposed API. Details are in botmanager.js. |
andresp@webrtc.org | 468516c | 2014-09-02 10:52:54 +0000 | [diff] [blame] | 16 | |
| 17 | == How to run the test == |
| 18 | $ cd trunk/webrtc/tool/rtcbot |
| 19 | $ npm install express browserify ws websocket-stream dnode |
houssainy@google.com | e9b7d03 | 2014-10-22 16:34:25 +0000 | [diff] [blame] | 20 | $ mkdir configurations |
| 21 | $ cd configurations |
| 22 | $ openssl genrsa -out priv.pem 1024 |
| 23 | $ openssl req -x509 -new -key priv.pem -days 3650 -out cert.crt |
| 24 | $ cd trunk/webrtc/tool/rtcbot |
andresp@webrtc.org | 458c2c3 | 2014-10-16 07:36:37 +0000 | [diff] [blame] | 25 | $ node main.js "<test_name>" |
| 26 | |
houssainy@google.com | e9b7d03 | 2014-10-22 16:34:25 +0000 | [diff] [blame] | 27 | * Note: |
| 28 | In first time you will use rtcBot you will receive a warning telling |
| 29 | you that your connection is not private. Just avoid this warning and |
| 30 | click Proceed to localhost (unsafe). |
| 31 | |
andresp@webrtc.org | 458c2c3 | 2014-10-16 07:36:37 +0000 | [diff] [blame] | 32 | == How can I see the list of available tests? == |
| 33 | $ node main.js |
andresp@webrtc.org | 468516c | 2014-09-02 10:52:54 +0000 | [diff] [blame] | 34 | |
| 35 | == Example on how to install nodejs == |
| 36 | $ cd /work/tools/ |
| 37 | $ git clone https://github.com/creationix/nvm.git |
| 38 | $ export NVM_DIR=/work/tools/nvm; source $NVM_DIR/nvm.sh |
| 39 | $ nvm install 0.10 |
| 40 | $ nvm use 0.10 |
houssainy@google.com | c77e4d6 | 2014-09-08 10:36:11 +0000 | [diff] [blame] | 41 | |
houssainy@google.com | e9b7d03 | 2014-10-22 16:34:25 +0000 | [diff] [blame] | 42 | == Why generating the private key and self signed certificate? == |
| 43 | - Private key and certificate are used for creating HTTPs server in |
| 44 | rtcBot for loading the required files on the different types of the bots. |
| 45 | |
houssainy@google.com | 3e2f8ff | 2014-10-15 15:01:11 +0000 | [diff] [blame] | 46 | == Supported Bot Types == |
| 47 | - "chrome": chrome on host machine. |
| 48 | - "android-chrome": chrome on android device. Details in "Android" Section. |
| 49 | |
andresp@webrtc.org | 458c2c3 | 2014-10-16 07:36:37 +0000 | [diff] [blame] | 50 | * Bot type is specified directly by the test. |
houssainy@google.com | 3e2f8ff | 2014-10-15 15:01:11 +0000 | [diff] [blame] | 51 | |
houssainy@google.com | c77e4d6 | 2014-09-08 10:36:11 +0000 | [diff] [blame] | 52 | == Android == |
| 53 | Before running test with Android one MUST forward the device port 8080 to the |
| 54 | host machine. That is easy to achieve with chrome port forwarding tools. |
| 55 | - Visit chrome://inspect/devices on the host machine. |
| 56 | - Configure and enable port forwarding 8080 -> localhost:8080 |
houssainy@google.com | 9600519 | 2014-09-08 13:01:40 +0000 | [diff] [blame] | 57 | - Open chrome on you Android device before running test, and leave it |
| 58 | running until the end of test. |
| 59 | - Run your test. |