Hi, I’m Ryo. Currently, I have a Web Automation using Robot Framework that requires an API Test as a preconditioning step. This scenario will run in CircleCI. When running in my Locale (my Laptop), the API Test was successful. But, when it runs in CircleCI, it gets “IP Address not registered”. This response appears because the IP Address has not been whitelisted in my configuration. But, I don’t know the IP Address to be whitelisted if the script is running in CircleCI. Can you guys help me? Thank you.
Maybe IP ranges - CircleCI helps ?
So if you set circleci_ip_ranges: true
to your yaml, you can get the list of ip addressed to whitelist on your end ?
Hi Ryo,
I gather you access the api and web app by a host name (FQDN?) rather than the IP address?
you could add a step at the beginning to your test like this:
${dnsdata}= Evaluate socket.gethostbyname_ex("your.host.name") modules=socket
For www.google.com
I get: ('www.google.com', [], ['142.250.67.4'])
This will do 2 things,:
- first on your local machine it will give you the ip address you probably want to whitelist
- second on your CI runner machine it will give you the ip address you probably need to whitelist if it’s different from what you get locally
adding this itself wont stop your test from failing but hopefully will give you what you need for the whitelist
I’m not familiar with CircleCI, but perhaps your CircleCI admins know a way to automatically add ip’s to the whitelist based on a host name withing the CI configuration, wouldn’t hurt to ask them.
Hope this helps,
Dave.
@damies13 's answer highlights quite well about the question. OP gave a random error message “IP Address not registered”
. There’s no indication of what tool generates this error.
- Is it coming from your API endpoint (my assumption)
- is it DNS issue where, in your tests your API endpoint is referred by the name and that name cannot be translated into actual IP address ?
- Is the ip address of your API endpoint on actual public ip address space ? If its not, maybe running the test from circleci is not even possible without using some sort of VPN …