Created
          May 3, 2012 01:55 
        
      - 
      
- 
        Save stackedsax/2582499 to your computer and use it in GitHub Desktop. 
    poor man's flynnid.py for registering android emulators in bash
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| HUB_HOST="hostname" | |
| HUB_PORT="4444" | |
| LOCAL_IP="ip" | |
| SOCAT_PORT="8081" | |
| JSON="{'configuration': {'registerCycle': 5000, 'hub': 'http://<HUB_HOST>:<HUB_PORT>/grid/register', 'host': '<LOCAL_IP>', 'proxy': 'org.openqa.grid.selenium.proxy.DefaultRemoteProxy', 'maxSession': 1, 'port': <SOCAT_PORT>, 'hubPort': <HUB_PORT>, 'hubHost': '<HUB_HOST>', 'url': 'http://<LOCAL_IP>:<SOCAT_PORT>', 'remoteHost': 'http://<LOCAL_IP>:<SOCAT_PORT>', 'register': true, 'role': 'node'}, 'class': 'org.openqa.grid.common.RegistrationRequest', 'capabilities': [{'seleniumProtocol': 'WebDriver', 'platform': 'ANDROID', 'browserName': 'android', 'version': null, 'maxInstances': 1}]}" | |
| JSON=${JSON//<HUB_HOST>/$HUB_HOST} | |
| JSON=${JSON//<HUB_PORT>/$HUB_PORT} | |
| JSON=${JSON//<LOCAL_IP>/$LOCAL_IP} | |
| JSON=${JSON//<SOCAT_PORT>/$SOCAT_PORT} | |
| echo json is: ${JSON} | |
| curl -X POST -d "${JSON}" http://$HUB_HOST:$HUB_PORT/grid/register | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment