Adding fuzz testing of auth
This commit is contained in:
+22
-4
@@ -1,13 +1,31 @@
|
||||
from boddle import boddle
|
||||
from groove import ondemand
|
||||
import os
|
||||
import sys
|
||||
|
||||
import atheris
|
||||
from boddle import boddle
|
||||
|
||||
from groove import ondemand
|
||||
|
||||
|
||||
def test_ondemand_server():
|
||||
def test_server():
|
||||
with boddle():
|
||||
assert ondemand.index() == 'Groovy.'
|
||||
|
||||
|
||||
def test_ondemand_auth():
|
||||
def test_auth_with_valid_credentials():
|
||||
with boddle(auth=(os.environ.get('USERNAME'), os.environ.get('PASSWORD'))):
|
||||
assert ondemand.admin() == 'Authenticated. Groovy.'
|
||||
|
||||
|
||||
def test_auth_random_input():
|
||||
|
||||
def auth(fuzzed_input):
|
||||
with boddle(auth=(fuzzed_input, fuzzed_input)):
|
||||
result = ondemand.admin()
|
||||
assert result.body == 'Access denied'
|
||||
|
||||
atheris.Setup([sys.argv[0], "-atheris_runs=100000"], auth)
|
||||
try:
|
||||
atheris.Fuzz()
|
||||
except SystemExit:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user