s3-tests/s3tests/functional/test_fuzzer.py
Kyle Marsh fc93c02963 S3 Fuzzer: Change direction towards decision tree
Fuzzer now builds requests based on a DAG that describes the request space
and attack surface.
2011-09-12 12:51:01 -07:00

35 lines
762 B
Python

import nose
import random
import string
import yaml
from s3tests.fuzz_headers import *
from nose.tools import eq_ as eq
from nose.plugins.attrib import attr
from .utils import assert_raises
_decision_graph = {}
def check_access_denied(fn, *args, **kwargs):
e = assert_raises(boto.exception.S3ResponseError, fn, *args, **kwargs)
eq(e.status, 403)
eq(e.reason, 'Forbidden')
eq(e.error_code, 'AccessDenied')
def read_graph():
graph_file = open('request_decision_graph.yml', 'r')
return yaml.safe_load(graph_file)
def test_assemble_decision():
graph = read_graph()
prng = random.Random(1)
decision = assemble_decision(graph, prng)
decision['path']
decision['method']
decision['body']
decision['headers']