Skip to content

Commit 4d5fa1c

Browse files
committed
main,smoke: run in private netns
Since commits c561b28 ("infra: sync iface addresses to per-VRF gr-loopX so kernel can bind") and 391f9fa ("infra: create VRF and default route for each loopback interface"), addresses and default routes are synchronized on the gr-loop0 Linux tun interface. These elements can clash with local addresses in the default namespace. To ensure smooth operation, always run grout in its own namespace. Update the systemd service and smoke tests accordingly. Signed-off-by: Robin Jarry <rjarry@redhat.com>
1 parent 2514800 commit 4d5fa1c

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

main/grout.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ EnvironmentFile=-/etc/default/grout
1313
ExecStartPre=/usr/bin/udevadm settle
1414
ExecStart=/usr/bin/grout $GROUT_OPTS
1515
ExecStartPost=/usr/bin/grcli -xef /etc/grout.init
16+
PrivateNetwork=true
1617

1718
[Install]
1819
WantedBy=multi-user.target

smoke/run.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ if [ -n "${builddir+x}" ] && \
2828
test_frr=true
2929
fi
3030

31+
ip netns del grout 2>/dev/null || :
32+
ip netns add grout
33+
trap "ip netns del grout" EXIT
34+
3135
for script in $here/*_test.sh; do
3236
name=$(basename $script)
3337
case "$name" in
@@ -42,20 +46,10 @@ for script in $here/*_test.sh; do
4246

4347
{
4448
echo "====================================================="
45-
echo "+ $script $builddir"
46-
if ! "$script" "$builddir"; then
49+
echo "+ ip netns exec grout $script $builddir"
50+
if ! ip netns exec grout "$script" "$builddir"; then
4751
res=FAILED
4852
fi
49-
for core in /tmp/grout-core.*.*; do
50-
[ -s "$core" ] || continue
51-
binary=$(file -b "$core" | sed -En "s/.*, execfn: '([^']+)',.*/\\1/p")
52-
[ -x "$binary" ] || continue
53-
gdb -ex 'info threads' \
54-
-ex 'thread apply all bt full' \
55-
-ex 'quit' \
56-
"$binary" -c "$core" || true
57-
rm -f "$core"
58-
done
5953
end=$(date +%s)
6054
duration=$(date -d "@$((end - start))" "+%Mm%Ss")
6155
echo "-----------------------------------------------------"

0 commit comments

Comments
 (0)