test_server
serves two main purposes:
- end point for your proxy tests.
- load generator via simple website driven by javascript
Behind the scenes it mainly uses ...
Possible use cases:
- Provide static data via web application to make your tests reliable
- Generate load via browsers typically used by your users
Add this line to your application's Gemfile:
gem 'test_server'
And then execute:
$ bundle
Or install it yourself as:
$ gem install test_server
# Install via yaourt
yaourt -S test_server
# Install via cower + makepkg
cower -d test_server
cd <dir>
makepkg -is
Following you can find an example configuration for iptables to secure your server. It
opens ports only for your proxy servers to access test_server
.
# default policies
iptables -P INPUT -j DROP
iptables -P FORWARD -j DROP
iptables -P OUTPUT -j ACCEPT
# user defined chains
iptables -N TCP
iptables -N UDP
# rules
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
iptables -A INPUT -p icmp -m icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT
iptables -A INPUT -p udp -m conntrack --ctstate NEW -j UDP
iptables -A INPUT -p tcp -m conntrack --ctstate NEW -j TCP
iptables -A INPUT -p tcp -m recent --set --name TCP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with tcp-reset
iptables -A INPUT -p udp -m recent --set --name UDP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with icmp-port-unreachable
iptables -A INPUT -j REJECT --reject-with icmp-proto-unreachable
iptables -A TCP -p tcp -m recent --update --seconds 60 --name TCP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with tcp-reset
iptables -A TCP -s <public ips proxies> -p tcp -m tcp --dport 8000 -j ACCEPT
iptables -A UDP -p udp -m recent --update --seconds 60 --name UDP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with icmp-port-unreachable
COMMIT
To be defined...
Starting Web Application
% test_server serve
Load testing
Point your browser to http://<your-domain.org>/v1/test/javascript/xhr/string
.
Fill out the form and run test.
Testing your proxies
- Write tests using
capybara
+rspec
.
or
- Use
proxy_tester
for a fully featured solution for writing proxy tests (RECOMMENDED).proxy_tester
usescapybara
andrspec
, but provides lots of helpers for writing proxy tests to reduce the work on your site.
To be defined. Hopefully I can provide a controller
which handles this within
the application.
- Fork it ( http://github.com//test_server/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request