Merge pull request #10967 from evverx/check-directives

travis: make sure that *.perf and directives.* files are in sync
This commit is contained in:
Yu Watanabe 2018-11-28 14:02:42 +09:00 committed by GitHub
commit 66e3834010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,11 @@
[NetDev]
Name=erspan-test
Kind=erspan
[Tunnel]
Independent=true
ERSPANIndex=123
Local=172.16.1.200
Remote=172.16.1.100
Key=101
SerializeTunneledPackets=true

View file

@ -74,6 +74,8 @@ EncapsulationLimit=
TTL=
FOUSourcePort=
IPv6RapidDeploymentPrefix=
ERSPANIndex=
SerializeTunneledPackets=
[VXLAN]
UDP6ZeroChecksumRx=
ARPProxy=

21
tools/check-directives.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
set -e
function generate_directives() {
perl -aF'/[\s,]+/' -ne '
if (my ($s, $d) = ($F[0] =~ /^([^\s\.]+)\.([^\s\.]+)$/)) { $d{$s}{"$d="} = 1; }
END { while (my ($key, $value) = each %d) {
printf "[%s]\n%s\n", $key, join("\n", keys(%$value))
}}' "$1"
}
if [[ $(generate_directives src/network/networkd-network-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-network-parser/directives.network) ]]; then
echo "Looks like test/fuzz/fuzz-network-parser/directives.network hasn't been updated"
exit 1
fi
if [[ $(generate_directives src/network/netdev/netdev-gperf.gperf | wc -l) -ne $(wc -l <test/fuzz/fuzz-netdev-parser/directives.netdev) ]]; then
echo "Looks like test/fuzz/fuzz-netdev-parser/directives.netdev hasn't been updated"
exit 1
fi

View file

@ -50,6 +50,7 @@ for phase in "${PHASES[@]}"; do
$DOCKER_EXEC meson --werror -Dtests=unsafe -Dslow-tests=true build
$DOCKER_EXEC ninja -v -C build
$DOCKER_EXEC ninja -C build test
$DOCKER_EXEC tools/check-directives.sh
;;
RUN_ASAN)
$DOCKER_EXEC git clean -dxff