Skip to content

Commit 5dd0b9e

Browse files
committed
config_fuzzer: run generate -i against the entire dataset
Now that the datalist was replaced with hash tables, run the generator with --ignore-errors against the entire dataset. The datalist was leaking memory and causing ASAN to crash the test. Also limit the value of path-cost to avoid triggering a g_assert(v < G_MACUINT).
1 parent 337eab4 commit 5dd0b9e

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

tests/config_fuzzer/runner.sh

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,29 +121,26 @@ echo "$(date) - Done"
121121

122122
echo "$(date) - Running netplan generate -i"
123123

124-
for yaml in ${FAKEDATADIR}/*.yaml
125-
do
126-
rm -rf fakeroot3
127-
mkdir -p fakeroot3/etc/netplan
128-
cp ${yaml} fakeroot3/etc/netplan/
124+
# Run the generator against the entire dataset
129125

130-
OUTPUT=$(${NETPLAN_GENERATE_PATH} --root-dir fakeroot3 -i 2>&1)
131-
code=$?
132-
if [ $code -eq 139 ] || [ $code -eq 245 ] || [ $code -eq 133 ]
133-
then
134-
echo "GENERATE --ignore-errors CRASHED"
135-
cat ${yaml}
136-
error=1
137-
fi
126+
rm -rf fakeroot3
127+
mkdir -p fakeroot3/etc/
128+
mv ${FAKEDATADIR} fakeroot3/etc/netplan
138129

139-
if grep 'detected memory leaks' <<< "$OUTPUT" > /dev/null
140-
then
141-
echo "GENERATE --ignore-errors MEMORY LEAK DETECTED"
142-
cat ${yaml}
143-
error=1
144-
fi
130+
OUTPUT=$(${NETPLAN_GENERATE_PATH} --root-dir fakeroot3 -i 2>&1)
131+
code=$?
132+
# code 134 happens when a g_assert() is triggered
133+
if [ $code -eq 139 ] || [ $code -eq 245 ] || [ $code -eq 133 ] || [ $code -eq 134 ]
134+
then
135+
echo "GENERATE --ignore-errors CRASHED"
136+
error=1
137+
fi
145138

146-
done
139+
if grep 'detected memory leaks' <<< "$OUTPUT" > /dev/null
140+
then
141+
echo "GENERATE --ignore-errors MEMORY LEAK DETECTED"
142+
error=1
143+
fi
147144

148145
echo "$(date) - Done"
149146

tests/config_fuzzer/schemas/bridges.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,18 @@ const bridges_schema = {
124124
properties: {
125125
eth0: {
126126
type: "integer",
127+
minimum: 0,
128+
maximum: 4000000000
127129
},
128130
eth1: {
129131
type: "integer",
132+
minimum: 0,
133+
maximum: 4000000000
130134
},
131135
eth2: {
132136
type: "integer",
137+
minimum: 0,
138+
maximum: 4000000000
133139
},
134140
}
135141
},

0 commit comments

Comments
 (0)