def request_one_block(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=Request) request.push(block) byte1 = Byte(0x01, name="Byte block 1") byte2 = Byte(0x02, name="Byte block 2") request.push(byte1) request.push(byte2) request.pop() size = Size(block_name="unit-test-block", request=request, fuzzable=True, name="Size block") request.push(size) context.uut = size
def request_one_block_with_size_change(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=Request) request.push(block) size_changing_block = SizeChangingBlock(name="size-changing-block") request.push(size_changing_block) request.pop() size = Size(block_name="size-changing-block", request=request, fuzzable=True, name="Size block") request.push(size) context.uut = size context.block = block context.request = request
def request_one_block(context): request = Request(name="unit-test-request") block = Block(name="unit-test-block", request=request) request.push(block) byte1 = Byte(0x01, name="Byte block 1") request.push(byte1) request.pop() context.uut = block
def request_one_block(context, value): request = Request(name="unit-test-request") block = Block(name="unit-test-block", request=request) request.push(block) byte1 = Byte(default_value=value, name="Byte block 1") request.push(byte1) request.pop() context.uut = block
def request_one_block(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=Request) request.push(block) size_changing_block = SizeChangingBlock(name="size-changing-block") request.push(size_changing_block) request.pop() size = Size(block_name="size-changing-block", request=request, fuzzable=True, name="Size block") request.push(size) context.uut = size context.block = block context.request = request
def request_one_block(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=Request) request.push(block) byte1 = Byte(0x01, name="Byte block 1") byte2 = Byte(0x02, name="Byte block 2") request.push(byte1) request.push(byte2) size = Size(block_name="unit-test-block", request=request, fuzzable=True, name="Size block") request.push(size) request.pop() context.uut = size
def request_multiple_blocks(context): r = Request("unit-test-request") r.push(primitives.Byte(value=1, name="string block")) r.push( primitives.String(value="The perfection of art is to conceal art.", name="unit-test-byte")) context.uut = r
def a_checksum(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=request) request.push(block) byte1 = Byte(default_value=0x01, name="Byte block 1") byte2 = Byte(default_value=0x02, name="Byte block 2") block.push(byte1) block.push(byte2) checksum = Checksum(block_name="unit-test-block", request=request, fuzzable=True, name="Checksum block") request.push(checksum) request.pop() context.uut = checksum context.block = block context.request = request
def a_checksum(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=request) request.push(block) byte1 = Byte(0x01, name="Byte block 1") byte2 = Byte(0x02, name="Byte block 2") block.push(byte1) block.push(byte2) checksum = Checksum(block_name="unit-test-block", request=request, fuzzable=True, name="Checksum block") request.push(checksum) request.pop() context.uut = checksum context.block = block context.request = request
def request_one_block(context): r = Request("unit-test-request") r.push(primitives.Byte(value=0, name="byte block")) context.uut = r
def udp_checksum(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=request) request.push(block) ipv4_packet = QWord(0x01, name="IPv4 Packet") ipv4_src = DWord(0x12345678, name="IPv4 Src Block") ipv4_dst = DWord(0x23456789, name="IPv4 Dst Block") request.push(ipv4_packet) request.push(ipv4_src) request.push(ipv4_dst) checksum = Checksum( block_name="IPv4 Packet", ipv4_src_block_name="IPv4 Src Block", ipv4_dst_block_name="IPv4 Dst Block", request=request, fuzzable=True, algorithm="udp", name="Checksum block", ) request.push(checksum) request.pop() context.uut = checksum context.block = ipv4_packet context.request = request context.ipv4_src = ipv4_src context.ipv4_dst = ipv4_dst
def udp_checksum(context): request = Request("unit-test-request") block = Block(name="unit-test-block", request=request) request.push(block) ipv4_packet = QWord(0x01, name="IPv4 Packet") ipv4_src = DWord(0x12345678, name="IPv4 Src Block") ipv4_dst = DWord(0x23456789, name="IPv4 Dst Block") request.push(ipv4_packet) request.push(ipv4_src) request.push(ipv4_dst) checksum = Checksum(block_name="IPv4 Packet", ipv4_src_block_name="IPv4 Src Block", ipv4_dst_block_name="IPv4 Dst Block", request=request, fuzzable=True, algorithm='udp', name="Checksum block", ) request.push(checksum) request.pop() context.uut = checksum context.block = ipv4_packet context.request = request context.ipv4_src = ipv4_src context.ipv4_dst = ipv4_dst
def request_multiple_blocks(context): r = Request("unit-test-request") r.push(primitives.Byte(value=1, name="string block")) r.push(primitives.String(value="The perfection of art is to conceal art.", name="unit-test-byte")) context.uut = r