]> git.proxmox.com Git - mirror_frr.git/blame - tests/lib/fuzz_zlog_inputs.py
tests: improve the ospfapi test (move to square topology)
[mirror_frr.git] / tests / lib / fuzz_zlog_inputs.py
CommitLineData
acddc0ed 1# SPDX-License-Identifier: GPL-2.0-or-later
28297b1e
DL
2# zlog fuzz-tester input generator
3#
4# Copyright (C) 2021 David Lamparter for NetDEF, Inc.
28297b1e
DL
5
6from itertools import chain
7import struct
8
9lengths = set([128])
10# lengths = [[i, i + 1, i + 3, i - 1, i - 3] for i in lengths]
11# lengths = set([i for i in chain(*lengths) if i >= 0])
12
13dsts = [0, 1, 2, 3]
14fmts = [0, 1, 2, 3]
15
16
17def combo():
18 for l0 in lengths:
19 for l1 in lengths:
20 for l2 in lengths:
21 for fmt in fmts:
22 for dst in dsts:
23 yield (l0, l1, l2, fmt, dst)
24
25
26for i, tup in enumerate(combo()):
27 with open("input/i%d" % i, "wb") as fd:
28 fd.write(struct.pack("HHHBB", *tup))