Fix for minor bug with the -n parameter #37

Closed
wants to merge 3 commits into
from
@@ -29,7 +29,7 @@
import sys
from optparse import OptionParser, OptionGroup
-NO_TRAILING_SLASH_REGEX = re.compile(r'^.*?\.\w+$')
+NO_TRAILING_SLASH_REGEX = re.compile(r'^https?://(\w+\.?)+$')
def parse_options():
"""
@@ -110,6 +110,9 @@ def parse_options():
bees.up(options.servers, options.group, options.zone, options.instance, options.login, options.key)
elif command == 'attack':
+ if options.number < 2:
+ parser.error('To avoid a problem with how ab returns data for -n 1, you must make at least two requests')
+
if not options.url:
parser.error('To run an attack you need to specify a url with -u')